Просмотр исходного кода

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

master
nadia 9 часов назад
Родитель
Сommit
db88aa598e
1 измененных файлов: 2 добавлений и 1 удалений
  1. 2
    1
      src/components/ProductDetails/ProductDetails.jsx

+ 2
- 1
src/components/ProductDetails/ProductDetails.jsx Просмотреть файл

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

Загрузка…
Отмена
Сохранить