sebastien973 Posted December 30, 2018 Share Posted December 30, 2018 Hi, i'm try yo add a new fonction on a module " best seller" and New product on Home page. I want a Category from which to pick products to be displayed. But i add code but now i have 3 errors! I need Help please! Thanks Invalid category varsat line 375 in file classes/Link.php 370. if (is_array($category) && isset($category['id_category'])) { 371. $category = new Category($category, $idLang); 372. } elseif ((int) $category) { 373. $category = new Category((int) $category, $idLang); 374. } else { 375. throw new PrestaShopException('Invalid category vars'); 376. } 377. } 378. return $category; 379. } 380. LinkCore->getCategoryObject - [line 428 - classes/Link.php] - [2 Arguments] 423. $rule = 'layered_rule'; 424. $params['selected_filters'] = $selectedFilters; 425. } 426. 427. if (!$alias) { 428. $category = $this->getCategoryObject($category, $idLang); 429. } 430. $params['rewrite'] = (!$alias) ? $category->link_rewrite : $alias; 431. if ($dispatcher->hasKeyword($rule, $idLang, 'meta_keywords', $idShop)) { 432. $category = $this->getCategoryObject($category, $idLang); 433. $params['meta_keywords'] = Tools::str2url($category->getFieldByLang('meta_keywords')); LinkCore->getCategoryLink - [line 112 - modules/hrxcmsbestsellerproducts/hrxcmsbestsellerproducts.php] - [1 Arguments] 107. $show_products = $hrx_obj_prod->displayBestSellers(); 108. 109. $allProductsLink = Context::getContext()->link->getPageLink('best-sales'); 110. 111. $cat_id = Configuration::get('HRXCMSTABBESTSELLERPRODUCTS_PROD_CAT'); 112. $allProductsLink = Context::getContext()->link->getCategoryLink($cat_id); 113. 114. $this->context->smarty->assign('id_lang', $id_lang); 115. $this->context->smarty->assign('show_fields', $show_fields); 116. $this->context->smarty->assign('show_products', $show_products); 117. $this->context->smarty->assign('allProductsLink', $allProductsLink); HrxcmsBestSellerProducts->hookdisplayLeftColumn - [line 924 - classes/Hook.php] - [1 Arguments] 919. return $output; 920. } 921. 922. public static function coreCallHook($module, $method, $params) 923. { 924. return $module->{$method}($params); 925. } 926. 927. public static function coreRenderWidget($module, $hook_name, $params) 928. { 929. return $module->renderWidget($hook_name, $params); But Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now