DARKF3D3 Posted September 1, 2021 Share Posted September 1, 2021 I'm trying to show on product page the quantity of a product that the customer already added to the cart. For example if the customer added 5 quantity of the product, show below the add to cart button: "You have 5 product-name into the cart" I checked the available variables into the "product-add-to-cart.tpl" but I can't find one that allow me to do that. Does anyone know how to do that? Link to comment Share on other sites More sharing options...
Luis C Posted September 10, 2021 Share Posted September 10, 2021 Try using the object $cart to iterate all cart items. If your cart item id equals your product page product id, then show the cart_quantity. I.E. {foreach $cart.products item=item} {if $item->id_product == $product.id} {$item->cart_quantity} {/if} {/foreach} 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