Invalid category vars
at line 405 in file classes/Link.php
400. if (isset($category['id_category'])) {
401. $category = new Category($category['id_category'], $idLang);
402. } elseif ((int) $category) {
403. $category = new Category((int) $category, $idLang);
404. } else {
405. throw new PrestaShopException('Invalid category vars');
406. }
407. }
408.
409. return $category;
410. }
458. $rule = 'layered_rule';
459. $params['selected_filters'] = $selectedFilters;
460. }
461.
462. if (!$alias) {
463. $category = $this->getCategoryObject($category, $idLang);
464. }
465. $params['rewrite'] = (!$alias) ? $category->link_rewrite : $alias;
466. if ($dispatcher->hasKeyword($rule, $idLang, 'meta_keywords', $idShop)) {
467. $category = $this->getCategoryObject($category, $idLang);
468. $params['meta_keywords'] = Tools::str2url($category->getFieldByLang('meta_keywords'));
182. $dest_lang_id = Language::getLanguages(true, $id_shop, true)[0];
183.
184. switch ($resource_type) {
185. case 'category':
186. $category = new Category((int)Tools::getValue('id_category'));
187. $link = $this->context->link->getCategoryLink((int)$category->id, null, (int)$dest_lang_id, null, (int)$id_shop);
188. break;
189. case 'product':
190. $product = new Product((int)Tools::getValue('id_product'));
191. $link = $this->context->link->getProductLink((int)$product->id, null, null, null, (int)$dest_lang_id, (int)$id_shop);
192. break;
239.
240. foreach ($shop_list as $hreflang => $store_id) {
241. if (isset($stores[$store_id])) {
242. $alternativeMultistoreLangsUrl[$hreflang] = [
243. 'store_id' => $store_id,
244. 'url' => $this->getLink($resource_type, $stores[$store_id]['id_shop']),
245. ];
246. }
247. }
248. }
249.
253. public function getTemplateVarUrls()
254. {
255. $urls = parent::getTemplateVarUrls();
256.
257. if (!is_null($urls)) {
258. $urls['alternative_multistore_langs'] = $this->getAlternativeMultistoreLangsUrl();
259. }
260.
261. $this->urls = $urls;
262.
263. return $this->urls;
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,
112. * date: 2023-03-06 16:37:47
113. * version: 1.0.0
114. */
115. protected function assignGeneralPurposeVariables()
116. {
117. parent::assignGeneralPurposeVariables();
118.
119. $result = Db::getInstance()->executeS('SELECT `ps_shop_url`.id_shop, `ps_shop_url`.domain, `ps_shop_url`.virtual_uri, `ps_lang_shop`.id_lang, `ps_lang`.name FROM `ps_shop_url` LEFT JOIN `ps_lang_shop` ON `ps_shop_url`.id_shop = `ps_lang_shop`.id_shop LEFT JOIN `ps_lang` ON `ps_lang_shop`.id_lang = `ps_lang`.id_lang WHERE `ps_shop_url`.active = 1 AND `ps_lang`.active = 1 AND `ps_shop_url`.id_shop IN (SELECT id_shop FROM `ps_shop` WHERE active = 1)');
120. $shop_urls = [];
121.
122. //recupero tutte le virtual uri
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. }
263. return $this->urls;
264. }
265.
266. public function initContent()
267. {
268. parent::initContent();
269.
270. //svuoto carrello al cambio store
271. $current_cart = $this->context->cart;
272. if (!is_null($current_cart->id)) {
273. if ($current_cart->id_shop != $this->context->shop->id) {
134. /**
135. * {@inheritdoc}
136. */
137. public function initContent()
138. {
139. parent::initContent();
140.
141. if (
142. Validate::isLoadedObject($this->category)
143. && $this->category->active
144. && $this->category->checkAccess($this->context->customer->id)
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. }
24. * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
25. */
26.
27.
28. require dirname(__FILE__).'/config/config.inc.php';
29. Dispatcher::getInstance()->dispatch();