cancel
Showing results for 
Search instead for 
Did you mean: 

Mixing not loading, what else to debug?

Mixing not loading, what else to debug?

Given the following mixin:

 

$ cat view/frontend/web/requirejs-config.js 
var config = {
    config: {
        mixins: {
            'Magento_Checkout/js/action/set-shipping-information': {
                'Dc_Test/js/action/set-shipping-information-mixin': true
            }
        }
    }
};

$ cat view/frontend/web/js/action/set-shipping-information-mixin.js 
/*jshint browser:true jquery:true*/
/*global alert*/
define([
    'jquery',
    'mage/utils/wrapper',
    'Magento_Checkout/js/model/quote'
], function ($, wrapper, quote) {
    'use strict';

    console.log("DOTAN 1");
    return function (setShippingInformationAction) {

        console.log("DOTAN 2");
        return wrapper.wrap(setShippingInformationAction, function (originalAction) {
            console.log("DOTAN 3");

            // pass execution to original action ('Magento_Checkout/js/action/set-shipping-information')
            return originalAction();
        });
    };
});

And given that:

  • I've deleted my entire browser cache
  • I have cache disabled when DevTools are open
  • The module is enabled
  • I've flushed the Magento caches
  • I've `rm`ed the pub/static/ directory
  • I'm in dev mode, but I've tried `setup:static-content:deploy` with the `-f` flag anyway
  • I've run `setup:upgrade`
  • I've tried disabling then reenabling the module
  • I've even copied the `view/frontend` directory to `view/global` out of desperation

 

What could be preventing this mixin from being loaded during the Checkout process?

 

This is on Magento 2.4.4 running locally in a Docker container on an Ubuntu desktop. All other features of Magento run fine (knock on wood). Code for the mixin adapted from the Add a new field in the address form tutorial.

1 REPLY 1

Re: Mixing not loading, what else to debug?

Hello @dotancohen 

 

Please follow the steps below:

  • Create your requirejs-config.js file under this folder path: view/frontend/
  • Thereafter create your set-shipping-information-mixin.js file under this folder path: view/frontend/web/js/action/
  • Please Run the following commands:
    • php bin/magento s:up
    • php bin/magento s:d:c
    • php bin/magento s:s:d -f
    • php bin/magento c:f

If you find our reply helpful, please give us kudos.

 

A Leading Magento Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.

 

WebDesk Solution Support Team

Get a Free Quote | | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789

Thank You,


WebDesk Solution Support Team
Get a Free Quote | Email | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789


Location: 150 King St. W. Toronto, ON M5H 1J9