Jump to content

HIDE (not disable) out of stock product


Recommended Posts

We are automatically disabling the products once they go out of stock, using SQL triggers.

But this means the product becomes unavailable for SEO and for customer reviews.

 

How can we HIDE the out of stock products from lists WITHOUT DISABLING them, so they could still be available by direct URL?

 

It is such a pitty that Prestashop doesn't have this option...

 

Thank you.

Link to comment
Share on other sites

I think the easiest way is edit every tpl files which list a products.

 

For example in product-list.tpl add one line:

...
<!-- Products list -->
<ul{if isset($id) && $id} id="{$id}"{else} id="product_list"{/if} class="product_list grid row{if isset($class) && $class} {$class}{/if}">
{foreach from=$products item=product name=products}
            
{if $product.quantity == 0}{continue}{/if} {* <-- add this line *}
            
{math equation="(total%perLine)" total=$smarty.foreach.products.total perLine=$nbItemsPerLine assign=totModulo}
{math equation="(total%perLineT)" total=$smarty.foreach.products.total perLineT=$nbItemsPerLineTablet assign=totModuloTablet}
...
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...