swissup/module-breeze-mageworx-advancedproductoptions

Mageworx Advanced Product Options integration with Breeze Frontend

Installs: 200

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 5

Forks: 1

Open Issues: 0

Language:JavaScript

Type:magento2-module

1.3.0 2024-03-01 16:02 UTC

This package is auto-updated.

Last update: 2024-04-30 16:19:59 UTC


README

Description

This extension does its best to integrate all storefront features of Advanced Product Options extension form Mageworx vendor.

Required patches

mageworx/module-optionbase/view/base/web/js/catalog/product/base.js

@@ -50,7 +50,7 @@
         _init: function initPriceBundle() {
             var self = this;
             $(document).ready(function () {
-                $('#product-addtocart-button').attr('disabled', true);
+                $('#product-addtocart-button').prop('disabled', true);
                 // Get existing updaters from registry
                 var updaters = registry.get('mageworxOptionUpdaters');
                 if (!updaters) {
@@ -240,7 +240,7 @@
             }
 
             this._updateSelectOptions(options.filter('select'), optionConfig, priceSymbol);
-            this._updateInputOptions(options.filter('input[type!="hidden"]'), optionConfig, priceSymbol);
+            this._updateInputOptions(options.filter($.breeze ? 'input:not([type="hidden"])' : 'input[type!="hidden"]'), optionConfig, priceSymbol);
         },
 
         /**

mageworx/module-optiondependency/view/base/web/js/dependency.js

@@ -116,12 +116,12 @@
             if ($.inArray(optionObject.type, ['drop_down', 'multiple']) !== -1) {
                 if (optionObject.type === 'drop_down') {
                     // For dropdown - for selected select options only
-                    $('#' + option.attr('id') + ' option:selected').each(function () {
+                    $('#' + option.attr('id') + ' option:checked').each(function () {
                         self.toggleDropdown(optionObject, self.getOptionObject($(this).attr('data-option_type_id'), 'value'));
                     });
                 } else {
                     // For multiselect - for all select options
-                    var selectedMultiselectValues = $('#' + option.attr('id') + ' option:selected');
+                    var selectedMultiselectValues = $('#' + option.attr('id') + ' option:checked');
                     if (selectedMultiselectValues.length > 0) {
                         self.toggleMultiselect(optionObject, selectedMultiselectValues);
                     } else {

mageworx/module-optionfeatures/view/frontend/web/js/swatches/additional.js

@@ -331,7 +331,7 @@
                     images = $.extend(true, {}, params.options[optionId]['values'][valueId]['images']);
                 }
 
-                if (typeof params.$element == 'undefined' || !params.$element instanceof jQuery) {
+                if (typeof params.$element == 'undefined') {
                     return;
                 }
 
@@ -451,7 +451,7 @@
             clearImagesContainer: function () {
                 var params = this.options;
                 var $imagesContainer = this.getOptionGalleryContainer();
-                if (!_.isUndefined($imagesContainer) && $imagesContainer instanceof jQuery) {
+                if (!_.isUndefined($imagesContainer)) {
                     $imagesContainer.html('');
                 }
             },

mageworx/module-optionadvancedpricing/view/base/web/js/advanced-pricing.js

@@ -25,7 +25,7 @@
                 config = base.options,
                 options = $(config.optionsSelector, form);
 
-            options.filter('input[type!="hidden"]').each(function (index, element) {
+            options.filter($.breeze ? 'input:not([type="hidden"])' : 'input[type!="hidden"]').each(function (index, element) {
                 var $element = $(element),
                     optionId = utils.findOptionId($element),
                     values = $element.val();

Installation

composer require swissup/module-breeze-mageworx-advancedproductoptions
bin/magento setup:upgrade --safe-mode=1