问题在亚马逊API中获取订单详细信息

时间:2017-05-24 09:58:23

标签: web-services api amazon-web-services amazon

我无法获取ListOrderSample.php文件中的所有正确的订单详细信息..在某些订单日期错误或某些订单地址丢失。请给我一个解决方案。我附上了我正在使用的代码

   $i=0;
  $prevclr="";
if(is_object($x3)){
foreach ($x3->childNodes AS $item) {
      $x4 = $x3->childNodes->item(0);
      $i++;
      $OrdID = $item->childNodes->item(0)->nodeValue;
      $Purchase_dt = $item->childNodes->item(1)->nodeValue;
      $Purchase_dtt = $Purchase_dt;
      $Purchase_dtt_display = "";
      if($Purchase_dtt!=NULL){
        $timestamp = strtotime($Purchase_dtt);
         $Purchase_dtt_display = date('m/d/Y',$timestamp);
      }

      $Ord_status = $item->childNodes->item(3)->nodeValue;
      if($Ord_status == "Canceled" || $Ord_status == "Pending"){
       $ship_add_str = "-";
       $Ord_tot_str = "-";
       $Ord_typp = $item->childNodes->item(12)->nodeValue;
         $pay_mthod = "-";
       $buyerstr="-";
      }
      else{
      $Shipp_add = $item->childNodes->item(7);
      $ship_add_str="";
      if(is_object($Shipp_add->childNodes->item(0))){
      $ship_add_str = $Shipp_add->childNodes->item(0)->nodeValue;
      }
      if(is_object($Shipp_add->childNodes->item(1))){
      $ship_add_str = $ship_add_str ."<br>".$Shipp_add->childNodes->item(1)->nodeValue;
      }
      if(is_object($Shipp_add->childNodes->item(2))){
        if($Shipp_add->childNodes->item(2)->nodeName == "City"){
          $ship_add_str = $ship_add_str ."<br>City: ".$Shipp_add->childNodes->item(2)->nodeValue;
        }
        else{
          $ship_add_str = $ship_add_str ."<br>".$Shipp_add->childNodes->item(2)->nodeValue;
        }
      }
      if(is_object($Shipp_add->childNodes->item(3))){
        if($Shipp_add->childNodes->item(3)->nodeName == "StateOrRegion"){
          $ship_add_str = $ship_add_str ."<br>State/Region: ".$Shipp_add->childNodes->item(3)->nodeValue;
        }
        else if($Shipp_add->childNodes->item(3)->nodeName == "City"){
          $ship_add_str = $ship_add_str ."<br>City: ".$Shipp_add->childNodes->item(3)->nodeValue;
        }
      }




      }

0 个答案:

没有答案