Hi,
Tried to search for help on this but couldn't find it, forgive me if its been asked before.
I'm looking for a way to let the shopping cart display the items sorted by item name (A-Z).
I run a photography webshop, where clients get to choose from in between 50-100 different pictures after a shoot. Right now it sorts by 'date+time added', instead of by item name. As a result, shopping cart looks like:
Photo_001
Photo_016
Photo_003
Photo_008
Photo_002
Would it at ALL be possible to change this to sort by name? Ideally I would like to have clients be able to pick their own type of sort order as they please (by clicking column names), but for now let's focus on getting the items in shopping cart sorted A-Z by item name.
Thank you so so much!
What is your OC version exactly?
XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart
In the file system/library/cart/cart.php, find the function getProducts() and add following lines of code just before the last line i.e. return $product_data;
Code: Select all
$name_order = array();
foreach ($product_data as $key => $value) {
$name_order[$key] = $value['name'];
}
$name_order = array_map('strtolower', $name_order);
array_multisort($name_order, SORT_ASC, $product_data);
XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart
Who is online
Users browsing this forum: Amazon [Bot] and 26 guests