Incorrect DATETIME value: '0000-00-00 00:00:00'
SELECT *, ( IF (`id_group` = 1, 2, 0) + IF (`id_country` = 17, 4, 0) + IF (`id_currency` = 1, 8, 0) + IF (`id_shop` = 1, 16, 0) + IF (`id_customer` = 0, 32, 0)) AS `score`
FROM `ps_specific_price`
WHERE
`id_shop` IN (0, 1) AND
`id_currency` IN (0, 1) AND
`id_country` IN (0, 17) AND
`id_group` IN (0, 1) AND `id_product` = 0 AND `id_customer` = 0 AND `id_product_attribute` = 0 AND `id_cart` = 0 AND (`from` = '0000-00-00 00:00:00' OR '2025-05-09 00:00:00' >= `from`) AND (`to` = '0000-00-00 00:00:00' OR '2025-05-09 00:00:00' <= `to`)
AND IF(`from_quantity` > 1, `from_quantity`, 0) <= 1 ORDER BY `id_product_attribute` DESC, `from_quantity` DESC, `id_specific_price_rule` ASC, `score` DESC, `to` DESC, `from` DESC LIMIT 1
at line 791 in file classes/db/Db.php
786. if ($webservice_call && $errno) {
787. $dbg = debug_backtrace();
788. WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
789. } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {
790. if ($sql) {
791. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
792. }
793.
794. throw new PrestaShopDatabaseException($this->getMsgError());
795. }
796. }
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 *, ( IF (`id_group` = 1, 2, 0) + IF (`id_country` = 17, 4, 0) + IF (`id_currency` = 1, 8, 0) + IF (`id_shop` = 1, 16, 0) + IF (`id_customer` = 0, 32, 0)) AS `score` FROM `ps_specific_price` WHERE `id_shop` IN (0, 1) AND `id_currency` IN (0, 1) AND `id_country` IN (0, 17) AND `id_group` IN (0, 1) AND `id_product` = 0 AND `id_customer` = 0 AND `id_product_attribute` = 0 AND `id_cart` = 0 AND (`from` = '0000-00-00 00:00:00' OR '2025-05-09 00:00:00' >= `from`) AND (`to` = '0000-00-00 00:00:00' OR '2025-05-09 00:00:00' 1, `from_quantity`, 0)
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 *, ( IF (`id_group` = 1, 2, 0) + IF (`id_country` = 17, 4, 0) + IF (`id_currency` = 1, 8, 0) + IF (`id_shop` = 1, 16, 0) + IF (`id_customer` = 0, 32, 0)) AS `score` FROM `ps_specific_price` WHERE `id_shop` IN (0, 1) AND `id_currency` IN (0, 1) AND `id_country` IN (0, 17) AND `id_group` IN (0, 1) AND `id_product` = 0 AND `id_customer` = 0 AND `id_product_attribute` = 0 AND `id_cart` = 0 AND (`from` = '0000-00-00 00:00:00' OR '2025-05-09 00:00:00' >= `from`) AND (`to` = '0000-00-00 00:00:00' OR '2025-05-09 00:00:00' 1, `from_quantity`, 0)
357. AND IF(`from_quantity` > 1, `from_quantity`, 0) <= ';
358.
359. $query .= (Configuration::get('PS_QTY_DISCOUNT_ON_COMBINATION') || !$id_cart || !$real_quantity) ? (int)$quantity : max(1, (int)$real_quantity);
360. $query .= ' ORDER BY `id_product_attribute` DESC, `from_quantity` DESC, `id_specific_price_rule` ASC, `score` DESC, `to` DESC, `from` DESC';
361.
362. SpecificPrice::$_specificPriceCache[$key] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($query);
363. }
364. return SpecificPrice::$_specificPriceCache[$key];
365. }
366.
367. public static function setPriorities($priorities)
Argument [0] SELECT *, ( IF (`id_group` = 1, 2, 0) + IF (`id_country` = 17, 4, 0) + IF (`id_currency` = 1, 8, 0) + IF (`id_shop` = 1, 16, 0) + IF (`id_customer` = 0, 32, 0)) AS `score` FROM `ps_specific_price` WHERE `id_shop` IN (0, 1) AND `id_currency` IN (0, 1) AND `id_country` IN (0, 17) AND `id_group` IN (0, 1) AND `id_product` = 0 AND `id_customer` = 0 AND `id_product_attribute` = 0 AND `id_cart` = 0 AND (`from` = '0000-00-00 00:00:00' OR '2025-05-09 00:00:00' >= `from`) AND (`to` = '0000-00-00 00:00:00' OR '2025-05-09 00:00:00' 1, `from_quantity`, 0)
2971. $id_group,
2972. $quantity,
2973. $id_product_attribute,
2974. $id_customer,
2975. $id_cart,
2976. $real_quantity
2977. );
2978.
2979. if (isset(self::$_prices[$cache_id])) {
2980. /* Affect reference before returning cache */
2981. if (isset($specific_price['price']) && $specific_price['price'] > 0) {
Argument [0] 13 Argument [1] 1 Argument [2] 1 Argument [3] 17 Argument [4] 1 Argument [5] 1 Argument [6] 0 Argument [7] Argument [8] Argument [9] 0
2896. $specific_price_output,
2897. $use_group_reduction,
2898. $id_customer,
2899. $use_customer_price,
2900. $id_cart,
2901. $cart_quantity
2902. );
2903.
2904. return $return;
2905. }
2906.
Argument [0] 1 Argument [1] 13 Argument [2] 0 Argument [3] 17 Argument [4] 0 Argument [5] 0 Argument [6] 1 Argument [7] 1 Argument [8] 1 Argument [9] Argument [10] 6 Argument [11] Argument [12] 1 Argument [13] 1 Argument [14] 0 Argument [15] 1 Argument [16] Argument [17] 1 Argument [18] Argument [19] 0
494. $this->new = $this->isNew();
495.
496. // Keep base price
497. $this->base_price = $this->price;
498.
499. $this->price = Product::getPriceStatic((int)$this->id, false, null, 6, null, false, true, 1, false, null, null, null, $this->specificPrice);
500. $this->unit_price = ($this->unit_price_ratio != 0 ? $this->price / $this->unit_price_ratio : 0);
501. if ($this->id) {
502. $this->tags = Tag::getProductTags((int)$this->id);
503. }
504.
Argument [0] 13 Argument [1] Argument [2] Argument [3] 6 Argument [4] Argument [5] Argument [6] 1 Argument [7] 1 Argument [8] Argument [9] Argument [10] Argument [11] Argument [12] 0
80. public function init()
81. {
82. parent::init();
83.
84. if ($id_product = (int)Tools::getValue('id_product')) {
85. $this->product = new Product($id_product, true, $this->context->language->id, $this->context->shop->id);
86. }
87.
88. if (!Validate::isLoadedObject($this->product)) {
89. header('HTTP/1.1 404 Not Found');
90. header('Status: 404 Not Found');
Argument [0] 13 Argument [1] 1 Argument [2] 3 Argument [3] 1
165. /**
166. * Starts the controller process (this method should not be overridden!)
167. */
168. public function run()
169. {
170. $this->init();
171. if ($this->checkAccess()) {
172. // setMedia MUST be called before postProcess
173. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
174. $this->setMedia();
175. }
362. if (isset($params_hook_action_dispatcher)) {
363. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
364. }
365.
366. // Running controller
367. $controller->run();
368. } catch (PrestaShopException $e) {
369. $e->displayMessage();
370. }
371. }
372.
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();