Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [ebay api] pobranie tytułu aukcji
tomeknh
post 21.01.2017, 00:23:43
Post #1





Grupa: Zarejestrowani
Postów: 90
Pomógł: 0
Dołączył: 2.12.2007

Ostrzeżenie: (0%)
-----


Witam, korzystam z klasy ebaya do pobrania danych zamówień

Jak wg. poniższego kodu pobrać dodatkowo tytuł aukcji z której został zamówiony przedmiot?

Proszę o pomoc


poniżej kod, który listuje dane:

  1. <?php
  2. /* Š 2013 eBay Inc., All Rights Reserved */
  3. /* Licensed under CDDL 1.0 - <a href="http://opensource.org/licenses/cddl1.php" target="_blank">http://opensource.org/licenses/cddl1.php</a> */
  4. header("Content-Type: text/plain; charset=UTF-8");
  5. //$response = simplexml_import_dom($responseDoc);
  6. if ($entries == 0) {
  7. echo "Sorry No entries found in the Time period requested. Change CreateTimeFrom/CreateTimeTo and Try again";
  8. } else {
  9. $orders = $response->OrderArray->Order;
  10. if ($orders != null) {
  11. foreach ($orders as $order) {
  12. echo "Order Information:\n";
  13. echo "OrderID ->" . $order->OrderID . "\n";
  14. echo "Order -> Status:" . $orderStatus = $order->OrderStatus . "\n";
  15.  
  16. //if the order is completed, print details
  17. if ($orderStatus) {
  18.  
  19. // get the amount paid
  20. $AmountPaid = $order->AmountPaid;
  21. $AmountPaidAttr = $AmountPaid->attributes();
  22. echo "AmountPaid : " . $AmountPaid . " " .$AmountPaidAttr["currencyID"]. "\n";
  23.  
  24. // get the payment method
  25. if($order->PaymentMethod)
  26. echo "PaymentMethod : " . $order->PaymentMethod . "\n";
  27.  
  28.  
  29. // get the checkout message left by the buyer, if any
  30. if ($order->BuyerCheckoutMessage) {
  31. echo "BuyerCheckoutMsg : " . $order->BuyerCheckoutMessage . "\n";
  32. }
  33.  
  34. // get the sales tax, if any
  35. $SalesTaxAmount = $order->ShippingDetails->SalesTax->SalesTaxAmount;
  36. $SalesTaxAmountAttr = $SalesTaxAmount->attributes();
  37. echo "SalesTaxAmount : " . $SalesTaxAmount. " " .$SalesTaxAmountAttr["currencyID"] . "\n";
  38.  
  39. // get the external transaction information - if payment is made via PayPal, then this is the PayPal transaction info
  40. $externalTransaction = $order->ExternalTransaction;
  41. if ($externalTransaction) {
  42. echo "ExternalTransactionID : " . $externalTransaction->ExternalTransactionID . "\n";
  43. echo "ExternalTransactionTime : " . $externalTransaction->ExternalTransactionTime . "\n";
  44. $externalTransactionFeeAttr = $externalTransaction->FeeOrCreditAmount->attributes();
  45. echo "ExternalFeeOrCreditAmount : " . $externalTransaction->FeeOrCreditAmount . " " .$externalTransactionFeeAttr["currencyID"] . " \n";
  46. echo "ExternalTransactionPaymentOrRefundAmount : " . $externalTransaction->PaymentOrRefundAmount . " " .$externalTransactionFeeAttr["currencyID"] . " \n";
  47. }
  48.  
  49. // get the shipping service selected by the buyer
  50. $ShippingServiceSelected = $order->ShippingServiceSelected;
  51. if($ShippingServiceSelected){
  52. echo "Shipping Service Selected : " . $ShippingServiceSelected->ShippingService . " \n";
  53. $ShippingCostAttr = $ShippingServiceSelected->ShippingServiceCost->attributes();
  54. echo "ShippingServiceCost : " . $ShippingServiceSelected->ShippingServiceCost . " " . $ShippingCostAttr["currencyID"] . "\n";
  55. }
  56.  
  57. // get the buyer's shipping address
  58. $shippingAddress = $order->ShippingAddress;
  59. $address = $shippingAddress->Name . ",\n";
  60. if ($shippingAddress->Street1 != null) {
  61. $address .= $shippingAddress->Street1 . ",";
  62. }
  63. if ($shippingAddress->Street2 != null) {
  64. $address .= $shippingAddress->Street2 . "\n";
  65. }
  66. if ($shippingAddress->CityName != null) {
  67. $address .=
  68. $shippingAddress->CityName . ",\n";
  69. }
  70. if ($shippingAddress->StateOrProvince != null) {
  71. $address .=
  72. $shippingAddress->StateOrProvince . "-";
  73. }
  74. if ($shippingAddress->PostalCode != null) {
  75. $address .=
  76. $shippingAddress->PostalCode . ",\n";
  77. }
  78. if ($shippingAddress->CountryName != null) {
  79. $address .=
  80. $shippingAddress->CountryName . ".\n";
  81. }
  82. if ($shippingAddress->Phone != null) {
  83. $address .= $shippingAddress->Phone . "\n";
  84. }
  85. if($address){
  86. echo "Shipping Address : " . $address;
  87. }else echo "Shipping Address: Null" . "\n";
  88.  
  89. $transactions = $order->TransactionArray;
  90. if ($transactions) {
  91. echo "Transaction Array \n";
  92. // iterate through each transaction for the order
  93. foreach ($transactions->Transaction as $transaction) {
  94. // get the OrderLineItemID, Quantity, buyer's email and SKU
  95.  
  96. echo "OrderLineItemID : " . $transaction->OrderLineItemID . "\n";
  97. echo "QuantityPurchased : " . $transaction->QuantityPurchased . "\n";
  98. echo "Buyer Email : " . $transaction->Buyer->Email . "\n";
  99. $SKU = $transaction->Item->SKU;
  100. if ($SKU) {
  101. echo "Transaction -> SKU :" . $SKU ."\n";
  102. }
  103.  
  104. // if the item is listed with variations, get the variation SKU
  105. $VariationSKU = $transaction->Variation->SKU;
  106. if ($VariationSKU != null) {
  107. echo "Variation SKU : " . $VariationSKU. "\n";
  108. }
  109. echo "TransactionID: " . $transaction->TransactionID . "\n";
  110. $transactionPriceAttr = $transaction->TransactionPrice->attributes();
  111. echo "TransactionPrice : " . $transaction->TransactionPrice . " " . $transactionPriceAttr["currencyID"] . "\n";
  112. echo "Platform : " . $transaction->Platform . "\n";
  113. }
  114. }
  115. }//end if
  116. echo "---------------------------------------------------- \n";
  117. }
  118. }else{
  119. echo "No Order Found";
  120. }
  121. }
  122. ?>
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 19.04.2024 - 12:47