【发布时间】:2011-12-28 22:16:02
【问题描述】:
我有两个自定义属性,一个叫做“amz_prod_description”,一个叫做“upc”。
我应该能够同时访问它们 $product->getUpc() 和 $product->getAmzProdDescription() where $product.在同一个开关中,我同时使用了这两种方法。 'upc' 属性 var 工作正常,另一个根本不工作,这真的让我很困惑,因为他们都使用 Magento 要求的方法和相同的 PHP 函数。所以他们都在同一个上下文中,等等。
帮帮我!? :\
这是我的实际代码>
case "{amazon_description}":
$description = $product->getAmzProdDescription();
// I have tested, $description is not being set. I have changed the bottom return to just $description and it returns nothing.
if(strlen($description) > 1499) {
$amz_description = substr($description,0,1500) . "...";
} else {
$amz_description = $description;
}
return $amz_description;
break;
case "{upc}":
$upc = $product->getUpc();
return $upc;
break;
【问题讨论】:
-
$product->getData() 是否显示自定义属性?