2014-02-24 16 views
0
$attribute_details = Mage::getSingleton("eav/config")->getAttribute("catalog_product", $code); 
     $options = $attribute_details->getSource()->getAllOptions(false); 
     foreach($options as $option){ 
      echo '<p class="question"></p>'; 
      echo '<input type="radio" id="'.$code.$option["value"].'" value="' . $option["value"] .'" class="styled" name=" '. $code . ' " />'; 
      echo '<label for="'.$code.$option["value"].'">'; 
      echo $option["label"]; 
      echo '</label>'; 
     } 

有没有办法获得问题前端标签? $选项[值]为1/0和$选项[标签]是/否 - 我需要拿到“问题文本”magento中的“是/否属性” - 如何获得文本值

+0

你可能会从http://magento.stackexchange.com/的专家那里得到更好的答案。 –

回答

1

的属性已frontend_label值,你可以通过做得到它:

echo $attribute_details->getFrontendLabel(); 

如果我理解你的问题:)