Jump to content

product order: last without stock


Recommended Posts

Do you mean in the Front Office or Back Office? In the Back Office, you can click the down arrow under the Quantity column of the product list to sort from highest to lowest quantity. In the Front Office, you can choose "in-stock first" in the "sort by" dropdown on the product listings.

Link to comment
Share on other sites

Hello Rocky, thx's for your help :)

First of all sorry for the little details in my post.

I am referring about to put by default to show for my customers in front office. When any new visit enter in my web that he view this order by default "in-stock first".

I see in preferences-products (in BO) that I can to sort this order by default, but I don't see here "in-stock first".

Thx's again for your help.

Link to comment
Share on other sites

Thanks for giving me more information. You are right that under Preferences > Products, there is no option to set the default sort order to 'in-stock first'. You could achieve this by changing lines 6 and 7 of product-sort.php from:

$orderBy = Tools::strtolower(Tools::getValue('orderby', $orderByValues[intval(Configuration::get('PS_PRODUCTS_ORDER_BY'))]));
$orderWay = Tools::strtoupper(Tools::getValue('orderway', $orderWayValues[intval(Configuration::get('PS_PRODUCTS_ORDER_WAY'))]));



to:

$orderBy = Tools::strtolower(Tools::getValue('orderby', 'quantity'));
$orderWay = Tools::strtoupper(Tools::getValue('orderway', 'desc'));

Link to comment
Share on other sites

  • 10 months later...
×
×
  • Create New...