Question

I have created multiselect custom attribute for product. See https://prnt.sc/sp7wgn I want to display the selected option value on frontend using phtml file. How can i do that??

Was it helpful?

Solution

Need to check if attribute settings are correct set or not

https://i.stack.imgur.com/0YKqI.png

template code

$attribute_string = $_product->getResource()->getAttribute('attribute')->getFrontend()->getValue($_product);

$attribute_array = explode(', ', $attribute_string);
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top