-
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
Plans (grid): Reflect storage add-on selection on intro offer price and billing desc #95428
Plans (grid): Reflect storage add-on selection on intro offer price and billing desc #95428
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
...SITE_PLANS[ PLAN_BUSINESS ], | ||
pricing: { | ||
...SITE_PLANS[ PLAN_BUSINESS ].pricing, | ||
costOverrides: [ { overrideCode: COST_OVERRIDE_REASONS.RECENT_PLAN_PRORATION } ], |
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.
No idea why this test worked previously. This is needed for the condition to pass, but curious if I'm missing something. @aneeshd16 would you mind confirming?
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.
This was previously defined in the mock here:
wp-calypso/packages/data-stores/src/plans/hooks/test/use-pricing-meta-for-grid-plans.ts
Line 81 in 8bab616
overrideCode: 'recent-plan-proration', |
feaacc5
to
4db4997
Compare
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~1292 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 (~327 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. |
introOffer: { | ||
...introOffer, | ||
rawPrice: { | ||
monthly: 12.5 + STORAGE_ADD_ONS_MOCK[ 0 ].prices.monthlyPrice, |
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.
Non-blocking / Nitpick :
I believe that we can retrieve the rawPrice intro offer prices from the introOffer object https://github.com/Automattic/wp-calypso/pull/95428/files#diff-a46b47c6eea7443bc49db0374dd5b54d5a14a95c388dd9cca9481ce161ba6fcfR76-R77
@@ -224,7 +232,7 @@ export default function usePlanBillingDescription( { | |||
'then %(rawPrice)s billed annually, excl. taxes', | |||
{ | |||
args: { | |||
introOfferFormattedPrice: introOffer.formattedPrice, | |||
introOfferFormattedPrice: introOfferFullTermText, |
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.
Non-blocking / Nitpick:
I noticed that you marked the introOffer.formattedPrice field as deprecated.
I did a cursory search and didn't see other usages of introOffer.formattedPrice
( it was fast so not 100% certain ), so we might be able to remove the formattedPrice
field entirely. Not important for this PR, but wondering what your thoughts are @chriskmnds
@@ -112,6 +113,7 @@ const usePricingMetaForGridPlans = ( { | |||
originalPrice: Plans.PlanPricing[ 'originalPrice' ]; | |||
discountedPrice: Plans.PlanPricing[ 'discountedPrice' ]; | |||
currencyCode: Plans.PlanPricing[ 'currencyCode' ]; | |||
introOffer: Plans.PlanPricing[ 'introOffer' ]; |
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.
Non-blocking / Nitpick:
It might be worth clearly differentiating between discountPrice
and introOffer
, whether it be an inline comment here or elsewhere. I'm assuming that intro offers are also discounted prices, but for new customers only?
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.
Intro offers are a separate entity with it's own set of rules and configuration. Here's some more info :)
PCYsg-Wr4-p2
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.
The approach makes sense to me. For others following along, we:
- Update pricing meta to account for storage add-ons in intro offer pricing
- Update the header price component, which references the pricing meta
- Update billing description hook, which references the pricing meta
Left non-blocking comments, but otherwise LGTM. @chriskmnds let me know if you'd like me to create any issues for the comments -- happy to take care of that. 🚢
@merkushin you're mentioned in Christos's PR description.
Would you mind confirming the above? Everything else looks good to go. 🙂 |
Fixed the price display on the import upgrade screen via c733a4d. |
Fixes #95342
Proposed Changes
I'll skip a long description as I've run out of time. Read #95342 as this precisely addresses the issue
Why are these changes being made?
Fix #95342
Testing Instructions
Main:
/plans/:site
and/start/plans
(or/setup/onboarding/plans
)Other:
These changes also affect intro-offers displayed elsewhere.
Pre-merge Checklist