Jump to content

Out of stock quantity


n.theologos

Recommended Posts

not sure what is the purpose of your requirement - you can enter less than 2 quantity to your product stock? 

for example, if you have 20, you only enter 18?

 

by the way, on product page theme file, you can see following line, 

 

<!-- Out of stock hook -->
<div id="oosHook"{if $product->quantity > 0} style="display: none;"{/if}>
{$HOOK_PRODUCT_OOS}
</div>
 
Change it as following, it should work for you.
 
<!-- Out of stock hook -->
<div id="oosHook"{if $product->quantity > 2} style="display: none;"{/if}>
{$HOOK_PRODUCT_OOS}
</div>
 

 

 

 
Link to comment
Share on other sites

I am sorry I wasn't clear. I would like to set a low quantity threshold for each product. For example when a product has only 2 in stock left then in the front-end to be displayed 'out of stock'.

 

The tricky thing is that I need this for each product separately so I would like to know if there is any easy solution at all before starting override classes.

 

Thanx for the response

Link to comment
Share on other sites

When you say "Change the behaviour" you mean the ability to add product to cart? If yes then this is exactly what I want. When a specific stock quantity reached then the product should not be purchasable.

 

 

 

You question was only about displaying "out of stock" when quantity reaches 2 or less.

In order to control the our of stock behaviour, you will have to change multiple places. It will not be that easier. It is based on database value, it is used in SQL statements and different locations.  The easy workaround might be you enter less 2 quantity. For example, you have 10 in stock, you only enter 8. 

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