I have a product Attribute that can be set as a swatch with an image.

enter image description here

How can I get the swatch image src in my template ?

I can use the following to get the label.

$attribute_value = $_product->getData( $attributeCode ); $optionText = $attr->getSource()->getOptionText( $attribute_value );


Your Answer

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

Browse other questions tagged or ask your own question.