Invalid product vars
at line 290 in file override/classes/Link.php
285. if (is_array($product) && isset($product['id_product'])) {
286. $params['id'] = $product['id_product'];
287. } elseif ((int) $product) {
288. $params['id'] = $product;
289. } else {
290. throw new PrestaShopException('Invalid product vars');
291. }
292. } else {
293. $params['id'] = $product->id;
294. }
295. if (!is_object($product)) {
94. private function getCanonicalURL($controller, $id)
95. {
96. if ($controller == 'category') {
97. return Context::getContext()->link->getCategoryLink($id);
98. } elseif ($controller == 'product') {
99. return Context::getContext()->link->getProductLink($id);
100. } elseif ($controller == 'cms') {
101. if ($id == 0 || $id == null) {
102. return Context::getContext()->link->getCMSCategoryLink(Tools::getValue('id_cms_category'));
103. } else {
104. return Context::getContext()->link->getCMSLink($id);
136. $id_category = '';
137. if ($this->product) {
138. $id_product = (int)Context::getContext()->controller->getProduct()->id;
139. $productCanonical = ArSeoProCanonicalProduct::getCanonicalURLByIdLang($id_product, Context::getContext()->language->id);
140. if (empty($productCanonical) || $productCanonical['url'] == '') {
141. $canonicalURL = $this->getCanonicalURL($pageName, $id_product);
142. } else {
143. $canonicalURL = ($productCanonical['active'] == 1) ? $productCanonical['url'] : $this->getCanonicalURL($pageName, $id_product);
144. }
145. }
146. } elseif ($pageName == 'category') {
266. $content .= $this->render('head_meta.tpl', $vars);
267. }
268. }
269. }
270. if ($this->getCanonicalConfig()->enable) {
271. $content .= $this->getCanonicalConfig()->getCanonicalData($params);
272. }
273. return $content;
274. }
275.
276. public function registerFilters()
1002. return $output;
1003. }
1004.
1005. public static function coreCallHook($module, $method, $params)
1006. {
1007. return $module->{$method}($params);
1008. }
1009.
1010. public static function coreRenderWidget($module, $hook_name, $params)
1011. {
1012. $context = Context::getContext();
426. // Since is_callable() will always return true when __call() is available,
427. // if the module was expecting an aliased hook name to be invoked, but we send
428. // the canonical hook name instead, the hook will never be acknowledged by the module.
429. $methodName = static::getMethodName($hookName);
430. if (is_callable([$module, $methodName])) {
431. return static::coreCallHook($module, $methodName, $hookArgs);
432. }
433.
434. // fall back to all other names
435. foreach (static::getAllKnownNames($hookName) as $hook) {
436. $methodName = static::getMethodName($hook);
939.
940. if (0 !== $key && true === $chain) {
941. $hook_args = $output;
942. }
943.
944. $display = Hook::callHookOn($moduleInstance, $registeredHookName, $hook_args);
945.
946. if ($array_return) {
947. $output[$moduleInstance->name] = $display;
948. } else {
949. if (true === $chain) {
593. if (!isset($this->context->cart)) {
594. $this->context->cart = new Cart();
595. }
596.
597. $this->context->smarty->assign([
598. 'HOOK_HEADER' => Hook::exec('displayHeader'),
599. ]);
600. }
601.
602. public function initFooter()
603. {
412.
413. // Assign attribute groups to the template
414. $this->assignAttributesGroups($product_for_template);
415. }
416.
417. parent::initContent();
418. }
419.
420. public function displayAjaxQuickview()
421. {
422. $productForTemplate = $this->getTemplateVarProduct();
301. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
302. $this->initHeader();
303. }
304.
305. if ($this->viewAccess()) {
306. $this->initContent();
307. } else {
308. $this->errors[] = $this->trans('Access denied.', [], 'Admin.Notifications.Error');
309. }
310.
311. if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className))) {
513. if (isset($params_hook_action_dispatcher)) {
514. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
515. }
516.
517. // Running controller
518. $controller->run();
519.
520. // Execute hook dispatcher after
521. if (isset($params_hook_action_dispatcher)) {
522. Hook::exec('actionDispatcherAfter', $params_hook_action_dispatcher);
523. }
23. * @copyright Since 2007 PrestaShop SA and Contributors
24. * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
25. */
26.
27. require dirname(__FILE__).'/config/config.inc.php';
28. Dispatcher::getInstance()->dispatch();