cancel
Showing results for 
Search instead for 
Did you mean: 

Custom attribute in grouped.phtml

Custom attribute in grouped.phtml

I can't get the value of a custom attribute in the file grouped.phtml

I have added the attribute in the file grouped.php but still cannot get any value in the frontend.
What is the correct code to get the value of a custom attribute? I use Magento 2.3.2. and it is an attribute with text value. 

 

1 REPLY 1

Re: Custom attribute in grouped.phtml

HI @speerio 

What is the attribute type? text/dropdown?

For text:

$_product->getData('ATTRIBUTE_CODE');

Also check following property:

  • if you do want to see an attribute, go in the Magento backend and verify the attribute is setup to be Used In Product Listing

  • then, you may have to refresh the index/cache and your code will show the attribute you will have verified.

I hope it will help you!