Skip to content

mixins for priceBox::reloadPrice not working consistently accross browsers #35097

Closed
@ioweb-gr

Description

@ioweb-gr

Preconditions (*)

  1. Magento 2.4.3-p1
  2. Firefox 97/98

Steps to reproduce (*)

Create a module and add the following file

app/code/Vendor/Module/view/frontend/requirejs-config.js

var config = {
    config:
        {
            mixins: {
                'Magento_Catalog/js/price-box':
                    {
                        'Vendor_Module/js/price-box-mixin': true
                    }
            }
        }
};

Follow the documentation to add a mixin for reloadPrice

app/code/Vendor/Module/view/frontend/web/js/price-box-mixin.js

define([
    'jquery',
    'mage/utils/wrapper',
    'jquery/ui',
], function ($, wrapper) {
    'use strict';

    var widgetMixin = {
        reloadPrice: function () {
            console.log('mixin reload price1');
            return this._super();
        }
    };

    return function (targetWidget) {
        // Example how to extend a widget by mixin object
        $.widget('mage.priceBox', targetWidget, widgetMixin); // the widget alias should be like for the target widget

        return $.mage.priceBox; //  the widget by parent alias should be returned
    };
});

It seems the same behaviour is happening for klarma pricebox-widget-mixin.js

To make an easier example, I added a console.error in klarma mixin as well.

Expected result (*)

  1. The mixin is always executed like in Chrome
    image

Actual result (*)

  1. The mixin is not executed in firefox or randomly executes as you can see in console.log neither for the custom module nor for klarma mixin
    image

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

Labels

Area: FrontendIssue: needs updateAdditional information is require, waiting for responseTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions