have you tried just setting all the sort orders to the same value like 0?
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
yes but they are ordered by the way i input them. this is a problem because if i have 25 options and then want to add a few new ones later i would have to redo all of the sort numbers.
i think i found the code to change this in controller/model/controller/product.php
$product_option_value_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_option_value WHERE product_option_id = '" . (int)$product_option['product_option_id'] . "' ORDER BY sort_order");
if this is the correct code, do you know what i would change it to?
i think i found the code to change this in controller/model/controller/product.php
$product_option_value_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_option_value WHERE product_option_id = '" . (int)$product_option['product_option_id'] . "' ORDER BY sort_order");
if this is the correct code, do you know what i would change it to?
that query won't cut it because that table doesn't have the names in it. the names are in product_option_value_description table which that query doesn't reference.
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
Probably not a recommended solution, but I got the product options to sort by name (value description) in OpenCart 1.4.8b by doing this modification...
I modified the file catalog/model/catalog/product.php
Replace:
With:
I modified the file catalog/model/catalog/product.php
Replace:
Code: Select all
$product_option_value_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_option_value WHERE product_option_id = '" . (int)$product_option['product_option_id'] . "' ORDER BY sort_order");
Code: Select all
// $product_option_value_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_option_value WHERE product_option_id = '" . (int)$product_option['product_option_id'] . "' ORDER BY sort_order");
$product_option_value_query = $this->db->query("SELECT
" . DB_PREFIX . "product_option_value.product_option_value_id,
" . DB_PREFIX . "product_option_value_description.name,
" . DB_PREFIX . "product_option_value.price,
" . DB_PREFIX . "product_option_value.prefix
FROM " . DB_PREFIX . "product_option_value
LEFT JOIN " . DB_PREFIX . "product_option_value_description
ON " . DB_PREFIX . "product_option_value.product_option_value_id = " . DB_PREFIX . "product_option_value_description.product_option_value_id
WHERE " . DB_PREFIX . "product_option_value.product_option_id = " . (int)$product_option['product_option_id'] . "
ORDER BY sort_order, name");
I attempted the code by Radium for 1.4.9.4, but it didn't work as expected
It pulled up this error:
Line 454:
Full block where line 454 is located:
Any suggestions?
It pulled up this error:
Code: Select all
Notice: Undefined index: extra in /home/decalb5/public_html/store/catalog/model/catalog/product.php on line 454
Code: Select all
'extras' => unserialize($product_option_value['extra']),
Code: Select all
$product_option_value_data[] = array(
'product_option_value_id' => $product_option_value['product_option_value_id'],
'name' => $product_option_value_description_query->row['name'],
'price' => $product_option_value['price'],
'prefix' => $product_option_value['prefix'],
'extras' => unserialize($product_option_value['extra']),
'extra' => unserialize($product_option['extra'])
);
Sorry to bump the thread, but has anyone figured this out? I too have run into this problem, where the instructions say that leaving the sort order at 0 should automatically sort alphabetically but the drop down menu to select an option is a whole mess.
Hi,
I've got the same problem, but for now, there's an free extension for this: http://www.opencart.com/index.php?route ... on_id=7522
Maybe this would help someone.
I've got the same problem, but for now, there's an free extension for this: http://www.opencart.com/index.php?route ... on_id=7522
Maybe this would help someone.
Yes! True. It can be a pain
But maybe someone will post a solution for this in this thread.
Edit:
I've found something here: http://forum.opencart.com/viewtopic.php?f=20&t=43356

Edit:
I've found something here: http://forum.opencart.com/viewtopic.php?f=20&t=43356
You could try this
http://www.opencart.com/index.php?route ... n_id=10341
It works for both admin and store
http://www.opencart.com/index.php?route ... n_id=10341
It works for both admin and store
Google Product Feed - Get your products into Google Shopping. Includes a bulk update facility.
Backup Pro - Backup (on demand or scheduled), Restore and Clone your store.
Freestyle Box - Add multiple information boxes on multiple pages of your store. Includes optional "Code Mode".
View my other extensions
Who is online
Users browsing this forum: Bing [Bot] and 103 guests