Module Opencart在另一个模块中添加模块

Module Opencart在另一个模块中添加模块,module,custom-controls,opencart,Module,Custom Controls,Opencart,我有两个模块 自定义页脚 推荐的 现在我尝试在自定义页脚中显示推荐模块。我又加了一句 // Display testimonial part $this->data['testimonial_block'] = $module = $this->getChild('module/testimonial', array( 'limit' => 5, 'image_width' => 80, 'image_hei

我有两个模块

  • 自定义页脚
  • 推荐的
  • 现在我尝试在自定义页脚中显示推荐模块。我又加了一句

    // Display testimonial part
            $this->data['testimonial_block'] = $module = $this->getChild('module/testimonial', array(
            'limit' => 5,
            'image_width' => 80,
            'image_height' => 80
            ));
    
    $this->render()之前的
    “catalog/controller/common/customfooter.php”

    并在
    customfooter.tpl

    在添加这个之后,我得到了这个错误

    Notice: Undefined index: testimonial_title in C:\xampp\htdocs\magichomegym\catalog\controller\module\testimonial.php on line 6
    Notice: Undefined index: testimonial_limit in C:\xampp\htdocs\magichomegym\catalog\controller\module\testimonial.php on line 22
    

    有人知道我哪里出错了吗?

    您需要在数组中提供相关数据

    $this->data['testimonial_block'] = $module = $this->getChild('module/testimonial', array(
        'limit' => 5,
        'image_width' => 80,
        'image_height' => 80,
        'testimonial_title' => 'Title here',
        'testimonial_limit' => 5,
    ));
    
    将5替换为您想要显示的推荐数量,将“标题”替换为您想要的标题