From 1ba623e40447a0a8203b125832166743f0488094 Mon Sep 17 00:00:00 2001 From: Jeremy Yip Date: Wed, 23 Oct 2024 13:38:08 -0700 Subject: [PATCH] Calypso Admin Plans Page: Allow `coupon` query param (#95630) --- client/my-sites/plans/controller.jsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/my-sites/plans/controller.jsx b/client/my-sites/plans/controller.jsx index 153953bf08d99..5ac1ee5d91ed6 100644 --- a/client/my-sites/plans/controller.jsx +++ b/client/my-sites/plans/controller.jsx @@ -32,6 +32,14 @@ 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 = (