The above question may sound confusing, so I'll simplify and explain it more below - I tried to look for this answer but couldn't find anywhere.
I have a configurable product for t-shirts which has sizes and colours, I am trying to show custom message on selection of each size (S, M, L), basically, the attribute value should change based on size selection, which has been set in simple product, however; it doesn't output anything. The below code output nothing at all.
echo $_product->getAttributeText('attribute_name');
I tried the same code for configurable product, and added the attribute to configurable product instead to simple product. This output the attribute text but the value supposed to change with each simple product.
So the above piece of code work when the attribute is assigned to configurable product, however; it doesn't work when assigned to simple product.
Any suggestion on how to output attribute text (dropdown attribute) which is linked with simple product but should display on frontend configurable product view?
Thanks