-
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
Gifting: Remove all gift products from the cart whenever one is removed #70529
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~102 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 (~102 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. |
519cda7
to
02d02bb
Compare
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.
Code looks good and it works as described!
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.
Code looks good
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/7648480 Thank you @DavidRothstein for including a screenshot in the description! This is really helpful for our translators. |
Translation for this Pull Request has now been finished. |
Proposed Changes
Subscription gifts need to be all or nothing -- for example, if someone manages to gift a plan renewal but not the corresponding primary domain renewal that was automatically added to the shopping cart, then the site would likely break when the domain expires, so it would have wound up being a confusing and not very useful gift.
Currently, this is mostly enforced on the server, but the user experience is bad -- for example, trying to remove the gift domain renewal from the cart does nothing (pdtkmj-Ks-p2#comment-1269).
This pull request makes it so removing any gift product from the cart automatically removes all the others, and changes the confirmation message for removing a gift (which previously didn't quite make sense for someone gifting a subscription to someone else's site) to match.
Before (removing a plan or domain, and in some cases the removal wouldn't actually work after you press "Continue"):
After (removing either the plan or the domain):
Testing Instructions
The easiest way to test this is to have a site with a Personal plan and custom domain, where the custom domain is set to primary, and where subscription gifting is turned on via
/settings/general/
.Log in as a different user, and visit a URL like
/checkout/personal-bundle/gift/[ID]
, where ID is the subscription ID (obtained from the server, or from the number in the URL when the original user clicks through to manage their subscription from the Purchases page). This should put the plan and domain renewal in your shopping cart as a gift.Test that if you go to remove either the plan or domain from the cart, the expected confirmation message is shown, and that going through with the removal causes both products to be removed from the cart and the cart to be emptied.
Pre-merge Checklist