@wix/headless-stores 0.0.94 → 0.0.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -200,7 +200,7 @@ export function Actions(props) {
|
|
|
200
200
|
modifiersService = null;
|
|
201
201
|
}
|
|
202
202
|
const inStock = variantService.isInStock.get();
|
|
203
|
-
const isPreOrderEnabled = variantService.isPreOrderEnabled.get();
|
|
203
|
+
const isPreOrderEnabled = variantService.isPreOrderEnabled.get() && !inStock;
|
|
204
204
|
const preOrderMessage = variantService.preOrderMessage.get();
|
|
205
205
|
const isLoading = variantService.isLoading.get() ||
|
|
206
206
|
(checkoutService ? checkoutService.isLoading.get() : false);
|
|
@@ -159,7 +159,7 @@ export const SelectedVariantService = implementService.withConfig()(SelectedVari
|
|
|
159
159
|
});
|
|
160
160
|
options.set(optionsMap);
|
|
161
161
|
}
|
|
162
|
-
if (currentProduct.variantSummary.variantCount >
|
|
162
|
+
if (currentProduct.variantSummary.variantCount > 0) {
|
|
163
163
|
variants.set(currentProduct.variantsInfo?.variants || []);
|
|
164
164
|
if (currentProduct.variantsInfo?.variants?.length) {
|
|
165
165
|
updateDataFromVariant(currentProduct.variantsInfo?.variants[0] || null);
|
|
@@ -200,7 +200,7 @@ export function Actions(props) {
|
|
|
200
200
|
modifiersService = null;
|
|
201
201
|
}
|
|
202
202
|
const inStock = variantService.isInStock.get();
|
|
203
|
-
const isPreOrderEnabled = variantService.isPreOrderEnabled.get();
|
|
203
|
+
const isPreOrderEnabled = variantService.isPreOrderEnabled.get() && !inStock;
|
|
204
204
|
const preOrderMessage = variantService.preOrderMessage.get();
|
|
205
205
|
const isLoading = variantService.isLoading.get() ||
|
|
206
206
|
(checkoutService ? checkoutService.isLoading.get() : false);
|
|
@@ -159,7 +159,7 @@ export const SelectedVariantService = implementService.withConfig()(SelectedVari
|
|
|
159
159
|
});
|
|
160
160
|
options.set(optionsMap);
|
|
161
161
|
}
|
|
162
|
-
if (currentProduct.variantSummary.variantCount >
|
|
162
|
+
if (currentProduct.variantSummary.variantCount > 0) {
|
|
163
163
|
variants.set(currentProduct.variantsInfo?.variants || []);
|
|
164
164
|
if (currentProduct.variantsInfo?.variants?.length) {
|
|
165
165
|
updateDataFromVariant(currentProduct.variantsInfo?.variants[0] || null);
|