You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
NOTE: This post was created on 2023-06-23 on the Kryptronic eCommerce Community facebook page, which has been replaced with this forum. All facebook support content was migrated into this forum in April 2024.
Anthony:
Country List Issue: I solved this in K8, but cannot remember how and need this in K9
I need to make sure that the Country List select appears in SORT order, at the moment all the forms are showing them in alphabetical order.
I thought it would be just a simple matter of modifying the "core_country" table and set the sortorder field to "ASC", however that table already has that command in it...
So a little lost....
Kryptronic:
Anthony, there is a post below by Graham that covers this topic. Follow the instructions there and you should be good. Also, we have an update coming that fixes that issue and adds a ton of SEO features, including the new GA4. The update will be available soon. I will post the instructions on how to update your software once the update is released.
Anthony:
This seems not to work, unless my cookies are causing an issue............. . // +------------------------------------------------------------------+
// | Function: get_country_info |
// +------------------------------------------------------------------+
function get_country_info () {
// +--
// | This function provides an array of countries as keys with
// | all the data fields as values.
// +--
static $country; if (!(empty($country))) {return $country;}
$sql = 'SELECT * FROM core_country';
$result = $this->CORE_DB->sql_do(array('sql' => $sql, 'table' => 'core_country', 'sort' => array('id' => 'ASC')));
if ($this->IsError($result)) {return array();}
if (empty($result)) {return array();}
foreach ($result as $num => $row) {$country[$row['id']] = $row;}
if ($this->debug) {$this->debugger("get_country_info: Built country information array.");}.......... The code I would need to change is this: .$result = $this->CORE_DB->sql_do(array('sql' => $sql, 'table' => 'core_country', 'sort' => array('id' => 'ASC'))); I changed it to this: $result = $this->CORE_DB->sql_do(array('sql' => $sql, 'table' => 'core_country', 'sort' => array('sortorder' => 'ASC'))); but did not work
Anthony:
Just a footnote: the code I tried was: $result = $this->CORE_DB->sql_do(array('sql' => $sql, 'table' => 'core_country', 'sort' => array('sortorder' => 'ASC', 'id' => 'ASC')));
Anthony:
Just another thought... would it work if I changed the index key from "id" to "sortorder" in phpadmin?
Offline