diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2026-03-13 09:56:07 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2026-03-13 09:56:07 +0700 |
| commit | 55c8f1c3c6c3566afe6555b7e3714f2738d0bb8e (patch) | |
| tree | 58f335069c84c2b719af698017b229955255bf9f /src-migrate/modules/product-detail/components/AddToQuotation.tsx | |
| parent | 03b678070e53f4f83c947d073e5a9ec01d469992 (diff) | |
<Miqdad> fix selected variantHEADnew-release
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 |
