I have a CE Magento 1.9 application that is using a custom theme from Trego and a checkout extension from Webtex. The application was functioning but then after installing the checkout extension, I got the following error when loading the home page:
Fatal error: Call to undefined method Webtex_OnePageCheckout_Helper_Data::isOnepageCheckoutEnabled() in C:\Sites\mycompany\app\code\community\Trego\OnepageCheckout\Block\Links.php on line 6
Line 6 is as follows:
if ($this->helper('onepagecheckout')->isOnepageCheckoutEnabled())
Here's the relevant file, \OnepageCheckout\Block\Links.php:
<?php
class Trego_OnepageCheckout_Block_Links extends Mage_Checkout_Block_Links
{
public function addCheckoutLink()
{
if ($this->helper('onepagecheckout')->isOnepageCheckoutEnabled())
{
$parent = $this->getParentBlock();
if ($parent)
$parent->addLink($this->helper('onepagecheckout')->__('Checkout'), 'onepagecheckout', $this->helper('onepagecheckout')->__('Checkout'), true, array('_secure'=> true), 60, null, 'class="top-link-checkout"');
return $this;
}
else
return parent::addCheckoutLink();
}
}
My question: Why is the application referencing the Webtex_OnePageCheckout_Helper_Data class instead of the Trego_OnepageCheckout_Block_Links class for the isOnepageCheckoutEnabled() method?
Helper snippet from local/Webtex/OnePageCheckout/etc/config.xml:
<helpers>
<onepagecheckout>
<class>Webtex_OnePageCheckout_Helper</class>
</onepagecheckout>
</helpers>
Helper snippet from community/Trego/OnepageCheckout/etc/config.xml:
<helpers>
<checkout>
<rewrite>
<url>Trego_OnepageCheckout_Helper_Url</url>
</rewrite>
</checkout>
<onepagecheckout>
<class>Trego_OnepageCheckout_Helper</class>
</onepagecheckout>
</helpers>