Add hidden product option to billing components (#136)
- Introduced `hidden` field in product schema to control product visibility - Updated PlanPicker and PricingTable to filter out hidden products - Ensures hidden products are not displayed to users
This commit is contained in:
committed by
GitHub
parent
3553422e42
commit
b319ceb5bb
@@ -108,6 +108,11 @@ export function PlanPicker(
|
||||
const isRecurringPlan =
|
||||
selectedPlan?.paymentType === 'recurring' || !selectedPlan;
|
||||
|
||||
// Always filter out hidden products
|
||||
const visibleProducts = props.config.products.filter(
|
||||
(product) => !product.hidden,
|
||||
);
|
||||
|
||||
return (
|
||||
<Form {...form}>
|
||||
<div
|
||||
@@ -211,7 +216,7 @@ export function PlanPicker(
|
||||
|
||||
<FormControl>
|
||||
<RadioGroup value={field.value} name={field.name}>
|
||||
{props.config.products.map((product) => {
|
||||
{visibleProducts.map((product) => {
|
||||
const plan = product.plans.find((item) => {
|
||||
if (item.paymentType === 'one-time') {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user