It sounds like you have mismatched code from different version of Magento running in your system. It's also possible you have a compiled version of an old class, or a community/local code pool override. This is going to be long, so I'll try to call out the specific debugging tips with bold text
As the other answers have made clear, PHP is telling you the exact problem.
Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Radio::_getDefaultValues
Magento is trying to call the _getDefaultValues
method on your Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Radio
object. However, in your system, this object doesn't have this method. If I look at a fresh install of Magento 1.7.0.1 , this class is defined in
#File: app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Radio.php
class Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Radio
extends Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option
{
/**
* Set template
*
* @return void
*/
protected function _construct()
{
$this->setTemplate('bundle/catalog/product/view/type/bundle/option/radio.phtml');
}
}
and in its parent class Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option
, we can find the definition of _getDefaultValues
#File: app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php
class Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option extends Mage_Bundle_Block_Catalog_Product_Price
{
protected function _getDefaultValues()
{
//...
}
}
Protected methods are callable from a block's template, so this means this is not a bug with the shipping version of Magento, but is instead a problem with your system.
Debugging Step 1: The first thing to check would be your version of the file
app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php
Does this file have a _getDefaultValues
method? If not, of if it's private
instead of protected
, then the problem is your version of the phtml
template is from one version of Magento, but your core class file is from another, or has been modified. You could try downloading a fresh copy of the Magento version you're running and replacing the file — but your system may have other problems if this was a botched upgrade, so be ready for that. Fixing that is larger than a single Stack Overflow question.
Debugging Step 2: Check your local and community code pools.
Magento allows you to replace class files by using the app/code/community
and app/code/local
code pools. Your system may have a version of this class file that's in one of these pools. Check for a file in
app/code/community/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php
app/code/local/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php
and if there's a file, check for the _getDefaultValues
method. If it's not there, or if it's private
instead of protected
, you've found your problem. Fixing this will, again, be tricky. If the file was placed here it means a previous developer added or changed methods. You could fix your error above by removing the local
or community
file, but then you'd lose this custom functionality. You'll need to merge a correct core
file in with your local
/community
file OR you'll need to identify the extra functionality in your local
/community
file and refactor these to use class rewrites, and only then remove the file. Again, that's a process that's more complicated than a single stack overflow answer.
Debugging Step 3: Turn off compilation.
It's also possible that Magento is running in "compiled" mode, and that the "compiled" version of your class. Turn off compilation mode from
System -> Tools -> Compilation
or from the command line with
$ php shell/compiler.php disable
and recompile you classes.
Debugging Step 4: Clear opt code cache.
If you're running a system like APC to cache PHP opt code, it may be an old version of the class is in the opt code cache. As there's numerous options here, I'll leave the clearing of this cache as an exercise for the reader.
Debugging Step 5: Use reflection to identify the class file
If you still haven't identified the rouge class at this point, add the following code to the bottom of index.php
$o = Mage::getSingleton('core/layout')->createBlock('bundle/catalog_product_view_type_bundle_option_radio');
$r = new ReflectionClass($o);
echo '<h1>';
var_dump(get_class($o));
var_dump($r->getFilename());
echo '</h1>';
This will instantiate a block class and use reflection to tell you where it's definition file is. From there, you can figure out why this is the wrong definition file, and what you'll need to do to remove it.