Magento : get attribute value php

独自空忆成欢 提交于 2019-12-12 04:59:54

问题


i have tow attributes described in the image bellow :

i wanna know how to get value of it

________
_________
_________

Thanks !


回答1:


First load the product model:

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

then use:

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

and

$minPrice = $product->getMinPrice();

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



来源:https://stackoverflow.com/questions/22530531/magento-get-attribute-value-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!