Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
大家好,我怎样才能得到目录号而不是默认的 sku 号?
$product = Mage::getModel('catalog/product')->loadByAttribute('sku',$str);
上面的代码按 sku 编号获取项目,但我如何根据目录号获取项目?
谢谢
看起来你在问这里之前自己搜索了很多......
您的目录号是指 entity_id 吗?
如果是这样简单:$product = Mage::getModel('catalog/product')->load($entityId);
$product = Mage::getModel('catalog/product')->load($entityId);