2012-08-15 90 views
1

在select.phtml下的/template/bundle/catalog/product/view/options/type/bundle/option/select.phtml中,它具有为选择下拉菜单创建选项的功能捆绑产品。Magento Bundle - 获取选项的属性

的默认设置为选项用途echo $this->getSelectionTitlePrice($_selection, false)foreach $_selections as $_selection

这将产生[产品选项名称] + [价格差异]

我捆绑的衣服和我想改变这是该选项的大小属性('pos_sizes'),因为产品名称中没有大小,而大小属性是唯一的区别,并且不会有价格差异。所以我非常想要将选项更改为[POS_SIZES]属性的下拉选项。

我已经尝试了许多方法,包括的

$_option->getAttributeText('pos_sizes') 

$attribute=Mage::getModel('catalog/product')->getResource()->getAttribute("pos_sizes") 

的变化,但无法获得期权的属性展现出来。

在select.phtml顶部的可变量是

<?php $_option  = $this->getOption(); ?> 
<?php $_selections = $_option->getSelections(); ?> 
<?php $_default  = $_option->getDefaultSelection(); ?> 
<?php list($_defaultQty, $_canChangeQty) = $this->_getDefaultValues(); ?> 

回答

2

我是几乎没有。多一点玩得到了这一点。我必须先获取$ _selection的id,然后从中获取AttributeText。

$bundledsize = Mage::getModel('catalog/product')->load($_selection->getId())->getAttributeText('pos_sizes'); 
echo $bundledsize;