From 55c8f1c3c6c3566afe6555b7e3714f2738d0bb8e Mon Sep 17 00:00:00 2001
From: Mqdd <ahmadmiqdad27@gmail.com>
Date: Fri, 13 Mar 2026 09:56:07 +0700
Subject: <Miqdad> fix selected variant

---
 src-migrate/modules/product-detail/components/AddToQuotation.tsx | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'src-migrate/modules/product-detail/components/AddToQuotation.tsx')

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
-- 
cgit v1.2.3

