SQLSTATE[42S22]: Column not found: 1054 Unknown column 'location' in 'field list'
at line 151 in file classes/db/DbPDO.php
146. protected function _query($sql)
147. {
148. try {
149. return $this->link->query($sql);
150. } catch (\PDOException $exception) {
151. throw new PrestaShopException($exception->getMessage(), (int) $exception->getCode(), $exception);
152. }
153. }
154.
155. /**
156. * Returns the next row from the result set.
372. {
373. if ($sql instanceof DbQuery) {
374. $sql = $sql->build();
375. }
376.
377. $this->result = $this->_query($sql);
378.
379. if (!$this->result && $this->getNumberError() == 2006) {
380. $this->connect();
381. $this->result = $this->_query($sql);
382. }
Argument [0] SELECT location FROM `jk_stock_available` WHERE (id_product = 1278) AND (id_product_attribute = 0) AND (id_shop = 1) AND (id_shop_group = 0) LIMIT 1
659.
660. return $result;
661. }
662. }
663.
664. $this->result = $this->query($sql);
665. if (!$this->result) {
666. $result = false;
667. } else {
668. $result = $this->nextRow($this->result);
669. }
Argument [0] SELECT location FROM `jk_stock_available` WHERE (id_product = 1278) AND (id_product_attribute = 0) AND (id_shop = 1) AND (id_shop_group = 0) LIMIT 1
693. {
694. if ($sql instanceof DbQuery) {
695. $sql = $sql->build();
696. }
697.
698. $result = $this->getRow($sql, $use_cache);
699. if (false === $result) {
700. return false;
701. }
702.
703. return array_shift($result);
Argument [0] SELECT location FROM `jk_stock_available` WHERE (id_product = 1278) AND (id_product_attribute = 0) AND (id_shop = 1) AND (id_shop_group = 0) LIMIT 1 Argument [1] 1
801. $query->where('id_product = ' . $id_product);
802. $query->where('id_product_attribute = ' . $id_product_attribute);
803.
804. $query = StockAvailable::addSqlShopRestriction($query, $id_shop);
805.
806. return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query);
807. }
808.
809. /**
810. * Add an sql restriction for shops fields - specific to StockAvailable.
811. *
Argument [0] SELECT location FROM `jk_stock_available` WHERE (id_product = 1278) AND (id_product_attribute = 0) AND (id_shop = 1) AND (id_shop_group = 0)
7845.
7846. // Default product quantity is available quantity to sell in current shop
7847. $this->quantity = StockAvailable::getQuantityAvailableByProduct($this->id, 0);
7848. $this->out_of_stock = StockAvailable::outOfStock($this->id);
7849. $this->depends_on_stock = StockAvailable::dependsOnStock($this->id);
7850. $this->location = StockAvailable::getLocation($this->id) ?: '';
7851.
7852. if (Context::getContext()->shop->getContext() == Shop::CONTEXT_GROUP && Context::getContext()->shop->getContextShopGroup()->share_stock == 1) {
7853. $this->advanced_stock_management = $this->useAdvancedStockManagement();
7854. }
7855. }
Argument [0] 1278
746. $this->base_price = $this->price;
747.
748. $this->price = Product::getPriceStatic((int) $this->id, false, null, 6, null, false, true, 1, false, null, null, null, $this->specificPrice);
749. $this->tags = Tag::getProductTags((int) $this->id);
750.
751. $this->loadStockData();
752. }
753.
754. $ecotaxEnabled = (bool) Configuration::get('PS_USE_ECOTAX');
755. $this->fillUnitRatio($ecotaxEnabled);
756.
141. $this->setPreviewMode();
142. }
143.
144. // Try to load product object, otherwise immediately redirect to 404
145. if ($this->id_product) {
146. $this->product = new Product($this->id_product, true, $this->context->language->id, $this->context->shop->id);
147. }
148. if (!Validate::isLoadedObject($this->product)) {
149. header('HTTP/1.1 404 Not Found');
150. header('Status: 404 Not Found');
151. $this->errors[] = $this->trans('This product is no longer available.', [], 'Shop.Notifications.Error');
Argument [0] 1278 Argument [1] 1 Argument [2] 1 Argument [3] 1
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. * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
24. * International Registered Trademark & Property of PrestaShop SA
25. */
26.
27. require(dirname(__FILE__).'/config/config.inc.php');
28. Dispatcher::getInstance()->dispatch();