Skip to content

fix: run update_checkout on loading page 2 for physical products#2292

Closed
laurelfulford wants to merge 1 commit intotrunkfrom
fix/transaction-details-my-account
Closed

fix: run update_checkout on loading page 2 for physical products#2292
laurelfulford wants to merge 1 commit intotrunkfrom
fix/transaction-details-my-account

Conversation

@laurelfulford
Copy link
Copy Markdown
Contributor

@laurelfulford laurelfulford commented Feb 13, 2026

All Submissions:

Changes proposed in this Pull Request:

There's a weird edge case where the Transaction Details don't update with shipping costs if you're purchasing a physical product through the modal checkout. This PR fixes that.

How to test the changes in this Pull Request:

  1. If you haven't already, under WooCommerce > Settings > Shipping > Shipping Zones, add a shipping Zone (like Everywhere, for a flat rate).
  2. Set up a physical product in WooCommerce (not virtual or download-able)
  3. Set up a modal checkout button block with this product
  4. In an incognito window, run though a checkout; on the second screen, note you don't have Transaction Details (or if your physical product is also a subscription product, note that when you open Transaction details they're greyed out, and don't include your shipping costs).
  5. Apply this PR and run npm run build.
  6. In a fully new incognito window, retest step 4 (if you do it in the same session, the issue "fixes" itself sometimes).
  7. Confirm that the Transaction details show, and include your shipping information.
  8. Repeat the steps with a new physical product -- if your original product was a simple product, test with a physical subscription product, or vis versa. Run each test in a new incognito window.
  9. Repeat the testing with a couple other products:
    • a regular virtual subscription product (should show the Transaction details because it's recurring)
    • a recurring donation, and opt in to cover the fees as the reader (should show the Transaction details because it's recurring, and include the transaction fee)
    • a one-time donation, and opt in to cover the fees as a reader (shouldn't have the Transaction details initially, but the label should appear when you opt to cover the fees, and include them in the total in the table)

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@laurelfulford laurelfulford requested a review from a team as a code owner February 13, 2026 19:44
@laurelfulford laurelfulford requested review from Copilot and removed request for a team February 13, 2026 19:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses an edge case in the modal checkout flow where Transaction Details (order review totals) don’t reflect shipping costs for physical products on step 2, by forcing a WooCommerce totals refresh when transitioning from editing details (step 1) to the payment/review step (step 2).

Changes:

  • Trigger update_checkout when moving into step 2 (setEditingDetails( false )) to ensure shipping/totals are recalculated and rendered.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@leogermani
Copy link
Copy Markdown
Contributor

I could not reproduce the bug... But things still work with this PR... maybe something else needed to reproduce it?

@laurelfulford
Copy link
Copy Markdown
Contributor Author

Weird!

I set up a JN site and got the issue showing there -- I'm wondering if it's something about the shipping settings? (though I'm not sure what 😕).

CleanShot 2026-03-04 at 08 58 29

@laurelfulford
Copy link
Copy Markdown
Contributor Author

Confirmed that I also can't recreate part of the issue (the transaction details not showing for a non-subscription physical product) AND that this doesn't fix the other part (the transaction details being greyed out when they do show). Closing this PR, I'll try to figure out another way. Thanks @leogermani!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants