Magento : get attribute value php

2019-09-05 21:01发布

问题:

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.