Jump to content

Prestashop 1.7 - Keep products out of stock at the bottom in search results


asterisco

Recommended Posts

Hello,

Does anybody know a way without modifying the core code (but, instead, overriding/using a hook) to force the search results to leave the products of out stock at the bottom. I know this is done in Faceted Search, but as you may know, Faceted Search is not applied in the regular search (ie, the one you fire when you search in the header searchbox).

Thanks in advance

Link to comment
Share on other sites

Hi ndiaga. Thanks for your answer.

Can you please be more specific?

Remember that what I want is not sort by quantity, but allow the user to sort by itw own criteria but always having products out of stock at the end.

I already achieved this overriding a big part of the search module, but a cleaner way would be great.

Thanks!

Link to comment
Share on other sites

I'm still confused. In the template I'll just have the X items (being X the size of the page), not all the elements, so the only thing I can achieve is to have the items without stock at the bottom of THAT page. That would be good only if the search results just have one page. Of course, that's not what I need: what I need is to have the out of stock products in last pages if there are several.

I don't know if I'm not being clear enought with my request or I am completely missing your point. Sorry about that, and many thanks for your patience!

Link to comment
Share on other sites

  • 4 weeks later...

Hello,

Can I ask if you solve your problem?

I'm trying to keep out of stock product at the end of category listing but only thing I get is remove products with quantity 0 (but then I have empty spaces on page).

Best regards, Janusz

Link to comment
Share on other sites

Hi x01. For the Category page is simple enough if you have Faceted Search module activated. One of its options is keeping the out of stock products at the end.

Take a look and let me know if you have any other doubt.

  • Like 1
Link to comment
Share on other sites

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...