I am trying to read the Magento product list through the SOAP API (V2) and try to do any / any type of pagination.
A simple scenario:
var filters = new filters(); var products = catalogProductList(out pe, Connection.Session, filters, null);
This will crash Magento using: "Allowed memory size of 1073741824 bytes exhausted (tried to allocate 72 bytes."
I tried to add pagination by pointing two complex filters to 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 is ignored.
I thought about reading the category tree and then about the assigned products, but there are many products that are not tied to any category or to several categories, so I either skip them or get them several times.
Is there a way to read the product list using some type of pagination so that I don't read the full list right away? (Note: memory expansion request is not really an option)
source share