alfredadler Posted September 11, 2022 Share Posted September 11, 2022 I want to show only the stock of the products when there are less than 10 units, does anyone know what file to modify and how? Thank you. Prestashop 1.7.8 Link to comment Share on other sites More sharing options...
JBW Posted September 14, 2022 Share Posted September 14, 2022 You can set this here Link to comment Share on other sites More sharing options...
alfredadler Posted September 14, 2022 Author Share Posted September 14, 2022 Thanks for the reply, this option shows the label "last items in stock" when the quantity is lower than... I dont know why is having this name in all the Presta versions, is not true Link to comment Share on other sites More sharing options...
JBW Posted September 14, 2022 Share Posted September 14, 2022 You can insert a code like this on your child themes product.tpl: {if $product.quantity < 11}<div>Only {$product.quantity} left on stock!</div>{/if} Link to comment Share on other sites More sharing options...
ventura Posted September 14, 2022 Share Posted September 14, 2022 {if $product.quantity < Configuration::get('PS_LAST_QTIES')} <div>{l s='Only %quantity% left on stock!' sprintf=['%quantity%'=>$product.quantity] d='Shop.Theme.Catalog'}</div>{/if} 1 Link to comment Share on other sites More sharing options...
Nickovitshj Posted September 26, 2022 Share Posted September 26, 2022 Attached you can find my solution, which I used for updating the stock quantities for my combinations using jQuery. You can adjust the logic and styling to show different styling based on the amount via conditional logic. Reason I did it through Jquery is because I wanted it to be automatically updated whenever a new combination was selected. (Listening to browser event) Most likely with simpler solutions like above you'll have a working solution. When we looking for a solution similar to mine JavaScript is needed I think HOW TO update stock quantity based on combination.docx Link to comment Share on other sites More sharing options...
Caleydon Posted September 25 Share Posted September 25 (edited) Use {$configuration.low_quantity_threshold} {if $product.quantity < $configuration.low_quantity_threshold} .... {/if} Edited September 25 by Caleydon (see edit history) 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