public function smartblogrelatedproductHookdisplaySmartAfterPost($params) { if (!$this->isCached('plugins/smartblogrelatedproduct.tpl')) { // $id_cat = BlogCategory::getCategoryNameByPost(Tools::getvalue('id_post')); $id_lang = $this->context->language->id; //$posts = SmartBlogPost::getRelatedProduct($id_lang, Tools::getvalue('id_post')); $id_post = (int) Tools::getvalue('id_post'); if ($id_post == '') { $slug = Tools::getvalue('slug'); $id_post = $this->slug2id($slug); } if ($id_post != null) { $proucts = SmartBlogPost::getRelatedProduct($id_lang, $id_post); $this->smarty->assign(array('products' => $proucts)); } } return $this->display(__FILE__, 'views/templates/front/plugins/smartblogrelatedproduct.tpl'); }