File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
app/code/Magento/Swatches/view/base/web/js Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -460,6 +460,18 @@ define([
460
460
'</div>'
461
461
) ;
462
462
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
+
463
475
$widget . optionsMap [ item . id ] = { } ;
464
476
465
477
// Aggregate options array to hash (key => value)
@@ -491,7 +503,7 @@ define([
491
503
$widget . _EventListener ( ) ;
492
504
493
505
// Rewind options
494
- $widget . _Rewind ( container ) ;
506
+ // $widget._Rewind(container);
495
507
496
508
//Emulate click on all swatches from Request
497
509
$widget . _EmulateSelected ( $ . parseQuery ( ) ) ;
You can’t perform that action at this time.
0 commit comments