From 097dfe4452ed9c9cec63bf683234a96c1313b2c4 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Thu, 17 Jun 2021 17:18:34 +0530 Subject: [PATCH] Handled available Products based on prices refs https://github.com/TryGhost/Team/issues/767 - takes into account available prices to decide if multiple products screen needs to be shown --- ghost/portal/src/utils/helpers.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ghost/portal/src/utils/helpers.js b/ghost/portal/src/utils/helpers.js index d3abd4b2b0..82e7b30dcb 100644 --- a/ghost/portal/src/utils/helpers.js +++ b/ghost/portal/src/utils/helpers.js @@ -141,6 +141,12 @@ export function hasMultipleProducts({site = {}}) { const { products = [] } = site || {}; + if (site.portal_plans && !site.portal_plans.includes('monthly') && !site.portal_plans.includes('yearly')) { + return false; + } + if (site.portal_products && site.portal_products.length < 2) { + return false; + } if (products?.length > 1) { return true; }