Christofferjonsson Posted September 29, 2022 Share Posted September 29, 2022 Hi, im running Prestashop 1.7.5 and i want to show stock quantity on only specific products in the summary (short desc) A simple way would be to somehow use smarty variables in the product summary, like {$product.stock_quantity}. Putting it in the product.tpl would show it on every product.. Any idea how to do this? Link to comment Share on other sites More sharing options...
ps8modules Posted September 29, 2022 Share Posted September 29, 2022 only for id product: 1,2,5,47 {if in_array($product.id, array(1,2,5,47)}{$product.stock_quantity}{/if} Link to comment Share on other sites More sharing options...
batteryman Posted January 11, 2023 Share Posted January 11, 2023 Bit of a newbie here. But I have been looking for this function for a while. Can you tell me how I would implement this code and where please. Cheers Happy New Year! Link to comment Share on other sites More sharing options...
Prestachamps Posted January 11, 2023 Share Posted January 11, 2023 Hi, To make it dynamic in the modules, you can save a list of product id on which you want the quantity to appear in the front office, and then you can use the code sent previously. If you don't want it to be changed dynamically every time, then only the code is enough, but this must be changed from the code every time: {if in_array($product.id, array(1,2,5,47)}{$product.stock_quantity}{/if} and in the array you write all product IDs for which you want the quantity to appear. Have a nice day. Kind regards, Leo 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