Skip to content

Commit

Permalink
Calypso Admin Plans Page: Allow coupon query param (#95630)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeyip authored Oct 23, 2024
1 parent f59fa7f commit 1ba623e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/my-sites/plans/controller.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,22 @@ export function plans( context, next ) {
return productSelect( '/plans' )( context, next );
}

// Emails rely on the `discount` query param to auto-apply coupons
// from the Calypso admin plans page. The `/start` onboarding flow
// plans page, however, relies on the `coupon` query param for the
// same purpose. We handle both coupon and discount here for the time
// being to avoid confusion. We'll probably consolidate to just `coupon`
// in the future.
const withDiscount = context.query.coupon || context.query.discount;

context.primary = (
<Plans
context={ context }
intervalType={ context.params.intervalType }
customerType={ context.query.customerType }
selectedFeature={ context.query.feature }
selectedPlan={ context.query.plan }
withDiscount={ context.query.discount }
withDiscount={ withDiscount }
discountEndDate={ context.query.ts }
redirectTo={ context.query.redirect_to }
redirectToAddDomainFlow={
Expand Down

0 comments on commit 1ba623e

Please sign in to comment.