-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
composite-checkout: Fix discounted price in variant picker #43126
composite-checkout: Fix discounted price in variant picker #43126
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~39 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~8 bytes added 📈 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
Just need to make sure this works with monthly prices and bi-annual prices. There's some additional logic in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together. It's good to see the prices properly reflected there. Looking at it though, I'm not sure why I'm getting the discount. Maybe we need to add a descriptor under savings to match what we're doing with coupons (I used similar copy from our plans page but am open to suggestions):
I also noticed if I press the delete button next to total savings, it doesn't do anything. We should probably only show that if a coupon has been applied.
@fditrapani thanks! Since neither of those requests have much to do with the variant picker that's fixed by this PR I made them into their own issues that I'll tackle separately: #43167 and #43168 |
8656213
to
3ba026b
Compare
Awesome. thank you! |
3ba026b
to
0b5a275
Compare
Previously they were added to renderContactDetails instead of the output of CompositeCheckout.
0b5a275
to
5f1c27f
Compare
Changes proposed in this Pull Request
In #42723 I added a bunch of query components from old checkout to new checkout, including
QuerySitePlans
, but I accidentally added them torenderContactDetails
instead of the output ofCompositeCheckout
. One result of this is that thestate.sites.plans
Redux state was not populated, which meant that the local data used to determine if a plan should receive a prorated discount was not available. In new checkout, that data is used only for the plan variant selector (all the rest of the prices come from the shopping cart endpoint) and so the selector is showing the un-discounted price for each plan variant.This PR moves the Query components to their correct location, but even though that makes the data available, we were still not using the discounted price in the variant selector. This PR also modifies the logic for displaying the price in the selector to take the discount into account.
Fixes #43122
Testing instructions