0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-08 02:52:39 -05:00

Fixed free signup portal link for multiple tiers

no refs

- free signup portal link with multiple tiers enabled was incorrectly showing all tiers instead of just free
This commit is contained in:
Rishabh 2022-01-27 14:57:47 +05:30
parent 3c8a3a90c4
commit 67544a071a
3 changed files with 9 additions and 5 deletions

View file

@ -446,8 +446,8 @@ class SignupPage extends React.Component {
}
renderProducts() {
const {site} = this.context;
const products = getSiteProducts({site});
const {site, pageQuery} = this.context;
const products = getSiteProducts({site, pageQuery});
return (
<>
<ProductsSection

View file

@ -39,7 +39,7 @@ const products = [
// }),
// numOfBenefits: 3
// })
// ,
// getProductData({
// name: 'Friends of the Blueprint',
// description: 'Get access to everything and lock in early adopter pricing for life + listen to my podcast',
@ -67,7 +67,7 @@ export const site = getSiteData({
yearly: 150000,
currency: 'USD'
},
// Simulate pre-multiple-tiers state:
// products: [products.find(d => d.type === 'paid')],
// portalProducts: null,

View file

@ -256,8 +256,12 @@ export function hasBenefits({prices, site}) {
});
}
export function getSiteProducts({site}) {
export function getSiteProducts({site, pageQuery}) {
const products = getAvailableProducts({site});
const showOnlyFree = pageQuery === 'free' && hasFreeProductPrice({site});
if (showOnlyFree) {
return [];
}
if (hasFreeProductPrice({site}) && products.length > 0) {
products.unshift({
id: 'free'