0

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

0

To fetch value of attribute Use:

First load/get your Product and then

$this->getProduct()->getAttributeText('attribute_text');

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

Or

$product = $this->getProduct();
$store = $this->_storeManager->getStore();
$ressource = $product->getResource();
$ressource->getAttributeRawValue($product->getId(),'country_flag',$store->getId());

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.