Magento fatal error with IWD Onepage Checkout
ajax, jquery, magento, php
Solution
I solved this issue by myself. Thanks anyway.
If anyone have this issue. Here is the Solution for it
Go to: /Magento folder/app/code/community/IWD/Opc/Block/Links.php
Find:
if (Mage::helper('opc')->isEnable()){
$parentBlock->addLink($text, 'onepage', $text, true, array('_secure'=>true), 60, null, 'class="top-link-checkout"');
}
else{
$parentBlock->addLink($text, 'checkout', $text, true, array('_secure'=>true), 60, null, 'class="top-link-checkout"');
}
return $this;
}
Replace it with:
if ($parentBlock = $this->getParentBlock()) {
$text = $this->__('Checkout');
$parentBlock->addLink($text, 'checkout', $text, true, array(), 60, null, 'class="top-link-checkout"');
}
return $this;
}
Clear cache and cookies and you're done :)
Problem
I am using magento one page checkout for the quick checkout process. It is throwing fatal error upon adding product to cart. In j2t ajax and in header cart area its showing fatal error but after reloading the page error gone and product added to shopping cart. In PHP error log shows following error ``` PHP Fatal error: Call to a member function addLink() on a non-object in /home/public_html/app/code/community/IWD/Opc/Block/Links.php on line 17 ``` On line 17 ``` $parentBlock->addLink($text, 'onepage', $text, true, array('_secure'=>true), 60, null, 'class="top-link-checkout"'); ``` I've tried to disable ajax cart and also Compilation to disabled but its still throwing error. Any idea why its showing error? Thank you in advance :)