Page 1 of 1
cart icon with a "1"
Posted: 20 May 2020, 15:14
by webprojekte
Hi,
how can I add a red "1" on our cart icon right at the top if somebody add an article to cart?
Or is there another possibility for my problem?
I need a shopping cart that shows when someone has inserted something.
URL:
https://optikpark-rathenow.de/shop-phoca
Re: cart icon with a "1"
Posted: 21 May 2020, 04:25
by maintainthedomain
you can check how I did it at shop.symposium-restaurant.de (on mobile only!)
But you will need a list of the products in the cart on the page...
JS:
var summi = 0;
jQuery('.ph-cart-small-quantity').each(function() { summi += parseInt(jQuery(this).text().charAt(0)) });
jQuery('#phItemCartBoxCount').html(summi);
if (jQuery('#phItemCartBoxCount').html() == "0" || jQuery('#phItemCartBoxCount').html() === "") { jQuery('sup#phItemCartBoxCount').hide(); }
(this works only max 9 per product ! I know...)
Re: cart icon with a "1"
Posted: 21 May 2020, 06:38
by maintainthedomain
I'm actually not sure why I put that chatAt(0) there...please check
Re: cart icon with a "1"
Posted: 21 May 2020, 22:25
by Jan
Hi, it depends on template, some templates are ready to display the top modules in row with "1", etc. see:
https://www.phoca.cz/documents/116-phoc ... 5-template
So you can try to download the overrides and paste to your template:
https://www.phoca.cz/phocacart-extensions/5-overrides
Jan