diff --git a/customer-spa/src/pages/Checkout/index.tsx b/customer-spa/src/pages/Checkout/index.tsx index 2efe0ac..1b9720b 100644 --- a/customer-spa/src/pages/Checkout/index.tsx +++ b/customer-spa/src/pages/Checkout/index.tsx @@ -222,10 +222,11 @@ export default function Checkout() { loadCheckoutFields(); }, [cart.items, isVirtualOnly]); - // Helper to check if a standard field should be hidden (set to type: 'hidden' in PHP) + // Helper to check if a standard field should be hidden (set to type: 'hidden' or hidden: true in PHP) const isFieldHidden = (fieldKey: string): boolean => { const field = checkoutFields.find(f => f.key === fieldKey); - return field?.type === 'hidden'; + // Check both type='hidden' and the hidden flag from API + return field?.type === 'hidden' || field?.hidden === true; }; // Filter custom fields by fieldset diff --git a/customer-spa/src/pages/ThankYou/index.tsx b/customer-spa/src/pages/ThankYou/index.tsx index d1d1845..f0a556c 100644 --- a/customer-spa/src/pages/ThankYou/index.tsx +++ b/customer-spa/src/pages/ThankYou/index.tsx @@ -147,6 +147,12 @@ export default function ThankYou() { {formatPrice(parseFloat(order.tax_total))} )} + {parseFloat(order.discount_total || 0) > 0 && ( +