Я работаю с eBay API, и мне нужно сделать foreach для этого
OrderArray.Order
.TransactionArray.Transaction
.MultiLegShippingDetails
.SellerShipmentToLogisticsProvider
.ShipToAddress.AddressID
Это то, что у меня есть для TransactionArray
$transactions = $order->TransactionArray;
if($transactions){
foreach($transactions->Transaction as $transaction){
echo "Item ID -> " . $transaction->Item->ItemID . "\n";
$variations = $transaction->Variation;
echo "Item URL -> " . $variations->VariationViewItemURL . "\n";
foreach($variations as $variation){
foreach($variation as $vspecs ){
foreach($vspecs as $nvl){
echo "".$nvl->Name.": ";
echo "".$nvl->Value."\n";
}//foreach vspecs as nvl
}//foreach variation as vspecs
}//foreach variations as variation
}//foreach transactions as transaction
}//if transactions
, и это моя попыткавосстановить то, что я сделал пару дней назад для Вариаций, но без всякой удачи.
$MultiLegShippingDetails = $transaction->MultiLegShippingDetails;
foreach($MultiLegShippingDetails as $LegShippingDetails){
$LegShippingDetails->SellerShipmentToLogisticsProvider;
foreach($LegShippingDetails as $ShipmentToLogisticsProvider){
$ShipmentToLogisticsProvider->ShipToAddress;
foreach($ShipmentToLogisticsProvider as $iAddress){
echo "".$iAddress->ReferenceID."";
}
}
}
Где я делаю ошибку?