【问题标题】:Magento 2 Fatal error: Call to a member function getAttributeText() on stringMagento 2致命错误:调用字符串上的成员函数getAttributeText()
【发布时间】:2017-02-27 05:45:16
【问题描述】:

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

【问题讨论】:

    标签: fatal-error magento2


    【解决方案1】:

    我不知道您为什么要获得 id,我不太确定,但我认为以下代码可以工作:

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

    如果不评论

    【讨论】:

      猜你喜欢
      • 2019-02-11
      • 1970-01-01
      • 2015-08-07
      • 2012-09-05
      • 1970-01-01
      • 1970-01-01
      • 2015-07-27
      • 2021-05-16
      相关资源
      最近更新 更多