Hi. I’m prototyping a select color, quantity and add to cart prototype and am having trouble with the variables.
The quantity is working fine, with:
Set variable [#itemcount] to [#itemcount] + 1
And on the ‘Add to Cart’ button I have:
To make visible any added item on the cart page
if [#ItemCount] > 0 Set variable [AddedToCart] to true
And to count the number of items added to the cart
Set variable [#CartCount] to [#itemcount: Black] + [#itemcount: Chrome] + etc
- Where Black and Chrome etc are variable modes
The problem is that the CartCount is adding any quantity that is selected but I want it to only add the quantity after clicking Add to Cart eg. If I select ‘Black’ quantity 2 but don’t click Add to Cart, then select ‘Chrome’ and select quantity 2 and Add to Cart, the cart counter will show 4 and not 2.
I thinking I need some statement that says ‘only add quantity if Add to Cart is clicked’ but I can’t figure it out with variables.
Thanks for your help.