enter image description here

getAttribute('country_flag'); ?> getData('value'); ?> getViewFileUrl('images/flags/usa.jpeg'); ?>" /> getViewFileUrl('images/flags/vu.png'); ?>" /> getViewFileUrl('images/flags/AU.png'); ?>" />

this is the code which I have written

1 Answer 1


To fetch value of attribute Use:

First load/get your Product and then


e.g: $this->getProduct()->getAttributeText('country_flag');


$product = $this->getProduct();
$store = $this->_storeManager->getStore();
$ressource = $product->getResource();

Hopefully, It will help you

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.