为了商店订购某些信息放在客户从WooCommerce REST API,以通过精确的在线仪表盘REST API。我已经将PHP Client库用于Exact Online。
尽管存在问题-将数据存储到Exact Online之后,无法访问数组中的特定字段。具体来说,当使用
/api/v1/{division}/bulk/CRM/Accounts?
$filter=ID eq Email eq'nishanth@gmail.com'&$select=ID,Email
或者
$url = "https://start.exactonline.de/api/v1/" + mandant.number + "/crm/Accounts?
$filter=Email eq '" + orderitem.email + "'&$select=ID,Code";
在这里,您将获得以下代码
$customer = [
'address' => 'No.22/N, 91 Cross, XYZ Street, ABC Road',
'address2' => 'DEF',
'city' => 'GHI',
'customerid' => '999',
'country' => 'DE',
'name' => 'Nishanth',
'zipcode' => '123456'
];
// Create a new account
$account->AddressLine1 = $customer['address'];
$account->AddressLine2 = $customer['address2'];
$account->City = $customer['city'];
$account->Code = $customer['customerid'];
$account->Country = $customer['country'];
$account->IsSales = 'true';
$account->Name = $customer['name'];
$account->Postcode = $customer['zipcode'];
$account->Email = 'nishanth@gmail.com';
$account->Status = 'C';
$account->save();
这是使用电子邮件ID过滤后获得的结果
尽管使用以下内置函数进行了调用:
$Accounts->filter("Email eq 'nishanth@gmail.com'")[0]->findWithSelect('ID');
$checkAccount = $Accounts->filter("Email eq 'nishanth@gmail.com'");
$checkAccount[0]->find('ID');
$checkAccount[0]->findWithSelect('Code');
上面内置的库导致
[attributes:protected] => Array
(
)
我应该如何从数组访问特定属性?
同样,CurrentDivision通过诸如$getCurrentDivision->findWithSelect('CurrentDivision');或的调用也可以轻松地从库中检索。$getDivision->CurrentDivision;
检索数组后,为什么同一个函数不能正常工作?
哈士奇WWW
Cats萌萌