views:

631

answers:

3

Currently I’m having some difficulties with using new Magento's soap v2 from c# interface.

With php i was able to do something like this:

$params["created_at"]["from"] = date("Y-m-d H:i:s",Functions::convert_time($dataDa));
$params["created_at"]["to"] = date("Y-m-d H:i:s",Functions::convert_time($dataA));
MageInterface::getSingleton()->shipmentList($params);

In this mode i was able to find list of orders which were created from $dataDa to $dataA without problems. With c# however it seems that only the last one of the selectors work.

My code:

var cpf = new complexFilter[2];
cpf[0] = new complexFilter
                    {
                        key = "created_at",
                        value = new associativeEntity
                        {
                            key = "to",
                            value = uxDataA.DateTime.ToString("yy-MM-dd HH:mm:ss")
                        }
                    });
cpf[1] = new complexFilter
                    {
                        key = "created_at",
                        value = new associativeEntity
                        {
                            key = "from",
                            value = uxDataDa.DateTime.ToString("yy-MM-dd HH:mm:ss")
                        }
                    });
var filters = new filters();
filters.complex_filter = cpf;
var risultato = mage.salesOrderList(sessionKey, filters);

In this mode only created_at->from criteria is taken in consideration (it's like second complex filter override previous one with the same key). Ideas?

Thanks in advance.

A: 

Solved, there was a bug (or the feature?) in mage\sales\order\api\v2.php

Alekc
A: 

What was the bug and how did you solve it?

http://www.magentocommerce.com/bug-tracking/issue?issue=8073
Alekc
A: 

Hi, i think this is write but I am confuse in ‘OR’, ‘AND’ condition. Can you please explain I you know about it.

If I want to write sql like

“SELECT * from customer WHERE created_at = ‘2010-06-10 00:42:56’ AND updated_at = ‘2010-06-10 00:42:56’”

Hardik