【问题标题】:How to create new hook for product page using my own module in Prestashop如何在 Prestashop 中使用我自己的模块为产品页面创建新的钩子
【发布时间】:2015-03-20 01:16:25
【问题描述】:

我需要列出所选产品的相关产品项目。我有新的要列出相关产品。

我有以下钩子来显示相关产品。

 public function hookDisplayProductTabContent($params) {
   $related_items = Product::getRelatedProducts((int) $this->context->language->id, 0, (int)Configuration::get('NEW_PRODUCTS_NBR'),(int) $id_product);
 return $this->display(__FILE__, 'views/frontend/relateditems.tpl');
}

ProductTabContent 不显示相关产品。我怎样才能做到这一点。请帮帮我。

【问题讨论】:

    标签: php prestashop


    【解决方案1】:

    您需要将 $related_items 变量分配给 Smarty。

    $this->smarty->assign('related_items', $related_items);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-02
      • 1970-01-01
      • 2017-03-13
      • 1970-01-01
      • 1970-01-01
      • 2017-04-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多