[PrestaShopDatabaseException]

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 ')))) AND date_from < now() and date_to > now() and active=1 and quantity > quan' at line 5<br /><br /><pre>Select id_cart_rule, date_format(date_from, "%d/%m") as d1, date_format(date_to, "%d/%m") as d2,format(minimum_amount,2) as min, free_shipping, reduction_percent, reduction_amount from aa_cart_rule where id_cart_rule IN ( Select id_cart_rule from aa_cart_rule_product_rule_group where quantity>0 and id_product_rule_group IN ( Select id_product_rule_group from aa_cart_rule_product_rule where type="categories" and id_product_rule IN ( Select id_product_rule from aa_cart_rule_product_rule_value where id_item IN (SELECT id_category from aa_category_product WHERE id_product = )))) AND date_from < now() and date_to > now() and active=1 and quantity > quantity_per_user and code =""</pre>
at line 782 in file classes/db/Db.php

777.         if ($webservice_call && $errno) {
778.             $dbg = debug_backtrace();
779.             WebserviceRequest::getInstance()->setError(500, '[SQL Error] ' . $this->getMsgError() . '. From ' . (isset($dbg[3]['class']) ? $dbg[3]['class'] : '') . '->' . $dbg[3]['function'] . '() Query was : ' . $sql, 97);
780.         } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {
781.             if ($sql) {
782.                 throw new PrestaShopDatabaseException($this->getMsgError() . '<br /><br /><pre>' . $sql . '</pre>');
783.             }
784. 
785.             throw new PrestaShopDatabaseException($this->getMsgError());
786.         }
787.     }