Jump to content

Multiple sortby items in a category


DKM84

Recommended Posts

Hi,

 

I have a lot of items in my shop and if possible I would like them to be sorted by quantity and out-of-stock

 

in stock items first.

then the 0 in stock but still available for ordering

and last the 0 in stock and unavailable for ordering.

 

I have set PS_PRODUCTS_ORDER_BY to 6 in phpmyadmin

 

I am gonna remove the dropdown menu on the front-end, so manual sorting is no longer possible.

 

I now have al items that are in stock on top, but after that it's a mess ^_^

 

I tried editing classes/product.php -> getAllProducts

 

ORDER BY '.(isset($orderByPrefix) ? pSQL($orderByPrefix).'.' : '').'`'.pSQL($orderBy).'` '.pSQL($orderWay).'
		LIMIT '.intval($pageNumber * $nbProducts).', '.intval($nbProducts));

 

But I have been unsuccesfull, anybody got some advice on this?

 

//add prestashop 1.3.1

Link to comment
Share on other sites

  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...