Przeglądaj źródła

feat module 6, 7 : hide atome payment information for out of stock product

master
nadia 9 godzin temu
rodzic
commit
db88aa598e
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2
    1
      src/components/ProductDetails/ProductDetails.jsx

+ 2
- 1
src/components/ProductDetails/ProductDetails.jsx Wyświetl plik

@@ -320,6 +320,7 @@ const ProductDetails = () => {
320 320
   const currencyCode = variantSelection.currencyCode || ""
321 321
   const formattedPrice = `${currencyCode} ${amount.toFixed(2)}`
322 322
   const installmentPrice = `${(amount / 3).toFixed(2)} ${currencyCode}`
323
+  const shouldShowAtomePayment = amount > 0 && variantSelection?.quantityAvailable > 0
323 324
   // const shortDescriptionHtml = getFirstDescriptionBlock(product?.descriptionHtml)
324 325
 
325 326
   const storeLocations = [
@@ -633,7 +634,7 @@ const ProductDetails = () => {
633 634
           </Typography>
634 635
 
635 636
           {/* Atome installment option */}
636
-          {amount > 0 && (
637
+          {shouldShowAtomePayment && (
637 638
             <Box
638 639
               component="button"
639 640
               type="button"

Ładowanie…
Anuluj
Zapisz