Magento的:获取属性值的PHP [英] Magento : get attribute value php
本文介绍了Magento的:获取属性值的PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我具有以下图像中描述的两个属性:
i have tow attributes described in the image bellow :
我想知道如何获得它的价值
i wanna know how to get value of it
________
_________
_________
谢谢!
推荐答案
首先加载产品模型:
$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.
这篇关于Magento的:获取属性值的PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文