Skip to content

Commit

Permalink
feat: DigitalSubscription subscribe CTA initial re-route
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-daniel-dempsey committed Jan 30, 2025
1 parent 181564f commit 0450b01
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions support-frontend/assets/helpers/urls/routes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// ----- Routes ----- //
import type { BillingPeriod } from 'helpers/productPrice/billingPeriods';
import type {
FulfilmentOptions,
PaperFulfilmentOptions,
Expand Down Expand Up @@ -29,8 +30,8 @@ const routes = {
payPalRestReturnURL: '/paypal/rest/return',
subscriptionCreate: '/subscribe/create',
subscriptionsLanding: '/subscribe',
checkout: '/checkout',
digitalSubscriptionLanding: '/subscribe/digitaledition',
digitalSubscriptionLandingGift: '/subscribe/digital/gift',
paperSubscriptionLanding: '/subscribe/paper',
paperSubscriptionProductChoices: '/subscribe/paper#HomeDelivery',
paperSubscriptionDeliveryProductChoices:
Expand Down Expand Up @@ -83,13 +84,14 @@ function paperSubsUrl(

function digitalSubscriptionLanding(
countryGroupId: CountryGroupId,
gift: boolean,
billingPeriod?: BillingPeriod,
) {
return `${getOrigin()}/${countryPath(countryGroupId)}${
gift
? routes.digitalSubscriptionLandingGift
: routes.digitalSubscriptionLanding
}`;
const routeDigitalSubscription = billingPeriod
? routes.checkout
: routes.digitalSubscriptionLanding;
return `${getOrigin()}/${countryPath(
countryGroupId,
)}${routeDigitalSubscription}`;
}

function guardianWeeklyLanding(countryGroupId: CountryGroupId, gift: boolean) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function DigitalPackTerms(props: PropTypes) {
'By entering the promotion you are accepting these terms and conditions.',
<div>
To enter the promotion, you must: (i) either go to{' '}
<a href={digitalSubscriptionLanding(props.countryGroupId, false)}>
<a href={digitalSubscriptionLanding(props.countryGroupId)}>
support.theguardian.com
</a>{' '}
or call +44 (0) 330 333 6767 and quote promotion code {props.promoCode}{' '}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const digital = (
buttons: [
{
ctaButtonText: 'Find out more',
link: digitalSubscriptionLanding(countryGroupId, false),
link: digitalSubscriptionLanding(countryGroupId),
analyticsTracking: sendTrackingEventsOnClick({
id: 'digipack_cta',
product: 'DigitalPack',
Expand Down

0 comments on commit 0450b01

Please sign in to comment.