From c813b26b9a80d496fd8b64c0ef5252e229c97ed4 Mon Sep 17 00:00:00 2001 From: Agata Firlejczyk Date: Tue, 18 Dec 2018 10:25:01 +0100 Subject: [PATCH] findConfigurableChildAsync - fix checking stock for configurable child --- core/modules/catalog/helpers/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/modules/catalog/helpers/index.ts b/core/modules/catalog/helpers/index.ts index 4309fdc3b8..c9a0580923 100644 --- a/core/modules/catalog/helpers/index.ts +++ b/core/modules/catalog/helpers/index.ts @@ -356,7 +356,7 @@ export function populateProductConfigurationAsync (context, { product, selectedV for (let option of product.configurable_options) { let attribute_code let attribute_label - if (option.attribute_id) { + if (option.attribute_id) { let attr = context.rootState.attribute.list_by_id[option.attribute_id] if (!attr) { console.error('Wrong attribute given in configurable_options - can not find by attribute_id', option) @@ -368,7 +368,7 @@ export function populateProductConfigurationAsync (context, { product, selectedV } else { if (!option.attribute_code) { console.error('Wrong attribute given in configurable_options - no attribute_code', option) - continue + continue } else { // we do have attribute_code! attribute_code = option.attribute_code attribute_label = option.frontend_label ? option.frontend_label : option.default_frontend_label @@ -419,7 +419,7 @@ export function findConfigurableChildAsync({ product, configuration = null, sele if (availabilityCheck) { if (configurableChild.stock && !rootStore.state.config.products.listOutOfStockProducts) { - if (!configurableChild.is_in_stock) { + if (!configurableChild.stock.is_in_stock) { return false } } @@ -511,7 +511,7 @@ export function configureProductAsync (context, { product, configuration, select if (selectDefaultVariant) { context.dispatch('setCurrent', product) // without the configuration } - } + } return selectedVariant } else { if (fallbackToDefaultWhenNoAvailable) {