FerrA Posted June 15, 2023 Share Posted June 15, 2023 (edited) Good evening guys, anyone tekll me how can I show the number of products in the cart and not they quantity? For example, if I add Apple iPod 10x quantity into cart, the number shown in the cart will be 10, but I want shown 1 and not 10. There is the code of file ps_shoppingcart.tpl of ps_shoppingcart module <div id="_desktop_cart"> <div class="blockcart cart-preview leo-blockcart show-leo-loading {if $cart.products_count > 0}active{else}inactive{/if}" data-refresh-url="{$refresh_url}" > <div class="header"> {if $cart.products_count > 0} <a rel="nofollow" aria-label="{l s='Shopping cart link containing %nbProducts% product(s)' sprintf=['%nbProducts%' => $cart.products_count] d='Shop.Theme.Checkout'}" href="{$cart_url}"> {/if} <span class="left"> <i class="icomoon icon-cart shopping-cart"></i> </span> <span class="right"> <span class="cart-text">{l s='Cart' d='Shop.Theme.Global'}</span> <span class="cart-count"> <span class="cart-products-count">{$cart.products_count}</span> <span class="totals-cart">{$cart.totals.total.value}</span> </span> </span> {if $cart.products_count > 0} </a> {/if} </div> </div> </div> Edited June 15, 2023 by FerrA (see edit history) Link to comment Share on other sites More sharing options...
FerrA Posted June 16, 2023 Author Share Posted June 16, 2023 No anyone can help me? Link to comment Share on other sites More sharing options...
ps8modules Posted June 16, 2023 Share Posted June 16, 2023 Hi: {count($cart.products)} Link to comment Share on other sites More sharing options...
AddWeb Solution Posted July 27, 2023 Share Posted July 27, 2023 On 6/15/2023 at 9:34 PM, FerrA said: Good evening guys, anyone tekll me how can I show the number of products in the cart and not they quantity? For example, if I add Apple iPod 10x quantity into cart, the number shown in the cart will be 10, but I want shown 1 and not 10. There is the code of file ps_shoppingcart.tpl of ps_shoppingcart module <div id="_desktop_cart"> <div class="blockcart cart-preview leo-blockcart show-leo-loading {if $cart.products_count > 0}active{else}inactive{/if}" data-refresh-url="{$refresh_url}" > <div class="header"> {if $cart.products_count > 0} <a rel="nofollow" aria-label="{l s='Shopping cart link containing %nbProducts% product(s)' sprintf=['%nbProducts%' => $cart.products_count] d='Shop.Theme.Checkout'}" href="{$cart_url}"> {/if} <span class="left"> <i class="icomoon icon-cart shopping-cart"></i> </span> <span class="right"> <span class="cart-text">{l s='Cart' d='Shop.Theme.Global'}</span> <span class="cart-count"> <span class="cart-products-count">{$cart.products_count}</span> <span class="totals-cart">{$cart.totals.total.value}</span> </span> </span> {if $cart.products_count > 0} </a> {/if} </div> </div> </div> Replace {$cart.products_count} with {$cart.products|@count} to get the count of unique products in the cart. <span class="cart-products-count">{$cart.products|@count}</span> Thanks! 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