duan19740319 2012-02-08 00:24
浏览 43
已采纳

从1.5.0.1> 1.6.2升级:签出错误(无效方法Mage_Checkout_Block_Onepage_Billing :: isTaxvatEnabled)

I'm really hoping someone has come across this before, Googling didn't get me too far.

I'm in the process of upgrading my shop from 1.5.0.1 to 1.6.2. Thankfully, everything seems to have gone smoothly, but I'm running into a really odd, concerning problem.

It appears Magento now includes a new template within the default theme - app/design/frontend/base/default/template/persistent

When I try to checkout and run some test orders, I keep receiving this error - http://pastie.org/3337035

So I figured it was a problem with my custom theme in relation to the upgrade, and temporarily switched back to the new default theme. Nope, still got the same error. I then tried copying that new /persistent template directory to my custom theme, and that didn't help either.

My solution at this point has been to comment out the code in question, like so: (in persistent/checkout/onepage/billing.phtml)

<?php //if ($this->isTaxvatEnabled()):?>
<li><?php //echo $this->getTaxvatHtml() ?></li>
<?php //endif; ?>

This appears to have fixed the error and allows checkouts to go through, issue-free, but I really want to know what's going on here. What exactly is Taxvat? I've also tried the solution in this post - error with magento checkout to no avail.

This is a test installation, and I'd really like to clear this up before I go live with 1.6.2. Thank you for any insight.

  • 写回答

1条回答 默认 最新

  • douewei1665 2012-02-08 00:58
    关注

    Your phtml template file is fine. However, its parent block (Mage_Checkout_Block_Onepage_Billing) is missing the isTaxvatEnabled. This method is a new method in the 1.6 branch of Magento, so there's two possible reasons for this

    1. "You" (meaning you or Magento Connect) failed to update the file in app/code/core/Mage/Checkout/Block/Onepage/Billing.php

    2. You, or a previous developer, or a third party module, created a code pool override, and there's an old version of the billing block living in app/code/community/Mage/Checkout/Block/Onepage/Billing.php, app/code/local/Mage/Checkout/Block/Onepage/Billing.php, or at another location that's been added to the path (rare, but I've seen it).

    The quickest way to find this file is to add the following bit of code to your PHTML template file

    $rClass = new ReflectionClass($this);
    var_dump($rClass->getFilename());
    

    If this file is in core, then your upgrade failed, and you have a system that's half 1.5 and half 1.6. The most common cause for this is a brain dead Magento Connect which will silently fail on certain types of file permission errors, although failure to upload all the files is another common reason. Start your upgrade over again, diff your upgrade file tree vs. a freshly downloaded tree.

    If this file is somewhere else, you need to

    1. Determine what methods, properties, or other code was added to the file in your community or local code pool

    2. Make a copy of the 1.6.2 Billing.php

    3. Add the method from one to the file

    4. Replace the Billing.php in local with the Billing.php you just created.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?