2

I'm following this instruction to override "Magento_ConfigurableProduct/js/configurable.js" but it doesn't work.
I'm following this link:
https://magento.stackexchange.com/a/131852/70258

After i disable module and then enable the module again, then run setup:upgrade, content:deploy, then it become this: enter image description here

Now i can't see the related product anymore, i guess that Magento_ConfigurableProduct javascript is broken.

Here are my files:

module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Convert_ProductList" setup_version="1.0.0">
        <sequence>
            <module name="Magento_ConfigurableProduct"/>
        </sequence>
    </module>
</config>

configurable.js

define([
    'jquery',
    'jquery/ui',
    'Magento_ConfigurableProduct/js/configurable'
], function($){

    $.widget('silvan.configurable', $.mage.configurable, {
        //code you want to override
    });

    return $.silvan.configurable;
});

app\code\Convert\ProductList\view\frontend\requirejs-config.js

var config = {
    map: {
        '*': {
            configurable:'Convert_ProductList/js/configurable'
        }
    }
};

Here is my tree code:

enter image description here

6
  • Try this magento.stackexchange.com/questions/261628/… Commented Feb 21, 2019 at 13:30
  • @GPrathap i don't get it, what's the different?
    – fudu
    Commented Feb 21, 2019 at 13:31
  • Where is your requirejs-config.js file is placed? Commented Feb 21, 2019 at 15:28
  • You should add full file path.
    – Sohel Rana
    Commented Feb 21, 2019 at 15:41
  • I've take a picture of tree code up there. Please check.
    – fudu
    Commented Feb 21, 2019 at 15:57

0

Your Answer

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