Skip to content

Commit bd619a1

Browse files
committed
ACP2E-1334: Configurable product swatches appears as available but are out of stock
- without test
1 parent 28c7f79 commit bd619a1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/code/Magento/Swatches/view/base/web/js/swatch-renderer.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,12 +465,17 @@ define([
465465
// Aggregate options array to hash (key => value)
466466
$.each(item.options, function () {
467467
if (this.products.length > 0) {
468+
let salableProducts = this.products;
469+
470+
if ($widget.options.jsonConfig.canDisplayShowOutOfStockStatus) {
471+
salableProducts = $widget.options.jsonConfig.salable[item.id][this.id];
472+
}
468473
$widget.optionsMap[item.id][this.id] = {
469474
price: parseInt(
470475
$widget.options.jsonConfig.optionPrices[this.products[0]].finalPrice.amount,
471476
10
472477
),
473-
products: this.products
478+
products: salableProducts
474479
};
475480
}
476481
});

0 commit comments

Comments
 (0)