Skip to content
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

Domain-To-Plan Credit: Don't apply domain proration cost override to plans grid #99144

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/data-stores/src/plans/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@ export const PERIOD_LIST = [

export const COST_OVERRIDE_REASONS = {
RECENT_PLAN_PRORATION: 'recent-plan-proration',
RECENT_DOMAIN_PRORATION: 'recent-domain-proration',
};
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,17 @@ const usePricingMetaForGridPlans = ( {
// If there is, however, a sale coupon, show the discounted price
// without proration. This isn't ideal, but is intentional. Because of
// this, the price will differ between the plans grid and checkout screen.
const costOverrideCode = sitePlan?.pricing?.costOverrides?.[ 0 ]?.overrideCode;
const hasProratedCostOverride =
costOverrideCode &&
[
COST_OVERRIDE_REASONS.RECENT_PLAN_PRORATION,
COST_OVERRIDE_REASONS.RECENT_DOMAIN_PRORATION,
].includes( costOverrideCode );
if (
! sitePlan?.pricing?.hasSaleCoupon &&
! withProratedDiscounts &&
sitePlan?.pricing?.costOverrides?.[ 0 ]?.overrideCode ===
COST_OVERRIDE_REASONS.RECENT_PLAN_PRORATION
hasProratedCostOverride
) {
return [
planSlug,
Expand Down