0

Fatal error: Call to a member function getAttributeText() on string in/opt/lampp/htdocs/magento2_new/Sourcecode/app/design/frontend/Emthemes/em0150jewelry/jewelry/Magento_Catalog/templates/product/list.phtml on line 539.

This error occured by using a function
$optionText=$_product->getId()->getAttributeText('Farben');

How can I resolve this in magento 2?

0
$_product->**getId()**->getAttributeText('Farben');

Maybe you mean check once

$_product->getAttributeText('Farben');
1
  • I get Notice: Undefined variable: _product with this code.
    – Sam Assoum
    Sep 22 at 15:27

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.