Hi,
I am using a 2.2.4 installation with default “computer[size=3]_shop[/size]” template and compact list as default view for product listing.
It is important to sort the products by sku, but the default availiable options do not include it.
Cs cart Knowledge base here explains a simple way to add a sort by time stamp option:
In the fn.catalog.php file located in the core directory i found
[color=#1B8D01]$sorting = array( [/color]
[color=#1B8D01]'position' => array('description' => fn_get_lang_var('default'), 'default_order' => 'asc'), [/color]
[color=#1B8D01]'product' => array('description' => fn_get_lang_var('name'), 'default_order' => 'asc'), [/color]
[color=#1B8D01]'price' => array('description' => fn_get_lang_var('price'), 'default_order' => 'asc'), [/color]
[color=#1B8D01]'popularity' => array('description' => fn_get_lang_var('popularity'), 'default_order' => 'desc') [/color]
[color=#1B8D01]);[/color]
So folowing the kb instructions i added:
'sku' => array('description' => fn_get_lang_var('sku'), 'default_order' => 'asc'),
The resault is that i see the option of SKU when choosing sort by, it seems to work for a few seconds in order to sort them but finally they stay the same.
All the other sorting option work just fine.
Is there something else that i sould have done to make it work?
You need to use “code” and not “sku”. Here is a thread I posted for 2.x. Product Sorting v2.x - Hints & Modifications - CS-Cart Community Forums
'code' => array('description' => fn_get_lang_var('code'), 'default_order' => 'asc'),
It work just fine.Thanks a lot!