webnetcrea Posted October 25, 2018 Share Posted October 25, 2018 Hello, I want to display the availability message on the basket summary page, I used this piece of code on the product list page everything works, but against the basket page it does not work the product is always displayed as in stock, how can you get the right availability message on the shopping cart page? The site is under prestashop 1.7.4.3 Thank you {block name='product_availability'} <span id="product-availability"> {if $product.show_availability && $product.availability_message} {if $product.availability == 'available'} <i class="material-icons rtl-no-flip product-available"></i> {elseif $product.availability == 'last_remaining_items'} <i class="material-icons product-last-items"></i> {else} <i class="material-icons product-unavailable"></i> {/if} {$product.availability_message} {/if} </span> {/block} Link to comment Share on other sites More sharing options...
afshop Posted June 25, 2020 Share Posted June 25, 2020 On 10/25/2018 at 4:29 PM, webnetcrea said: Hello, I want to display the availability message on the basket summary page, I used this piece of code on the product list page everything works, but against the basket page it does not work the product is always displayed as in stock, how can you get the right availability message on the shopping cart page? The site is under prestashop 1.7.4.3 Thank you {block name='product_availability'} <span id="product-availability"> {if $product.show_availability && $product.availability_message} {if $product.availability == 'available'} <i class="material-icons rtl-no-flip product-available"></i> {elseif $product.availability == 'last_remaining_items'} <i class="material-icons product-last-items"></i> {else} <i class="material-icons product-unavailable"></i> {/if} {$product.availability_message} {/if} </span> {/block} Hello did you solve it? Thanks angela Link to comment Share on other sites More sharing options...
DARKF3D3 Posted April 10, 2021 Share Posted April 10, 2021 Here's the solution to show product availability on cart (tested on PS1.7.7.3): File to be modified: themes/classic/templates/catalog/_partials/product-add-to-cart.tpl {if $product.stock_quantity<=0} <span style="font-weight:700;color:red;">Out of stock</span> {elseif $product.stock_quantity < $product.quantity} <span style="font-weight:700;color:orange;">Non available in the desidered quantity</span> {else} <span style="font-weight:700;color:green;">Available</span> {/if} 1 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