Skip to content

Commit

Permalink
Fix the exit checkout flow by proper redirecting back to /plans page
Browse files Browse the repository at this point in the history
  • Loading branch information
paulopmt1 committed Feb 1, 2025
1 parent 9cd65c7 commit e32ff6d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/landing/stepper/declarative-flow/onboarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,19 @@ const onboarding: Flow = {
if ( providedDependencies.goToCheckout ) {
const siteSlug = providedDependencies.siteSlug as string;

const checkoutBackUrl =
createWithBigSky && isBigSkyBeforePlansExperiment && isGoalsAtFrontExperiment
? '/setup/onboarding/plans'
: destination;

// replace the location to delete processing step from history.
window.location.replace(
addQueryArgs( `/checkout/${ encodeURIComponent( siteSlug ) }`, {
redirect_to: destination,
signup: 1,
checkoutBackUrl: pathToUrl( addQueryArgs( destination, { skippedCheckout: 1 } ) ),
checkoutBackUrl: pathToUrl(
addQueryArgs( checkoutBackUrl, { skippedCheckout: 1 } )
),
coupon,
} )
);
Expand Down

0 comments on commit e32ff6d

Please sign in to comment.