Necesito extender Magento_Catalog/js/price-box.js
. He usado la función 'mixins', pero no funciona price-box.js
.
requirejs-config.js
:
var config = {
config: {
mixins: {
'Magento_Catalog/js/price-box': {
'My_Module/js/price-box/pluggin': true
}
}
}
};
My_Module/view/frontend/web/js/price-box/pluggin.js
define(function () {
'use strict';
return function (target) {
// modify target
var reloadPrice = target.reloadPrice;
target.reloadPrice = function() {
cosole.log("hello");
};
return target;
};
});