Jump to content

TIP: how to disable out of stock products


Recommended Posts

Some of you might wonder how to make out of stock products not showing up for users.

I know I did.

You have to edit your product-list.tpl file

After this piece of code

{foreach from=$products item=product name=products}



Add this

{if ($product.allow_oosp OR $product.quantity > 0)}



and in the bottom of the document, before this

{/foreach}



write this

{/if}



Voilá! Now your users will only see listed products that you have in stock!!

Link to comment
Share on other sites

You can also disable stock gestion in admin


...not really, at least not in this latest version of Prestashop... you can only turn off product attributes, wich is not the same (if you have a product with stock = 0, it will still be listed in the frontoffice, unless you edit the product-list.tpl file like explained in the original post of this thread).
Link to comment
Share on other sites

Thanks anabreu,

This little hack will come in handy. I was just thinking about this today. Seems like to should be a standard feature like the ability to turn off attributes. Would save some frustration on the buyers part if the product shows but is not able to be added to the cart.

I'll give it a try soon.

Link to comment
Share on other sites

  • 4 months later...

Thanks for this tip. I was getting crazy about this two.

It works perfectly in categories but i still have a problem showing out of stock products in homepage. But i dont know if it has with this nice module i have for the startpage: (french) http://www.prestashop.com/forums/viewthread/49113/modules_tiers/module_nouveaux_produits_promotions_et_produits_dune_categorie_en_page_daccueil

Can you please help me with this? I supose i need to put in the code in somemore place?

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