n.theologos Posted July 23, 2016 Share Posted July 23, 2016 Hello is it possible to change the 'out-of-stock' number for a product? For example in the front-end display 'Product out of stock' when a product has only two left in stock. Thank you and hope for a response Link to comment Share on other sites More sharing options...
shokinro Posted July 23, 2016 Share Posted July 23, 2016 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 More sharing options...
n.theologos Posted July 28, 2016 Author Share Posted July 28, 2016 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 More sharing options...
shokinro Posted July 29, 2016 Share Posted July 29, 2016 If it is just showing the message, not change the behaviour, then I think the solution I provided should be working and I think that should work for all products. Link to comment Share on other sites More sharing options...
n.theologos Posted July 29, 2016 Author Share Posted July 29, 2016 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. Link to comment Share on other sites More sharing options...
shokinro Posted July 29, 2016 Share Posted July 29, 2016 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now