Hello,
I was trying to list only the products whose id is there in an array. Say productIds, a protected variable in my controller in my new module. So in my controller constructor, added following code :
$this->_where = 'a.id_product IN ('.implode(",", $this->productIds).')';
In the query, the condition was appended as below :
WHERE 1 a.id_product IN (1,2)
Due to the 1 after where I was getting the sql sytax error. I modified the getList function in file prestashop/classes/controller/AdminController.php that is to append 1 only if there is no condition. It worked fine then. Is this a bug or did I used it incorrectly?