Invalid product vars
at line 173 in file classes/Link.php
168. if (is_array($product) && isset($product['id_product'])) {
169. $params['id'] = $product['id_product'];
170. } elseif ((int) $product) {
171. $params['id'] = $product;
172. } else {
173. throw new PrestaShopException('Invalid product vars');
174. }
175. } else {
176. $params['id'] = $product->id;
177. }
178.
1207. if (!empty($context->controller->php_self)) {
1208. $controller = $context->controller->php_self;
1209. }
1210.
1211. if ($controller == 'product' && isset($params['id_product'])) {
1212. return $this->getProductLink((int) $params['id_product'], null, null, null, (int) $idLang);
1213. } elseif ($controller == 'category' && isset($params['id_category'])) {
1214. return $this->getCategoryLink((int) $params['id_category'], null, (int) $idLang);
1215. } elseif ($controller == 'supplier' && isset($params['id_supplier'])) {
1216. return $this->getSupplierLink((int) $params['id_supplier'], null, (int) $idLang);
1217. } 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.
762. header('HTTP/1.1 503 Service Unavailable');
763. header('Retry-After: 3600');
764.
765. $this->registerStylesheet('theme-error', '/assets/css/error.css', ['media' => 'all', 'priority' => 50]);
766. $this->context->smarty->assign([
767. 'urls' => $this->getTemplateVarUrls(),
768. 'shop' => $this->getTemplateVarShop(),
769. 'HOOK_MAINTENANCE' => Hook::exec('displayMaintenance', []),
770. 'maintenance_text' => Configuration::get('PS_MAINTENANCE_TEXT', (int) $this->context->language->id),
771. 'stylesheets' => $this->getStylesheets(),
772. ]);
460. $infos = Address::getCountryAndState((int) $cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')});
461. $country = new Country((int) $infos['id_country']);
462. $this->context->country = $country;
463. }
464.
465. $this->displayMaintenancePage();
466.
467. if (Country::GEOLOC_FORBIDDEN == $this->restrictedCountry) {
468. $this->displayRestrictedCountryPage();
469. }
470.
119. *
120. * @see FrontController::init()
121. */
122. public function init()
123. {
124. parent::init();
125.
126. // Get proper IDs
127. $this->id_product = (int) Tools::getValue('id_product');
128. $this->id_product_attribute = (int) Tools::getValue('id_product_attribute', null);
129.
295. /**
296. * Starts the controller process (this method should not be overridden!).
297. */
298. public function run()
299. {
300. $this->init();
301. if ($this->checkAccess()) {
302. // setMedia MUST be called before postProcess
303. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
304. $this->setMedia();
305. }
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();
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();