0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

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
This commit is contained in:
Rishabh 2021-06-17 17:18:34 +05:30
parent d91cd4240e
commit 097dfe4452

View file

@ -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;
}