From 880a28bb6b6af1eebd1bcefea9f3c268cf91a63d Mon Sep 17 00:00:00 2001 From: Brian Willis Date: Thu, 29 Aug 2024 23:07:49 -0500 Subject: [PATCH] Include coupon code as query param in onboarding --- client/landing/stepper/declarative-flow/onboarding.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/landing/stepper/declarative-flow/onboarding.ts b/client/landing/stepper/declarative-flow/onboarding.ts index 52747ea550b596..02d45ea45f6ad6 100644 --- a/client/landing/stepper/declarative-flow/onboarding.ts +++ b/client/landing/stepper/declarative-flow/onboarding.ts @@ -45,10 +45,11 @@ const onboarding: Flow = { useStepNavigation( currentStepSlug, navigate ) { const flowName = this.name; - const { domainCartItem, planCartItem } = useSelect( + const { domainCartItem, planCartItem, couponCode } = useSelect( ( select: ( key: string ) => OnboardSelect ) => ( { domainCartItem: select( ONBOARD_STORE ).getDomainCartItem(), planCartItem: select( ONBOARD_STORE ).getPlanCartItem(), + couponCode: select( ONBOARD_STORE ).getCouponCode(), } ), [] ); @@ -86,6 +87,7 @@ const onboarding: Flow = { addQueryArgs( `/checkout/${ encodeURIComponent( siteSlug ) }`, { redirect_to: destination, signup: 1, + coupon: couponCode, } ) ); } else {