Invalid product vars
at line 158 in file override/classes/Link.php
153. if (is_array($product) && isset($product['id_product'])) {
154. $params['id'] = $product['id_product'];
155. } elseif ((int) $product) {
156. $params['id'] = $product;
157. } else {
158. throw new PrestaShopException('Invalid product vars');
159. }
160. } else {
161. $params['id'] = $product->id;
162. }
163.
1229. if (!empty($context->controller->php_self)) {
1230. $controller = $context->controller->php_self;
1231. }
1232.
1233. if ($controller == 'product' && isset($params['id_product'])) {
1234. return $this->getProductLink((int) $params['id_product'], null, null, null, (int) $idLang);
1235. } elseif ($controller == 'category' && isset($params['id_category'])) {
1236. return $this->getCategoryLink((int) $params['id_category'], null, (int) $idLang);
1237. } elseif ($controller == 'supplier' && isset($params['id_supplier'])) {
1238. return $this->getSupplierLink((int) $params['id_supplier'], null, (int) $idLang);
1239. } elseif ($controller == 'manufacturer' && isset($params['id_manufacturer'])) {
Argument [0] 0 Argument [1] Argument [2] Argument [3] Argument [4] 1
2118. // No need to display alternative lang if there is only one enabled
2119. return $alternativeLangs;
2120. }
2121.
2122. foreach ($languages as $lang) {
2123. $langUrl = $this->context->link->getLanguageLink($lang['id_lang']);
2124. $alternativeLangs[$lang['language_code']] = $this->sanitizeUrl($langUrl);
2125. }
2126.
2127. return $alternativeLangs;
2128. }
Argument [0] 1
1559. $pages['brands'] = $pages['manufacturer'];
1560. $pages['register'] = $this->context->link->getPageLink('registration', true);
1561. $pages['order_login'] = $this->context->link->getPageLink('order', true, null, ['login' => '1']);
1562. $urls['pages'] = $pages;
1563.
1564. $urls['alternative_langs'] = $this->getAlternativeLangsUrl();
1565.
1566. $urls['actions'] = [
1567. 'logout' => $this->context->link->getPageLink('index', true, null, 'mylogout'),
1568. ];
1569.
1692.
1693. public function getTemplateVarShop()
1694. {
1695. $address = $this->context->shop->getAddress();
1696.
1697. $urls = $this->getTemplateVarUrls();
1698. $psImageUrl = $urls['img_ps_url'] ?? _PS_IMG_;
1699.
1700. $shop = [
1701. 'id' => $this->context->shop->id,
1702. 'name' => Configuration::get('PS_SHOP_NAME'),
502. 'currency' => $this->getTemplateVarCurrency(),
503. 'customer' => $this->getTemplateVarCustomer(),
504. 'country' => $this->objectPresenter->present($this->context->country),
505. 'language' => $this->objectPresenter->present($this->context->language),
506. 'page' => $this->getTemplateVarPage(),
507. 'shop' => $this->getTemplateVarShop(),
508. 'core_js_public_path' => $this->getCoreJsPublicPath(),
509. 'urls' => $this->getTemplateVarUrls(),
510. 'configuration' => $this->getTemplateVarConfiguration(),
511. 'field_required' => $this->context->customer->validateFieldsRequiredDatabase(),
512. 'breadcrumb' => $this->getBreadcrumb(),
564. /**
565. * Initializes common front page content: header, footer and side columns.
566. */
567. public function initContent()
568. {
569. $this->assignGeneralPurposeVariables();
570. $this->process();
571.
572. if (!isset($this->context->cart)) {
573. $this->context->cart = new Cart();
574. }
30. if(Tools::isSubmit('ets_superseed_load_content') && Module::isEnabled('ets_superspeed'))
31. {
32. parent::initContent();
33. Hook::exec('actionPageCacheAjax');
34. }
35. parent::initContent();
36. }
37. }
459.
460. // Assign attribute groups to the template
461. $this->assignAttributesGroups($product_for_template);
462. }
463.
464. parent::initContent();
465. }
466.
467. /**
468. * Processes submitted customizations
469. *
314. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
315. $this->initHeader();
316. }
317.
318. if ($this->viewAccess()) {
319. $this->initContent();
320. } else {
321. $this->errors[] = $this->trans('Access denied.', [], 'Admin.Notifications.Error');
322. }
323.
324. if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className))) {
505.
506. // Execute hook dispatcher
507. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
508.
509. // Running controller
510. $controller->run();
511.
512. // Execute hook dispatcher after
513. Hook::exec('actionDispatcherAfter', $params_hook_action_dispatcher);
514. } catch (PrestaShopException $e) {
515. $e->displayMessage();
34. echo $cache;
35. exit;
36. }
37. }
38. }
39. parent::dispatch();
40. }
41. }
17. if(strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome-Lighthouse') == TRUE || strpos($_SERVER['HTTP_USER_AGENT'], 'GTmetrix') == TRUE ){
18. require(dirname(__FILE__).'/config/head.php');
19. }else {
20.
21. require(dirname(__FILE__).'/config/config.inc.php');
22. Dispatcher::getInstance()->dispatch();
23. }