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 = 1824) 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 = 1824) 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 = 1824) 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 = 1824) 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] 1824
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.
385. [],
386. 'Shop.Notifications.Error'
387. );
388. }
389.
390. $product = new Product($this->id_product, true, $this->context->language->id);
391. if (!$product->id || !$product->active || !$product->checkAccess($this->context->cart->id_customer)) {
392. $this->{$ErrorKey}[] = $this->trans(
393. 'This product (%product%) is no longer available.',
394. ['%product%' => $product->name],
395. 'Shop.Notifications.Error'
Argument [0] 1824 Argument [1] 1 Argument [2] 1
237. if (!Connection::isBot()
238. && !$this->errors
239. && !($this->context->customer->isLogged() && !$this->isTokenValid())
240. ) {
241. if (Tools::getIsset('add') || Tools::getIsset('update')) {
242. $this->processChangeProductInCart();
243. } elseif (Tools::getIsset('delete')) {
244. $this->processDeleteProductInCart();
245. } elseif (CartRule::isFeatureActive()) {
246. if (Tools::getIsset('addDiscount')) {
247. if (!($code = trim(Tools::getValue('discount_name')))) {
226. ]));
227. }
228.
229. public function postProcess()
230. {
231. $this->updateCart();
232. }
233.
234. protected function updateCart()
235. {
236. // Update the cart ONLY if it's not a bot, in order to avoid ghost carts
303. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
304. $this->setMedia();
305. }
306.
307. // postProcess handles ajaxProcess
308. $this->postProcess();
309.
310. if (!empty($this->redirect_after)) {
311. $this->redirect();
312. }
313.
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();