buy-button-js
buy-button-js copied to clipboard
Subtotal not updated when line item removed (iframe: false)
When using iframe: false
cart option, subtotal price is not updated when a line item is removed, while other items remain in the cart.
I am experiencing the same issue and found a solution.
in the original CSS they have this line:
.shopify-buy__cart-item.is-hidden { -webkit-animation-name: flipOut; animation-name: flipOut; }
it seems like the .shopify-buy__cart-item.is-hidden
needs to have an animation. It can even be set to 1ms... I added this to my CSS:
.shopify-buy__cart-item.is-hidden { animation: flipOut 1ms ease; }
and an animation for that... After this animation ends, the cart will be updated.
Here is a working Codepen.
Do not forget to change the div
id in the HTML and JS on lines 22
, 24
, 29
, 31
.
Thank you! Spent hours trying to find this bug!
Wow thanks @marco-land. I've been looking for a workaround for this since... forever.
Thank you!!