diff --git a/shop/components/order-wizard.tsx b/shop/components/order-wizard.tsx index 8673786..54c696b 100644 --- a/shop/components/order-wizard.tsx +++ b/shop/components/order-wizard.tsx @@ -203,6 +203,19 @@ export function OrderWizard({ ) }, [categories, selectedBillingInterval]) + const isProductDisabled = (product: Product, currentCategoryId: string) => { + const baseCategoryId = visibleCategories[0]?.id + if (!baseCategoryId || currentCategoryId === baseCategoryId) return false + + const baseProductId = selections[baseCategoryId]?.productId + if (!baseProductId) return false + + const baseProduct = products.find(p => p.id === baseProductId) + if (!baseProduct) return false + + return baseProduct.exclusions?.includes(product.id) || product.exclusions?.includes(baseProductId) + } + // Per-category selection map: categoryId -> { productId, productIds, moduleIds } const [selections, setSelections] = useState>(() => { const initInterval = initialOrder?.order_data?.billing_cycle ?? 'monthly' @@ -970,20 +983,24 @@ export function OrderWizard({
{catProducts.map(product => { const isChecked = sel?.productIds?.includes(product.id) ?? false + const disabled = isProductDisabled(product, cat.id) return (