diff --git a/ghost/portal/src/utils/fixtures.js b/ghost/portal/src/utils/fixtures.js index f465776cfe..95fc341efc 100644 --- a/ghost/portal/src/utils/fixtures.js +++ b/ghost/portal/src/utils/fixtures.js @@ -115,7 +115,7 @@ export const site = { is_stripe_configured: true, portal_button: true, portal_name: true, - portal_plans: ['free', ...priceIds], + portal_plans: ['free', 'monthly', 'yearly'], portal_button_icon: 'icon-1', portal_button_signup_text: 'Subscribe now', portal_button_style: 'icon-and-text', @@ -266,5 +266,5 @@ export const member = { export const testSite = { ...site, allow_self_signup: true, - portal_plans: ['free', ...priceIds] + portal_plans: ['free', 'monthly', 'yearly'] }; diff --git a/ghost/portal/src/utils/helpers.js b/ghost/portal/src/utils/helpers.js index 532ca5b53d..90ef1580b4 100644 --- a/ghost/portal/src/utils/helpers.js +++ b/ghost/portal/src/utils/helpers.js @@ -219,7 +219,13 @@ export function getSitePrices({site = {}, includeFree = true, pageQuery = ''} = }).filter((price) => { return price.amount !== 0 && price.type === 'recurring'; }).filter((price) => { - return (portalPlans || []).includes(price.price_id); + if (price.interval === 'month') { + return (portalPlans || []).includes('monthly'); + } + if (price.interval === 'year') { + return (portalPlans || []).includes('yearly'); + } + return false; }).sort((a, b) => { return a.amount - b.amount; }).sort((a, b) => {