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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.