diff options
Diffstat (limited to 'src-migrate/modules/product-detail/components/AddToQuotation.tsx')
| -rw-r--r-- | src-migrate/modules/product-detail/components/AddToQuotation.tsx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src-migrate/modules/product-detail/components/AddToQuotation.tsx b/src-migrate/modules/product-detail/components/AddToQuotation.tsx index e26e271f..747e8718 100644 --- a/src-migrate/modules/product-detail/components/AddToQuotation.tsx +++ b/src-migrate/modules/product-detail/components/AddToQuotation.tsx @@ -44,7 +44,7 @@ const AddToQuotation = ({ isClosable: true, }); - const { askAdminUrl } = useProductDetail(); + const { askAdminUrl, selectedVariant } = useProductDetail(); const { isMobile, isDesktop } = useDevice(); const [product, setProducts] = useState(products); @@ -64,8 +64,8 @@ const AddToQuotation = ({ `fq=-manufacture_id_i:${product.manufacture?.id || 0}`, ].join('&'); const [addCartAlert, setAddCartAlert] = useState(false); - const hasPrice = - !!product?.lowest_price && Number(product.lowest_price.price) > 0; + + const hasPrice = Number(selectedVariant?.price?.price_discount || 0) > 0; const handleButton = async () => { if (typeof auth !== 'object') { @@ -138,6 +138,7 @@ const AddToQuotation = ({ className="w-full border border-gray-300 p-2 gap-2 flex items-center justify-center text-gray-600 hover:text-red-600 hover:border-red-600 transition-all font-normal text-sm" _hover={{ textDecoration: 'none' }} onClick={handleButton} + isDisabled={!hasPrice} > <ImageNext src="/images/doc_red.svg" width={20} height={20} alt="penawaran" /> Penawaran |
