swellstores / swell-js

JS library for building storefronts and checkouts with Swell ecommerce.
https://swell.is
MIT License
138 stars 29 forks source link

Payment Windows Show Outdated Cart Amounts After Cart Updates #181

Open mohitkumar29 opened 2 months ago

mohitkumar29 commented 2 months ago

Hi,

I am rendering payment buttons (e.g., PayPal, Apple Pay) on a page where users can update their cart (e.g., update quantity, apply coupons).

The issue I'm encountering is that after the buttons are rendered, any updates made to the cart are not reflected when clicking on any of the buttons. Instead, the payment windows show the old amount from before the updates.

Could you please suggest a solution to ensure that the payment windows reflect the updated cart amount?

vstudenichnik-insoft commented 2 months ago

Hi @mohitkumar29, Unfortunately, this is technically impossible. After rendering payment buttons, it is only possible to change the shipping method/price if this is supported by the payment modal/page (which is displayed after clicking on the payment button). So it looks like you need to add a checkout step to render the payment buttons where customers cannot change the cart amount.