2012-08-15 198 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; 
相關問題