Skip to content

Commit a881049

Browse files
committed
BUG#AC-2877: Initial commit
1 parent 0117201 commit a881049

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,18 @@ define([
460460
'</div>'
461461
);
462462

463+
if ($widget.options.jsonConfig.canDisplayShowOutOfStockStatus)
464+
{
465+
var salableProd = $widget.options.jsonConfig.salable[item.id],
466+
swatchOptions = container.find('.swatch-option');
467+
swatchOptions.each(function(key, value) {
468+
var optionId = $(value).data('option-id');
469+
if(!salableProd.hasOwnProperty(optionId)) {
470+
$(value).attr('disabled', true).addClass('disabled');
471+
}
472+
});
473+
}
474+
463475
$widget.optionsMap[item.id] = {};
464476

465477
// Aggregate options array to hash (key => value)
@@ -491,7 +503,7 @@ define([
491503
$widget._EventListener();
492504

493505
// Rewind options
494-
$widget._Rewind(container);
506+
// $widget._Rewind(container);
495507

496508
//Emulate click on all swatches from Request
497509
$widget._EmulateSelected($.parseQuery());

0 commit comments

Comments
 (0)