How to bring certain products (ie, those that need to be sold, so to speak, first of all) to the top of the list of products in the category?

  • one
    Add an attribute and after an order to buy on it - Naumov

1 answer 1

As an option to add an attribute, for example, featured type yes / no for both category and layer-by-layer navigation (categories with active filters) in the layer ..app / design / frontend / theme / package / layout / catalog.xml set default sorting, example:

<catalog_category_default translate="label"> <reference name="content"> <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml"> <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml"> <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml"> <block type="page/html_pager" name="product_list_toolbar_pager" template="page/html/pager_bottom.phtml"/> <action method="setDefaultDirection"><string>desc</string></action> <action method="setDefaultOrder"><string>featured</string></action> <action method="setSortBy"><param>featured</param></action> </block> </block> </block> </reference> 

Here's what to pay attention to, the DESC / ASC sorting type and the attribute (in this example, the featured) by which to sort

 <action method="setDefaultDirection"><string>desc</string></action> <action method="setDefaultOrder"><string>featured</string></action> <action method="setSortBy"><param>featured</param></action> 

Similarly add to section and catalogsearch.xml if needed