Open Mugentoki opened 1 year ago
Hi @Hoargarth. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release@magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
@magento give me 2.4-develop instance
Hi @Hoargarth. Thank you for your request. I'm working on Magento instance for you.
Hi @Hoargarth, here is your Magento Instance: https://d9d1a9d5bfe4d0486845cb818bc2ce33.instances.magento-community.engineering Admin access: https://d9d1a9d5bfe4d0486845cb818bc2ce33.instances.magento-community.engineering/admin_2da3 Login: 2844ce62 Password: 9bf9e8dce4ed
Hi @engcom-Dash. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Checked on the radiant-tee /radiant-tee.html
And can reproduce the issue
There's this file in vendor vendor/magento/module-swatches/view/frontend/web/js/configurable-customer-data.js
which is referencing mageSwatchRenderer
var selectors = {
formSelector: '#product_addtocart_form',
swatchSelector: '.swatch-opt'
},
swatchWidgetName = 'mageSwatchRenderer',
widgetInitEvent = 'swatch.initialized',
However, further inspecting the jQuery object in browser I can see it's actually attached with mage-SwatchRenderer
and can be accessed like that jQuery('[data-role=swatch-options]').data('mage-SwatchRenderer')
So the question now arises, which one is correct?
mageSwatchRenderer
or mage-SwatchRenderer
@magento give me 2.4-develop instance
Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Dash, here is your Magento Instance: https://d9d1a9d5bfe4d0486845cb818bc2ce33.instances.magento-community.engineering Admin access: https://d9d1a9d5bfe4d0486845cb818bc2ce33.instances.magento-community.engineering/admin_6216 Login: b05b0c3a Password: 105d382344ce
Hi @Hoargarth ,
Thanks for Raising this issue,
Could you please provide the exact steps which you followed for this issue.Because it will helps to proceed further in this case.
Thanks.
Hi @engcom-Dash
First of all, I've lowered the severity to S3 as it's not affecting the store user, but us developers.
Detailed steps below:
jQuery('[data-role=swatch-options]').data('mageSwatchRenderer')
The problem is not limited to the developer toolbar, but also happens when trying to access the 'mageSwatchRenderer' module by code in any .phtml or .js file. For example if you want to extract the selected product ID like it's being described in this article and was working at least until Magento 2.4.0
Also as I mentioned in my previous comment, I could already debug it a bit.
@magento give me 2.4-develop instance
Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Dash, here is your Magento Instance: https://d9d1a9d5bfe4d0486845cb818bc2ce33.instances.magento-community.engineering Admin access: https://d9d1a9d5bfe4d0486845cb818bc2ce33.instances.magento-community.engineering/admin_ee2d Login: bb45d853 Password: efb072fb3195
Hi @Hoargarth ,
Verified the issue is 2.4-develop instance and the issue is reproducible.
Description: mageSwatchRenderer is undefined on PDP
Prerequisite:
Magento Version 2.4-develop PHP Version 8.1
Actual result: Swatch renderer should be initialized and data be accessible
Expected Result: Swatch renderer is undefined
Steps to reproduce: 1.In frontend, go to the product page of any product, which has a size and/or color 2.Open your browsers developer toolbar and go to the developer console 3.Input following JavaScript into the console jQuery('[data-role=swatch-options]').data('mageSwatchRenderer')
Screenshots for your reference:
We are getting Actual result which is Swatch renderer is undefined ,Hence we are confirming the issue in 2.4-develop instance.
Let us know if we are missing anything
Thanks,
Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Issue: Confirmed
once verification is complete. :white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-8142 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
Hi @Hoargarth ,
Thank you for the response. I re-checked the issue on latest Magento 2.4-develop instance and verified the code in /Swatches/view/frontend/web/js/configurable-customer-data.js and is mentioned as swatchWidgetName = 'mage-SwatchRenderer'
but not mageSwatchRenderer
also data is displayed in console on verifying with mage-SwatchRenderer
Kindly recheck the code on Magento 2.4-develop instance as it is having latest code base and upcoming 2.4.x release and let us know if you are still facing any issues.
https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Swatches/view/frontend/web/js/configurable-customer-data.js
Thank you.
Hi @engcom-November
since https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Swatches/view/frontend/web/js/configurable-customer-data.js is now also using mage-SwatchRenderer
, I assume the change from mageSwatchRenderer
was intended?
If so, then this issue can be closed.
But I highly recommend to add a documentation about the change somewhere in the docs. Many blog articles are referencing mageSwatchRenderer
mage-SwatchRenderer is correct widget name -> you should use that name
@dobooth Is there any docs official related with this area ? mageSwatchRenderer In my opinion other blog also should update code snippets to latest version. I don't sure current docs mention this somewhere
Hi @Hoargarth ,
There is no official Magento documentation referring this topic in devdocs & docs to raise an issue report in https://github.com/magento/devdocs or https://github.com/magento/merchdocs repositories to update the changes. Please share the official articles that are are referencing mageSwatchRenderer
if any.
Thank you.
https://docs.swissuplabs.com/m2/argento/customization/adding-prices-to-magento-swatches/ https://argentotheme.com/knowledgebase/faq/adding-price-to-magento-2-swatches-with-argento-possibilities/ Here is some refer i got after search @engcom-November still refer to old name. But can't find official docs for this
Preconditions and environment
Steps to reproduce
After setting up the fresh M2 instance with demo data
jQuery('[data-role=swatch-options]').data('mageSwatchRenderer')
Expected result
Swatch renderer should be initialized and data be accessible
Actual result
Swatch renderer is undefined
Additional information
I still had a clean installed M2 version 2.3.4 around, and there it's working just fine.
Release note
No response
Triage and priority