On Magento 1.7 SOAP APIv2, i\'m looking for a way to get a date range to retrieve information from the SOAP API.
$complexFilter = new filters();
$complexFilt
Seems to be a bug in mage\sales\order\api\v2.php
Matlock provides a possible solution for this in the comment section of this thread: http://www.magentocommerce.com/bug-tracking/issue?issue=8073
After googling a lot more i finally come to some explanation.
Obviously, the implementation of the complex filters does not allow more then one attribute to be present. This is also what I noticed during my tests: only the last attribute used influences the result. I therefore need to find another way of doing what I want. It's somehow sad to see that Magento does not provide an easy way to do this with ther SOAP API.
The final approach I used now is to determine a date that comes closest to what I want. Then just iterate through the results that that are in the daterange I want. This way (at least with our product data), I keep the load and results to a minumum and still get the desired products.
edit seems like the original link is down and the site doesn't exist anymore. The text above should be enough information. The blog merely showed some code examples with the faulty implementation.
I found a better way looking at the code in Magento! Luckily it IS CASE SENSITIVE, so:
$complexFilter->complex_filter = array(
array(
'key' => 'CREATED_AT',
'value' => array('key' => 'from', 'value' => '2012-12-17 00:00:00')
),
array(
'key' => 'created_at',
'value' => array('key' => 'to', 'value' => '2013-01-21 12:02:02')
),
);
does the trick pretty neatly!