0

I'm trying to override js in custom module, but that module which i want to override is already override some js from magento_checkout.
And seem like it doesn't work :(
Here is how i did: enter image description here

That module is override from magento_checkout: enter image description here

Alright, so i did this before and its work, but for some reason, i fixed it, and now it doesn't work anymore, and i can't find the way to fix this back to work :(

EDIT 1:

di.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <preference for="Amasty\Deliverydate\Block\Checkout\LayoutProcessor" type="Gssi\Deliverydate\Block\Checkout\LayoutProcessor"/>

    <!-- TAIG-8 #2: add "PO #" field in "BuyersOrderNumber" -->
    <preference for="Amasty\Deliverydate\Plugin\Checkout\ShippingInformationManagement" type="Gssi\Deliverydate\Plugin\Checkout\ShippingInformationManagement"/>
</config>


Please help, thanks

1
  • my di.xml file doesn't using anything to do with this, but if you want, i will update it so you can see it closer :) please stand by
    – fudu
    Oct 22, 2018 at 15:35

2 Answers 2

0

Update your module.xml file at Gssi/Deliverydate/etc/module.xml

<config xmlns:xsi="http7://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="Gssi_Deliverydate" setup_version="2.0.0">
        <sequence>
            <module name="Magento_Checkout"/>
            <module name="Amasty_Deliverydate"/>
        </sequence>
    </module>
</config>

Hope, It may be helpful for you.

5
  • Doesn't work, it still call to Amasty_Deliverydate/js/shipping-save-processor/default-override
    – fudu
    Oct 22, 2018 at 15:36
  • Yes. It will call that js file. Oct 22, 2018 at 15:37
  • so what i want is call to my js file, not that js file :(
    – fudu
    Oct 22, 2018 at 15:37
  • You need to call that js file as like call in Amasty extension & need to maintain sequence. If first your module call then you need to add that above code in amasty extension. Oct 22, 2018 at 15:40
  • Sorry i don't understand what you said, can you tell more detail on this? Thanks you very much
    – fudu
    Oct 22, 2018 at 15:44
0

Hope you doing well.

Please go through this link of Magento DevDocs.

Replace a default JS component

https://devdocs.magento.com/guides/v2.0/javascript-dev-guide/javascript/custom_js.html

Create a RequireJS configuration file requirejs-config.js, having specified the following:

var config = {
  "map": {
    "*": {
      "<default_component>": "<custom_component>"
    }
  }
};

For example, if you want to use custom navigation-menu.js script instead of the default menu widgets, your requirejs-config.js should contain the following:

var config = {
  "map": {
    "*": {
      "menu": "js/navigation-menu",
      "mage/backend/menu": "js/navigation-menu"
    }
  }
};

Hope this will help you.

Please try this one also, this is worked for me.

var config = {
    config: {
            mixins: {
                'vendor_module/js/filename': {
                    'vendor_module/js/filename-mixin': true
                },
            }
        },
    }
2
  • Yes i've follow this instruction from the beginning, but unfortunately it doesn't work for my sitution :(
    – fudu
    Oct 23, 2018 at 6:16
  • please try this one i have update the answer, i have tried this and this one works for me. Oct 23, 2018 at 10:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.