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:
parent
3c8a3a90c4
commit
67544a071a
3 changed files with 9 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Add table
Reference in a new issue