Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email

Magento Forum

How do I overload a function within a magento class? 
Jr. Member
Total Posts:  4
Joined:  2008-09-04

When you have a bundle product, the options the user selects to configure the product, do not show a sku for each option.

I would like to have the product sku beside the product title and I have achieved this by directly modifying the class (located at: /app/code/core/Mage/Bundle/Catalog/Product/View/Type/Bundle/Option.php) My modified function is shown below.

public function getSelectionTitlePrice($_selection$includeContainer true)
$this->getProduct()->getPriceModel()->getSelectionPreFinalPrice($this->getProduct(), $_selection1);
$_selection->getSku() . '&nbsp;' $_selection->getName() . ' &nbsp; ' . ($includeContainer '<span class="price-notice">':'') . '+' .
$this->formatPriceString($price$includeContainer) . ($includeContainer '</span>':'');

This works just fine and accomplished my goal but now I need to find a way to overload the fucntion so that im not modifying magento souce and so that I can enjoy regular updates.

This tutorial looked very promising but I still seem to be missing something

Could someone please direct me in the right direction to make this into a module that overloads the above function?


Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top