woocommerce / woocommerce-gateway-stripe

The official Stripe Payment Gateway for WooCommerce
https://wordpress.org/plugins/woocommerce-gateway-stripe/
235 stars 206 forks source link

Cart total not updated when clicking on Payment Request buttons #2156

Open martynmjones opened 2 years ago

martynmjones commented 2 years ago

Describe the bug This might be more a feature request than a bug but given the fact that incorrect data is temporarily displayed to users I'm submitting it as a bug report.

If a user has items in their cart and then clicks on a payment request button on a product page, their cart is emptied and replaced with a single product. If the payment request modal is then immediately closed, the cart will still show the previous cart total.

To Reproduce Steps to reproduce the behavior:

  1. Create Product A ($30) and Product B ($10)
  2. Add Product A to cart
  3. Go to Product B
  4. Click on a Payment Request button and then immediately cancel
  5. Notice that the cart total on the page will still display $30 but if you go to the cart it will only contain Product B and be for $10

Expected behavior I would expect that the cart total would be updated to reflect what it actually is. Ideally, a warning should be displayed to users letting them know that their existing cart will be emptied.

Example

https://user-images.githubusercontent.com/40762232/141973578-320deb0b-edfc-44b0-884b-100964ce1b2c.mp4

Environment (please complete the following information):

martynmjones commented 2 years ago

4459057-zen