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?


1 Answer 1


Create your attribute set, and and create both product (simple & config) with that attribute. Must be enter your value in that attribute and in under config product you'll see associated product option go there and reset filer and then your sku of simple product and then select your simple product and save.

  • Thank you for your suggestion but unfortunately I can't make any sense out of it. Could you please break into lines or some steps so I can understand them better?
    – harry
    May 1, 2017 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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