0

I need to change custom attribute and sku every time when customer change color and size (http://prntscr.com/nwzt1h). With sku i found article how to do it and it's working, but i can't find some info how to do the same with custom attribute. I found place where i need to enter info to dynamicly change it (location of this files Vendor\Extension\Plugin\ConfigurableProduct\Block\Product\View\Type\Configurable\Configurable.php and Vendor\Extension\Plugin\ConfigurableProduct\Block\Product\View\Type\Configurable.php here and here . But "getData" "getCustomAttribute" "getAttributeText" "getAttribute" doesn't work. I found out if i will write $simpleProduct->getData('size') i will see dynamic changes example1 example2 . But with my custom attribute it doesn't work this way. Can anyone give me some advise, or link on article where this problem solving ? Thank you.

0

If you have the same issue, you need to add $jsonResult['some_identifier'][$simpleProduct->getId()] = $simpleProduct->getResource()->getAttribute('your_custom_attribute_code')->getFrontend()->getValue($simpleProduct);

So it will look like this: 1) http://prntscr.com/nx39w5 2) http://prntscr.com/nx3ark

And in admin panel your custom attribute must be "Global" and have this settings http://prntscr.com/nx3boh

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.