当我打开购物车管理面板时,我得到一个错误:
致命错误:在第38行的/home/u371067346/public_html/controller/module/featured.php中对非对象调用成员函数calculate()
featured.php
中存在错误的代码:
if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
$price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
} else {
$price = false;
}
在我的本地副本打开推车工作正常。
这是因为在管理端没有为税务类创建对象(也是不必要的),但在目录中,我们需要计算税款,因此class Tax
的对象被创建并添加到注册表中。要更清楚地了解,请查看目录和管理文件夹的index.php
文件。您将在前端的index.php
文件中找到$registry->set('tax', new Tax($registry));
,但在管理面板的index.php
文件中找不到。