且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Magento的:获取属性值的PHP

更新时间:2023-11-30 10:18:40

首先加载产品模型:

$product = Mage::getModel('catalog/product')->load(<product_id>);

然后使用:

$allowCustomPrice = $product->getAttributeText('allow_custom_price');

$minPrice = $product->getMinPrice();

注意:我假设,您将替换为原始产品ID,其属性代码分别为"allow_custom_price"和"min_price".

Note: I am asuming, that you will replace with original product id, and attribute codes are "allow_custom_price" and "min_price" respectively.