-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mixins js do not appear when we open product links in a new tab #29694
Comments
Hi @Mecalux-Developer. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. Please, add a comment to assign the issue:
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
I was able to reproduce it in Magento 2.3.4-p2 vainilla with sample data (Luma) in developer Mode without elasticsearch, varnish, redis. Magento 2.3.4-p2 vainilla (Luma) Click directly on the link of product in homepage Right click on the link of product in homepage and open it in a new tab We can see that the our custom mixin Mecalux_Ejemplo/js/price-box-mixin does not appears Note: |
Have you add mixin declare in file requirejs-config ? |
@mrtuvn Thanks for your answer. We have the requirejs-config.js file created. Sorry, I was wrong in the above message, I put the wrong version. I tested it on 2.3.4-p2 instead of 2.4. Could you try in Magento: 2.3.4-p2? The folder structure of the example module is the following: The content of the files is: registration.php <?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Mecalux_Ejemplo',
__DIR__
); 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="Mecalux_Ejemplo" setup_version="1.0.0"/>
</config>
price-box-mixin.js define([
'jquery',
'Magento_Catalog/js/price-utils',
'underscore',
'mage/template',
'jquery/ui'
], function ($, utils, _, mageTemplate) {
'use strict';
return function (priceBox) {
$.widget('mage.priceBox', priceBox, {
_setDefaultsFromDataSet: function _setDefaultsFromDataSet() {
console.log("Hello world");
},
});
return $.mage.priceBox;
};
}); requirejs-config.js var config = {
config: {
mixins: {
'Magento_Catalog/js/price-box': {
'Mecalux_Ejemplo/js/price-box-mixin': true
}
}
}
}; |
@mrtuvn It seems the problem is fixed in 2.4. We have not been able to reproduce this problem in 2.4 either. But we have been able to reproduce this problem in 2.3.4-p2 LUMA (Vainilla). Is there a solution for this version(2.3.4-p2)? We plan to update our magento later. Not now. |
Don't know but from my knowleadges in 2.4 magento brings update with some improvements in JavaScript . Mixin module has been refactored to improve the loading and application of mixins for advanced bundled modules. But consider update maybe risky for live site running. We can't know problem something went wrong when some 3rd-party modules may breaks compatible |
@mrtuvn Thanks for your reply, |
Hi @ihor-sviziev. Thank you for working on this issue.
|
As it was already discussed - issue was already fixed in 2.4.x #29694 (comment), I'm closing this issue as not relevant. |
@ihor-sviziev hi. the issue is still reproducible on 2.4 when using an alias instead of a path to the component in js layout |
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
The text was updated successfully, but these errors were encountered: