我正在尝试通过 Mage_Sales_Model_Order.php 中的自定义属性访问特定产品的处理时间$handlingtime = $this->getProduct()->getAttributeText('fig_handling_time');
但是每次我发送订单电子邮件时都会收到错误消息Fatal error: Call to a member function getAttributeText() on a non-object in /home/japena/public_html/app/code/local/Mage/Sales/Model/Order.php on line 1320
我整天都在研究,尝试了许多不同的代码,得出的结论是我无法访问该产品$this->getProduct()
,或者Mage::getModel('catalog/product')
我也尝试过
$_product = Mage::getModel("catalog/product")->load($_product->getId());
$handlingtime = $_product->getData('fig_handling_time');
$product = Mage::getModel('catalog/product')->load($item->getId());
$handlingtime = $product->getAttributeText('fig_handling_time');
$handlingtime = Mage::getModel('catalog/product')->load($_item['product_id'])->getAttributeText('fig_handling_time');
$handlingtime = Mage::getModel('catalog/product')->load($product_id)->getAttributeText('fig_handling_time');
似乎没有任何想法能奏效,我将不胜感激。