Jump to content

Solution to hide out of stock products


spider17

Recommended Posts

the best way i found is to add this code in each product loop:

 
{if $product.quantity > 0}
{/if}

 

so the old code is

{foreach from=$new_products item='product' name='newProducts'}
..........
{/foreach}

 

become:

{foreach from=$new_products item='product' name='newProducts'}
{if $product.quantity > 0}

................

{/if}
{/foreach}

enjoy  :)

Link to comment
Share on other sites

hello

 

but for example, your store displays 10 products in category page (you can define how many products you want to display in BO)

script make query to database and get 10 products, for example - 9 of them have got quantity = 0.

 

you will see only 1 product on page then. it will looks weirdy especially when you will have additional pages (pagination)

one page with 1 product, several other pages with more / less products displayed...

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