I am currently struggling with accessing a custom product attribute (zshortname), which is defined in magento admin panel, in my custom javascript file and send it to google tag manager over dataLayer. I could not find any documentation, tutorial or anything else on how to do it. I would really appreciate if someone helps me out. Thank you!
-
From where? write some detail.Sohel Rana– Sohel Rana2025-01-11 03:07:09 +00:00Commented Jan 11 at 3:07
-
explain in some more details, what you are trying to do, so we can help you with that one.Dhiren Vasoya– Dhiren Vasoya2025-01-13 04:35:38 +00:00Commented Jan 13 at 4:35
-
If you console log your item do you have your attribute in the object ? If yes, just retrieve it from JS object; if no then you might have to make a custom ajax call sending the item id and then retrieve the data from php iteself. The GTM part itself is irrelevant to the main issue.Clong– Clong2025-01-13 15:28:42 +00:00Commented Jan 13 at 15:28
-
I did console.log and there is unfortunately no custom attribute "zshortname". How can i make a custom ajax call?Zaki Azizi– Zaki Azizi2025-01-14 07:40:27 +00:00Commented Jan 14 at 7:40
Add a comment
|
