New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(er-next): Pricing component and "/buy" page #1462
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
[PRODUCT_PRO_ID]: 2, | ||
[PRODUCT_STANDARD_ID]: 3, | ||
} | ||
const sortedProducts = [...products].sort( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sort products in the following order: Basic --> Pro --> Standard
const sortedProducts = [...products].sort( | ||
(a, b) => productsSortOrder[a.productId] - productsSortOrder[b.productId], | ||
) | ||
const filteredProducts = removeModuleBySlug( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove "Welcome to Epic React" module from the modules
array of product
object. It's not shown in the Pricing components as part of tier at original ER.
purchases={purchases} | ||
couponIdFromCoupon={couponIdFromCoupon} | ||
couponFromCode={couponFromCode} | ||
allowPurchase={true} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoded true
value here because it comes as false
by default from commerceProps
. @jbranchaud take a look please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to configure this to true via the NEXT_PUBLIC_SELLING_LIVE
env var in something like .env.local
products/packages/commerce-server/src/props-for-commerce.ts
Lines 21 to 23 in 4d4fa2f
const allowPurchase = | |
Boolean(process.env.NEXT_PUBLIC_SELLING_LIVE === 'true') || | |
Boolean(query.allowPurchase) |
@@ -598,7 +598,10 @@ export const Pricing: React.FC<React.PropsWithChildren<PricingProps>> = ({ | |||
{product.description && | |||
(isSellingLive || allowPurchase) && | |||
!purchased && ( | |||
<div className="prose prose-sm mx-auto max-w-sm px-5 sm:prose-base prose-p:text-gray-200"> | |||
<div | |||
data-product-description="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add data-
attribute to be able to style this element
This adds
/buy
page:For individuals
For Teams
Known issues:
Not sure how to turn off 'bulk purchases' for the Standard and Basic tiers
No Features block implemented yet (absent in sanity)
When `PricingTiers` component is used we get multiple div's with same `id` (the same situation in TT)