我需要列出所选产品的相关产品项。我有新的相关产品列表。
我有下面的挂钩来展示相关的产品。
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);