将Customers属性显示为magento的前端

时间:2013-07-08 09:09:47

标签: php magento

我是magento的新手,我从magento后端创建了一个属性 language 。 按照这个。客户>属性管理器

属性有一个输入类型下拉列表。

我想在我的前端用phtml文件显示这个来接收用户的输入。

我该怎么做。

谢谢

1 个答案:

答案 0 :(得分:1)

试试这个

$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'language'); //here, "language" is the attribute_code
$allOptions = $attribute->getSource()->getAllOptions(true, true);
foreach ($allOptions as $instance) {
    $myArray[$instance['value']] = $instance['label'];
}
print_r(($myArray));