I'm trying to read the list of products from Magento over the SOAP API (V2) and try to do some/any type of pagination.
Simple scenario:
var filters = new filters();
var products = catalogProductList(out pe, Connection.Session, filters, null);
This crashes Magento with: "Allowed memory size of 1073741824 bytes exhausted (tried to allocate 72 bytes."
I've tried to add pagination by specifying two complex filters on the product_id
:
filters.complex_filter = new complexFilter[]
{
new complexFilter()
{
key = "product_id",
value = new associativeEntity()
{
key = "gt",
value = "400"
}
},
new complexFilter()
{
key = "product_id",
value = new associativeEntity()
{
key = "lt",
value = "1000"
}
}
};
However in this scenario only the second filter is applied, the first one is ignored.
I was thinking of reading the category tree and then the assigned products but there are lots of products that are not assigned to any category or to multiple categories so I'll either miss them or get them multiple times.
Is there a way to read the products list using some type of pagination so I don't read the complete list at once? (Note: Requesting to increase memory is not really an option)