![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-swatches/view/frontend/web/js/ |
require([ 'jquery', 'Magento_ConfigurableProduct/js/options-updater' ], function ($, Updater) { 'use strict'; var selectors = { formSelector: '#product_addtocart_form', swatchSelector: '.swatch-opt' }, swatchWidgetName = 'mage-SwatchRenderer', widgetInitEvent = 'swatch.initialized', /** * Sets all configurable swatch attribute's selected values */ updateSwatchOptions = function () { var swatchWidget = $(selectors.swatchSelector).data(swatchWidgetName); if (!swatchWidget || !swatchWidget._EmulateSelectedByAttributeId) { return; } swatchWidget._EmulateSelectedByAttributeId(this.productOptions); }, updater = new Updater(widgetInitEvent, updateSwatchOptions); updater.listen(); });