如何得到product attribute option的lable

1
2
3
4
5
6
7
8
9
public function getOptionTitle($option_id){
$_product = Mage::getModel('catalog/product');
$attr = $_product->getResource()->getAttribute("brand");
$brand_label = '';
if ($attr->usesSource()) {
$brand_label = $attr->getSource()->getOptionText($option_id);
}
return $brand_label;
}

 

坚持原创技术分享,您的支持将鼓励我继续创作!