I am using Magja, java soap api for magento. I want to filter orders by order id or any other property, also want to sort orders by ASC or DESC. But my current code is not working for that, I need help to sort this out, thanks in advance for any help. My current code for filter is below
TestOrder to = new TestOrder();
OrderFilter filter = new OrderFilter();
filter.getItems().add(new OrderFilterItem("state", "=", "new"));
filter.getItems().add(new OrderFilterItem("store_id", "=", "3"));
filter.getItems().add(new OrderFilterItem("order_id", "gt","300000065"));
List<Order> list = to.service.list(filter);
Note: filters by state and store_id are working fine. But order_id/increment_id filters(gt, lt, eq etc) are not working at all.
Best Answer
First of all calling this is wrong.
order_id
does not exist. it isentity_id
. And the value300000065
looks like anincrement_id
value, not a table PK id.This should work (I have no idea if you should use
gt
or>
try them both).As for filtering by the
increment_id
maybe you should take into account that the field is not numerical. it isvarchar(50)
. Maybe this affects your filtering.