Jump to content

Out of Stock products hidden in Catalog & Search but visible via URL


pozpoz

Recommended Posts

I am trying to hide out of stock products from Catalog and Search but leave accesible via URL.

How to do it? Are there modules for it?

Tried to modify search controller but in search I lost paging (not all product showed).

Any tips?

Link to comment
Share on other sites

Hi,

9 hours ago, pozpoz said:

hide out of stock products from Catalog

  • In your Prestashop admin panel, go to Catalog > Products and filter products by "Out of stoc." Then, edit each product and change its visibility to "Nowhere." This will hide the products from catalog listings and search results.

 

9 hours ago, pozpoz said:

Tried to modify search controller but in search I lost paging (not all product showed)

  • Instead of directly modifying the core controllers, you should override them in your custom module or theme. This allows you to maintain the original functionality while adding your custom logic.
  • Override the templates responsible for displaying product listings in your theme. Here, you can add logic to check if the product is out of stock and conditionally display it. This way, the products will still be accessible via direct URL but won't appear in search results or catalog listings.
  • When overriding controllers or templates, make sure to handle pagination correctly to avoid issues like missing products or incorrect page counts.
  • Thoroughly test your changes to ensure that hiding out-of-stock products doesn't break any existing functionality and that products remain accessible via URL.

Hope this would help.

Thanks!

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