Invalid product vars
at line 174 in file classes/Link.php
169. if (is_array($product) && isset($product['id_product'])) {
170. $params['id'] = $product['id_product'];
171. } elseif ((int) $product) {
172. $params['id'] = $product;
173. } else {
174. throw new PrestaShopException('Invalid product vars');
175. }
176. } else {
177. $params['id'] = $product->id;
178. }
179.
1224. if (!empty($context->controller->php_self)) {
1225. $controller = $context->controller->php_self;
1226. }
1227.
1228. if ($controller == 'product' && isset($params['id_product'])) {
1229. return $this->getProductLink((int) $params['id_product'], null, null, null, (int) $idLang);
1230. } elseif ($controller == 'category' && isset($params['id_category'])) {
1231. return $this->getCategoryLink((int) $params['id_category'], null, (int) $idLang);
1232. } elseif ($controller == 'supplier' && isset($params['id_supplier'])) {
1233. return $this->getSupplierLink((int) $params['id_supplier'], null, (int) $idLang);
1234. } elseif ($controller == 'manufacturer' && isset($params['id_manufacturer'])) {
Argument [0] 0 Argument [1] Argument [2] Argument [3] Argument [4] 1
2034. // No need to display alternative lang if there is only one enabled
2035. return $alternativeLangs;
2036. }
2037.
2038. foreach ($languages as $lang) {
2039. $langUrl = $this->context->link->getLanguageLink($lang['id_lang']);
2040. $alternativeLangs[$lang['language_code']] = $this->sanitizeUrl($langUrl);
2041. }
2042.
2043. return $alternativeLangs;
2044. }
Argument [0] 1
1522. }
1523. $pages['register'] = $this->context->link->getPageLink('authentication', true, null, ['create_account' => '1']);
1524. $pages['order_login'] = $this->context->link->getPageLink('order', true, null, ['login' => '1']);
1525. $urls['pages'] = $pages;
1526.
1527. $urls['alternative_langs'] = $this->getAlternativeLangsUrl();
1528.
1529. $urls['theme_assets'] = __PS_BASE_URI__ . 'themes/' . $this->context->shop->theme->getName() . '/assets/';
1530.
1531. $urls['actions'] = [
1532. 'logout' => $this->context->link->getPageLink('index', true, null, 'mylogout'),
1647.
1648. public function getTemplateVarShop()
1649. {
1650. $address = $this->context->shop->getAddress();
1651.
1652. $urls = $this->getTemplateVarUrls();
1653. $psImageUrl = $urls['img_ps_url'] ?? _PS_IMG_;
1654.
1655. $shop = [
1656. 'id' => $this->context->shop->id,
1657. 'name' => Configuration::get('PS_SHOP_NAME'),
524. 'cart' => $this->cart_presenter->present($this->context->cart),
525. 'currency' => $this->getTemplateVarCurrency(),
526. 'customer' => $this->getTemplateVarCustomer(),
527. 'language' => $this->objectPresenter->present($this->context->language),
528. 'page' => $this->getTemplateVarPage(),
529. 'shop' => $this->getTemplateVarShop(),
530. 'urls' => $this->getTemplateVarUrls(),
531. 'configuration' => $this->getTemplateVarConfiguration(),
532. 'field_required' => $this->context->customer->validateFieldsRequiredDatabase(),
533. 'breadcrumb' => $this->getBreadcrumb(),
534. 'link' => $this->context->link,
585. /**
586. * Initializes common front page content: header, footer and side columns.
587. */
588. public function initContent()
589. {
590. $this->assignGeneralPurposeVariables();
591. $this->process();
592.
593. if (!isset($this->context->cart)) {
594. $this->context->cart = new Cart();
595. }
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))) {
520. if (isset($params_hook_action_dispatcher)) {
521. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
522. }
523.
524. // Running controller
525. $controller->run();
526.
527. // Execute hook dispatcher after
528. if (isset($params_hook_action_dispatcher)) {
529. Hook::exec('actionDispatcherAfter', $params_hook_action_dispatcher);
530. }
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();