【问题标题】:Magento : Fatal error: Call to a member function getMethodInstance() on a non-objectMagento:致命错误:在非对象上调用成员函数 getMethodInstance()
【发布时间】:2017-01-24 03:13:09
【问题描述】:

登录管理员 > 销售 > 订单,然后单击查看一些订单显示详细信息,但一些订单显示错误

致命错误:在 a 上调​​用成员函数 getMethodInstance() 非对象在 /home/easter13/public_html/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php 在第 96 行

请帮帮我,谢谢。

【问题讨论】:

  • 第 96 行是什么?
  • 好吧,it's not core code! - 糟糕! 不要修改核心代码!!!!!!

标签: php magento zend-framework magento-1.7


【解决方案1】:

这是因为您的邮件配置有问题。我有两个建议:

1。打开app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php 在第 92 行,将您的代码替换为以下代码:

if ($this->_isAllowedAction('emails') && !$order->isCanceled()) {
    $confirmationMessage = $coreHelper->jsQuoteEscape(
        Mage::helper('sales')->__('Are you sure you want to send order email to customer?')
    );
    $this->addButton('send_notification', array(
        'label'     => Mage::helper('sales')->__('Send Email'),
        'onclick'   => "confirmSetLocation('{$confirmationMessage}', '{$this->getEmailUrl()}')",
    ));
}

然后清除缓存,刷新页面,看看你的错误是否消失了。

2。打开app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php 在第 92 行,取消注释此代码,然后清除缓存, 刷新页面并检查您的错误是否消失。

【讨论】:

  • 欢迎来到 StackOverflow!这是一个糟糕的答案,因为您永远不应该鼓励开发人员覆盖核心 Magento 代码。此外,您的#2 点在#1 的上下文中似乎没有意义。
  • 感谢您的回答。但我同意你的建议 1 和 2,但它不起作用。您认为此错误的其他问题是什么。非常感谢你
  • @RobbieAverill 我能得到帮助吗magento.stackexchange.com/q/319888/57334 谢谢
猜你喜欢
  • 2010-12-20
  • 2015-06-16
  • 2016-02-02
  • 2014-05-06
  • 1970-01-01
  • 2023-03-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多