Sort Product By Weight

Hi,

can i add sorting by weight in product list page?



Thanks

Hi,



can i add this sort?



Thanks

I am sure you can using product filters. Take a look in the knowledge base for more info: [url=“CS-Cart Documentation — CS-Cart 4.15.x documentation”]CS-Cart Documentation — CS-Cart 4.15.x documentation

Hi editaweb,



Please let me know the CS-Cart version you use?

I use CS-CART 4.0.3, i've to add a weight filter and displaying it as a drop-down selectbox menu on category page like sort and product per page.



Thanks

[color=#282828][font=arial, verdana, tahoma, sans-serif]Hi editaweb,[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]Please try the following solution:[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]1. Open the core/fn.catalog.php file[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]2. Find the [/font][/color]fn_get_products_sorting php function and replace this part of code:


'price' => array('description' => __('price'), 'default_order' => 'asc'),


with this one:


'price' => array('description' => __('price'), 'default_order' => 'asc'),
'weight' => array('description' => __('weight'), 'default_order' => 'desc'),


3. Then go to the Adminstration->Languages->Translations page and add two language variables: [color=#333333]sort_by_weight_asc and [/color][color=#333333]sort_by_weight_desc[/color]

[color=#333333]4. Clear the cache. [/color]To do it, open in your browser: http://www.your_domain.com/admin_script.php?cc

5. Go to Settings->Appearance page and enable new sorting under the 'Available product list sorting' setting



Hope it will help.

Hi eComLabs, thanks for reply, it work fine!

You are welcome!