dongyue4964 2015-02-10 13:58
浏览 75
已采纳

OpenCart 2.0我无法添加模块(ControllerModuleMinicart :: redirect()错误)

I'm trying to add modules to the latest OpenCart version and so far no one worked. First I'm trying to add side cart, I found couple modules, but all of them are for earler versions and doesn't work with 2.0, also I tried to add facebook like box extension and there are the same errors.

So after module download I change couple things like in this thread Thread

1. I changed all $this->data to $data.
2.$this->response->setOutput($this->render());
I changed to $this->response->setOutput($this->load->view('module/minicart.tpl', $data)); 3 I changed $this->children to

$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');

So no errors when I'm trying to manage this module, but error when i'm trying to save it
Fatal error: Call to undefined method ControllerModuleMinicart::redirect() in C:\wamp\www\opencart\admin\controller\module\minicart.php on line 23

And the 23 line looks like:

if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
            $this->model_setting_setting->editSetting('minicart', $this->request->post);        

            $this->session->data['success'] = $this->language->get('text_success');

            $this->redirect($this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'));
        }

What I need to change? How I can finally start using modules ( it seems all modules are still for early versions and we have to remake them all..)

  • 写回答

1条回答 默认 最新

  • douheng8629 2015-02-11 07:54
    关注

    Change

    $this->redirect($this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'));

    to

    $this->response->redirect($this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'));

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

报告相同问题?

悬赏问题

  • ¥15 ELGamal和paillier计算效率谁快?
  • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?
  • ¥15 ubuntu系统下挂载磁盘上执行./提示权限不够
  • ¥15 Arcgis相交分析无法绘制一个或多个图形
  • ¥15 关于#r语言#的问题:差异分析前数据准备,报错Error in data[, sampleName1] : subscript out of bounds请问怎么解决呀以下是全部代码:
  • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格
  • ¥15 fpga自动售货机数码管(相关搜索:数字时钟)
  • ¥15 用前端向数据库插入数据,通过debug发现数据能走到后端,但是放行之后就会提示错误
  • ¥30 3天&7天&&15天&销量如何统计同一行
  • ¥30 帮我写一段可以读取LD2450数据并计算距离的Arduino代码