Моя проблема, как я уже упоминал в заголовке. Я не могу найти решение, потому что я не знаю.
public function DetailedOrderList(array $searchData = Array()) {
$this->setUrl('https://api.n11.com/ws/OrderService.wsdl');
self::$_parameters['searchData'] = $searchData;
self::$_parameters['pagingData'] = ['itemsPerPage' => 5, 'currentPage' => 0];
return self::$_sclient->DetailedOrderList(self::$_parameters);
}
<?php
$DetailedOrderList= $n11->DetailedOrderList(
[
"productId"=>'',
"status"=> 'Approwed',
"buyerName"=> '',
"orderNumber"=> '',
"productSellerCode" =>'',
"recipient"=> '',
"sameDayDelivery"=> '',
"period"=>[
"startDate"=> '?',
"endDate"=> '?'
],
"sortForUpdateDate"=> ''
]
);
$say = Array(
Array($DetailedOrderList->orderList->order)
);
echo "<table border='1' cellpadding='5' cellspacing='0'>";
for($i = 0; $i < $say; $i++ )
{
echo "<tr>";
echo "<td><table border='1' cellpadding='5' cellspacing='0' width='100%'><tbody>";
echo "<tr><th>ID:</th><td>";
echo $DetailedOrderList->orderList->order[$i]->id;
echo "</td></tr>";
echo "<tr><th>Sipariş No:</th><td>";
echo $DetailedOrderList->orderList->order[$i]->orderNumber;
echo "</td></tr>";
echo "<tr>";
echo "<th>Ürün Adı:</th><td>";
echo $DetailedOrderList->orderList->order[$i]->orderItemList->orderItem->productName;
echo "</td></tr>";
echo "<tr><th>Sipariş Tarih:</th><td>";
echo $DetailedOrderList->orderList->order[$i]->createDate;
echo "</td></tr>"; echo "<tr><th>Sipariş Tutar:</th><td>";
echo $DetailedOrderList->orderList->order[$i]->totalAmount."TL";
echo "</td></tr>";
echo "</td></tr>";
echo "<tr>";
echo "<th>Ürün Detay:</th><td><a href='urundetay.php?id=".($DetailedOrderList->orderList->order[$i]->orderItemList->orderItem->productSellerCode)."'>";
echo $DetailedOrderList->orderList->order[$i]->orderItemList->orderItem->productName;
echo "</a> x ".$DetailedOrderList->orderList->order[$i]->orderItemList->orderItem->quantity."</td></tr>";
echo "<tr><th>Detaylar:</th><td colspan='2'>";
echo "<a href='siparisdetay.php?sip=".($DetailedOrderList->orderList->order[$i]->id)."'>Sipariş Detayı</a>";
echo "</td></tr>";
echo "<tr><th>Kargo:</th><td colspan='2'>";
echo $DetailedOrderList->orderList->order[$i]->orderItemList->orderItem->shipmentInfo->shipmentCompany->name;
echo "</td></tr>";
echo "</tbody></table></td>";
}
echo "</table>";
Примечание: попытка получить свойство необъекта в C: \ wamp64 \ www \ nx \ x.php в строке 49
echo $ DetailOrderList-> orderList-> order [$ i] -> orderItemList-> orderItem-> productName;
Нет проблем при наличии одного товара. Но я получаю эту ошибку, когда есть несколько продуктов.
Я не могу найти решение, потому что я не знаю php.