|
34 | 34 | </div> |
35 | 35 |
|
36 | 36 | <div class="mt-4 print:hidden"> |
37 | | - <template v-if="variationResult && variationResult.price?.actual?.amount > 0"> |
38 | | - <AddToCart v-if="product.isConfigurable" :product="variationResult"> |
39 | | - <InStock |
40 | | - :is-in-stock="variationResult.availabilityData?.isInStock" |
41 | | - :is-digital="isDigital" |
42 | | - :quantity="variationResult.availabilityData?.availableQuantity" |
43 | | - /> |
44 | | - |
45 | | - <CountInCart :product-id="variationResult.id" /> |
46 | | - </AddToCart> |
47 | | - |
48 | | - <AddToCartSimple v-else :product="variationResult"> |
49 | | - <InStock |
50 | | - :is-in-stock="variationResult.availabilityData?.isInStock" |
51 | | - :is-digital="isDigital" |
52 | | - :quantity="variationResult.availabilityData?.availableQuantity" |
53 | | - /> |
54 | | - |
55 | | - <CountInCart :product-id="variationResult.id" /> |
56 | | - </AddToCartSimple> |
57 | | - </template> |
| 37 | + <component |
| 38 | + v-if="variationResult && variationResult.price?.actual?.amount > 0" |
| 39 | + :is="product.isConfigurable ? AddToCart : AddToCartSimple" |
| 40 | + :product="variationResult" |
| 41 | + > |
| 42 | + <InStock |
| 43 | + :is-in-stock="variationResult.availabilityData?.isInStock" |
| 44 | + :is-digital="isDigital" |
| 45 | + :quantity="variationResult.availabilityData?.availableQuantity" |
| 46 | + /> |
| 47 | + |
| 48 | + <CountInCart :product-id="variationResult.id" /> |
| 49 | + </component> |
58 | 50 |
|
59 | 51 | <div v-else> |
60 | 52 | <VcButton |
|
110 | 102 | v-bind="getComponentProps(CUSTOM_PRODUCT_COMPONENT_IDS.PAGE_SIDEBAR_BUTTON)" |
111 | 103 | /> |
112 | 104 |
|
113 | | - <template v-else> |
114 | | - <AddToCart v-if="product.isConfigurable" :product="product"> |
115 | | - <InStock |
116 | | - :is-in-stock="product.availabilityData?.isInStock" |
117 | | - :is-digital="isDigital" |
118 | | - :quantity="product.availabilityData?.availableQuantity" |
119 | | - /> |
120 | | - |
121 | | - <CountInCart :product-id="product.id" /> |
122 | | - </AddToCart> |
123 | | - |
124 | | - <AddToCartSimple v-else :product="product"> |
125 | | - <InStock |
126 | | - :is-in-stock="product.availabilityData?.isInStock" |
127 | | - :is-digital="isDigital" |
128 | | - :quantity="product.availabilityData?.availableQuantity" |
129 | | - /> |
130 | | - |
131 | | - <CountInCart :product-id="product.id" /> |
132 | | - </AddToCartSimple> |
133 | | - </template> |
| 105 | + <component v-else :is="product.isConfigurable ? AddToCart : AddToCartSimple" :product="product"> |
| 106 | + <InStock |
| 107 | + :is-in-stock="product.availabilityData?.isInStock" |
| 108 | + :is-digital="isDigital" |
| 109 | + :quantity="product.availabilityData?.availableQuantity" |
| 110 | + /> |
| 111 | + |
| 112 | + <CountInCart :product-id="product.id" /> |
| 113 | + </component> |
134 | 114 | </div> |
135 | 115 | </template> |
136 | 116 | </ProductPriceBlock> |
|
0 commit comments