1
votes

In select.phtml under /template/bundle/catalog/product/view/options/type/bundle/option/select.phtml it has the function for creating options for the select drop downs for bundled products.

The default set up uses echo $this->getSelectionTitlePrice($_selection, false) for the options under a foreach $_selections as $_selection

This produces [PRODUCT OPTION NAME] +[PRICE DIFFERENCE]

I'm bundling clothing and I want to change this to be the size attribute of that option ('pos_sizes') because the product name doesn't have the size in it and the size attribute is the only difference and there won't be a price difference. So I'm pretty much wanting to change the options to just the drop down options to the [POS_SIZES] attribute.

I've tried a number of methods including variations of

$_option->getAttributeText('pos_sizes')

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

But can't get the attribute of the option to show up.

The available variables at the top of select.phtml are

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

1 Answers

2
votes

I was almost there. A little more playing got this. I had to get the id of the $_selection first, and then get the AttributeText from that.

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