簡體   English   中英

如何在Prestashop中使用我自己的模塊為產品頁面創建新的掛鈎

[英]How to create new hook for product page using my own module in Prestashop

我需要列出所選產品的相關產品項目。 我有新的相關產品清單。

我有下面的鈎子來展示相關產品。

 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不顯示相關產品。 我該如何實現。 請幫我。

您需要將$ related_items變量分配給Smarty。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM