I'm communicating with Prestashop 1.5 Web Services for listing products and its filters are simple enough for basic cases, but what about multiple categories:
- Can I get a list of products that belong to category 1 AND 2?
- Can I get a list of products that belong to category 1 OR 2?
For your information here is Prestashop 1.5 Filter management process in
classes/webservice/WebserviceRequest
:From this we can notice that, unlike what the official documention says:
OR
condition with a pipe|
between values.BETWEEN
condition with a coma,
between values.LIKE %%
condition with a leading or/and a following percent%
of our value.>
condition with a>
in front of the value.<
condition with a<
in front of the value.!=
condition with a!
in front of the value.But I can't find a solution to simulate a
AND
condition. If you find one feel free to update this answer.You can easily override this method to add your own
AND
filter.For Prestashop 1.6 there's a little difference with the
!
condition:NOT IN()
by adding a pipe|
between each values with a leading!
.