You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 1SELECT regional_stock, supplier_stock FROM dc_custom_stock WHERE id_product = LIMIT 1
at line 792 in file classes/db/Db.php
787. $dbg = debug_backtrace();
788. PrestaShopLogger::addLog('[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql,1,97);
789. WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
790. } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {
791. if ($sql) {
792. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
793. }
794.
795. throw new PrestaShopDatabaseException($this->getMsgError());
796. }
797. }
420. $this->result = $this->_query($sql);
421. }
422. }
423.
424. if (_PS_DEBUG_SQL_) {
425. $this->displayError($sql);
426. }
427.
428. return $this->result;
429. }
430.
Argument [0] SELECT regional_stock, supplier_stock FROM dc_custom_stock WHERE id_product = LIMIT 1
685. $this->last_cached = true;
686. return $result;
687. }
688. }
689.
690. $this->result = $this->query($sql);
691. if (!$this->result) {
692. $result = false;
693. } else {
694. $result = $this->nextRow($this->result);
695. }
Argument [0] SELECT regional_stock, supplier_stock FROM dc_custom_stock WHERE id_product = LIMIT 1
36. * @return array
37. */
38. public static function getCustomStock($id_product){
39.
40. if(!array_key_exists($id_product,self::$customStockCache)){
41. $customStock = Db::getInstance()->getRow('SELECT regional_stock, supplier_stock FROM '._DB_PREFIX_.'custom_stock WHERE id_product = '. PSQL($id_product));
42. self::$customStockCache[$id_product] = !empty($customStock)? $customStock : array('regional_stock'=>0,'supplier_stock'=>0);
43. }
44.
45. return self::$customStockCache[$id_product];
46. }
Argument [0] SELECT regional_stock, supplier_stock FROM dc_custom_stock WHERE id_product = LIMIT 1
8. */
9. public function initContent()
10. {
11. parent::initContent();
12. $this->context->smarty->assign(array(
13. 'custom_stock' => CustomStock::getCustomStock($this->product->id))
14. );
15. }
16. }
Argument [0]
184. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
185. $this->initHeader();
186. }
187.
188. if ($this->viewAccess()) {
189. $this->initContent();
190. } else {
191. $this->errors[] = Tools::displayError('Access denied.');
192. }
193.
194. if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className))) {
370. if (isset($params_hook_action_dispatcher)) {
371. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
372. }
373.
374. // Running controller
375. $controller->run();
376. } catch (PrestaShopException $e) {
377. $e->displayMessage();
378. }
379. }
380.
23. * @license http://opensource.org/licenses/osl-3.0.php 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();