首页 文章

Magento 2致命错误:在字符串上调用成员函数getAttributeText()

提问于
浏览
1

致命错误:在第539行的/ opt / lampp / htdocs / magento2_new / Sourcecode / app / design / frontend / Emthemes / em0150jewelry / jewelry / Magento_Catalog / templates / product / list.phtml中的字符串上调用成员函数getAttributeText() . 使用函数发生此错误 $optionText=$_product->getId()->getAttributeText('Farben'); 如何在magento 2中解决此问题?

1 回答

  • 1

    我不知道你为什么得到id,我不太确定,但我认为以下代码将起作用:

    $optionText=$_product->getAttributeText('Farben');
    

    如果没有评论

相关问题