Showing results for 
Search instead for 
Did you mean: 

Displaying something other than full product name in bundle product selection

Displaying something other than full product name in bundle product selection

This is easiest for me to explain by example.

Let's say I sell a shirt. Alone it's a configurable product with simple products representing each size. When a customer buys it on the configurable product page, they are given a choice with simple labels like "Size: Small". Now imagine I have a bundle where one of the included items is this shirt. OOTB I would need to include each of the simple products as an option for one of the bundle items. Instead of a simple selection, they get something like "Shirt: Example T-Shirt by Someguy Designs - Small". This is messy and potentially confusing, especially with longer product names.


One possible solution would be to give the simple product a name like "Small" instead, but this seems problematic, especially with a large catalog. "Small Example T-Shirt by Someguy Designs" is a better compromise, but is even messier than the original example because different length prefixes (ie "2XL Example..." vs "Medium Example..") means the rest of the product name won't align in a visually pleasing way - and it still presents more information than the customer needs in the box.


Based on some feedback I already recieved in stackexchange, it seems like the cleanest solution that requires the least coding would be to use an attribute like name_in_bundle. Then the bundle display code could check if that attribute has a value, and if it does it displays that value instead of the product name in the <select> (or next to the radio button or whatever). The problem is I have no idea where the code is that would need to be modified! I am comfortable enough with php that I should be able to sort out the actual edit, but I need some direction on where to look. So far my google-fu has not been helpful.


Alternately, a way to include configurable products as bundle items would both take care of this and let me solve an unrelated issue I also have. I see there is an extension that is supposed to do this by Wizkunde, but I sent them an e-mail a few days ago asking about a few of its capabilities and never got a response, so that doesn't inspire much confindence in it. Has anyone used that extension, and if they have would you mind asking me a few questions about how it handles certain things? Or is there an alternative I'm missing that's also available?


Pardon the walls of text and total newbie questions - thank you so much for your help!


Re: Displaying something other than full product name in bundle product selection

So the name on bundle products is made up of the product name & the price. The templates used are located in app\design\frontend\base\default\template\bundle\catalog\product\view\type\bundle\option\ and the title is from getSelectionTitlePrice.


You just need to override getSelectionTitlePrice with your own function.


I don't know of a single one of our clients using bundle products and I don't have a blank install with sample data so I don't have access to a testing server with bundle products in it, and they take forever to create, so I can't really test anything and provide working code.

Chris / Placement Edge

Re: Displaying something other than full product name in bundle product selection

Is the problem from your customers view or from backend view (staff) finding this odd ?


If you sell a T-shirt and the shop is correctly setup the Product name will be taken from the conf. product (main product) and only in cart will the whole string be displayed - ex. T-shirt-blue-ribbon-small or something similar ?

Simple products attached to the configurable product, must be set to "Not individual visible" under Visibilty 



Have you thought about making a new attribute called "special name" displaying this to your customers, and simply "display:none;" on the "name-attribute" in frontend ?


Maybe I misunderstood your question ?

-- Best regards --
Kent Christiansen | Magento Certified Solution Specialist

Re: Displaying something other than full product name in bundle product selection

Pointing me to getSelectionTitlePrice() was hugely helpful, thanks! But for some reason I can't seem to access the custom attribute, despite trying a few different ways. The custom attribute is code 'bundlename' and I do have it set for some of the simple products in the bundle. (I also set it for the bundle itself so that I can see if I somehow pull it from the bundle instead of the selection.)


Here's my (not working) code so far:

public function getSelectionTitlePrice($_selection, $includeContainer = true)
    $price = $this->getProduct()->getPriceModel()->getSelectionPreFinalPrice($this->getProduct(), $_selection, 1);

	$defaultTitle = $this->escapeHtml($_selection->getName());
	$altTitle = $this->escapeHtml($_selection->getData('bundlename'));

	$priceTitle = ( ($altTitle == NULL) ? $defaultTitle : $altTitle );

	$priceTitle .= ' &nbsp; ' . ($includeContainer ? '<span class="price-notice">' : '')
        . '+' . $this->formatPriceString($price, $includeContainer)
        . ($includeContainer ? '</span>' : '');

    return $priceTitle;

As far as I can tell, getData is always returning null (or at least something that == NULL).


I've also tried the following variations:

$altTitle = $this->escapeHtml($_selection->getBundlename());
$altTitle = $this->escapeHtml($_selection->getProduct()->getData('bundlename'));
$altTitle = Mage::getResourceModel('catalog/product')->getAttributeRawValue($_selection->getId(), 'bundlename');

 as well as a few other things like removing the $this->escapeHtml()


Nothing seems to work. Am I missing something simple here?

Re: Displaying something other than full product name in bundle product selection

I've got an idea for how to expand this into a more powerful solution but my rudimentary understanding isn't enough to confirm this will work the way I'd expect.


I'd like to have a set of alternate methods for getSelectionTitlePrice() that I can use to display different information - for example, one that pulls a "size" attribute and does not show a price, another that uses a different attribute, etc. I understand my new methods are supposed to go in  /app/code/local/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php but I don't know if I need to copy the core Option.php and add the new methods at the bottom or just include the new methods only.


Then comes the question of how to call the alternate methods for specific bundles. Would this involve a custom design or custom layout or the like on the bundles? Or does it make more sense to have one big getSelectionTitlePrice() that checks an attribute of the bundle itself o determine what it actually spits out?


I also still need to figure out how to actually get the attributes from the selected simple product like I asked in my last post - no progress on that front yet and without it none of this is possible.


Thanks again for any help you can provide!