Jump to content

reldridge

Members
  • Posts

    18
  • Joined

  • Last visited

reldridge's Achievements

Newbie

Newbie (1/5)

0

Reputation

1

Community Answers

  1. Ahh, Thanks requinix. I had to decode the json data to work within the foreach loop. // Encode XML to JSON $data = json_encode($xml); // Decode json for below array to create 'PUT' URLs $json_obj = json_decode($data, true); foreach ($json_obj['items'] as $item) { $url = "https://app.ecwid.com/api/v3/".urlencode($storeID)."/orders/".$item['orderNumber']."?token=".$myToken; echo "<pre>"; print_r($url); }
  2. Ecwid API - Updating Orders I am going to be creating a script to update order tracking numbers and shipping info from our Fulfillment house. Our fulfillment system will output an xml file of the order update. I have created the below script to grab the xml file and convert it to json as needed for Ecwid API. I am trying to figure out how to loop through the data and find all order numbers to create the url needed to update each order. <?php // The file data.xml contains an XML document with a root element // and at least an element /[root]/title. if (file_exists('data.xml')) { $xml = simplexml_load_file('data.xml'); print_r($xml); } else { exit('Failed to open data.xml.'); } $data = json_encode($xml); foreach ( $data->items as $item ) { $url = "https://app.ecwid.com/api/v3/".urlencode($storeID)."/orders/".$item->orderNumber."?token=".$myToken; echo $url; } ?> I am getting no output for $url, and wondering what i may be doing wrong. json output: {"total":"3","count":"3","offset":"0","limit":"100","items":{"item0":{"vendorOrderNumber":"0137074","subtotal":"45","total":"53.75","email":"zeke1157@comcast.net","externalTransactionId":"5U025416EA256042V","paymentModule":"PayPalStandard","paymentMethod":"PayPal \/ Credit Card","tax":"0","ipAddress":"73.147.160.160","couponDiscount":"0","paymentStatus":"PAID","paymentMessage":"Your order has been approved","fulfillmentStatus":"AWAITING_PROCESSING","orderNumber":"7074","refererUrl":"http:\/\/fvhardmerchandise.com\/shop.php","volumeDiscount":"0","customerId":"24555144","membershipBasedDiscount":"0","totalAndMembershipBasedDiscount":"0","discount":"0","usdTotal":"53.75","globalReferer":"http:\/\/www.google.com\/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&sqi=2&ved=0ahUKEwiD1pjVz8PKAhWEKB4KHV-vAgAQFggiMAE&url=http%3A%2F%2Ffvhardmerchandise.com%2Fshop.php&usg=AFQjCNEhJcEyH-Ff8WNN64j9RvvptSX1tw&bvm=bv.112454388,d.dmo","createDate":"2016-01-24 23:45:55 +0000","updateDate":"2016-01-24 23:46:40 +0000","createTimestamp":"1453679155","updateTimestamp":"1453679200","items":{"item0":{"id":"70650077","productId":"57278799","categoryId":"2455976","price":"45","productPrice":"45","sku":"00135","quantity":"1","shortDescription":"Now Capt. Marciano and the team of the Hard Merchandise are showing their winter camo colors! Shades of black, greys a...","tax":"0","shipping":"8.75","quantityInStock":"3","name":"New! - Winter Black Camo Hard Merchandise Hoodie","isShippingRequired":"1","weight":"2","trackQuantity":"1","fixedShippingRateOnly":{},"imageUrl":"https:\/\/dpbfm6h358sh7.cloudfront.net\/images\/1039296\/356535243.jpg","smallThumbnailUrl":"https:\/\/dpbfm6h358sh7.cloudfront.net\/images\/1039296\/356535250.jpg","fixedShippingRate":"0","digital":{},"productAvailable":"1","couponApplied":{},"selectedOptions":{"item0":{"name":"Size","value":"2XL","valuesArray":{"item0":"2XL"},"type":"CHOICE"}}}},"billingPerson":{"name":"James Bennett","companyName":{},"street":"276 Teaberry St.","city":"Princeton","countryCode":"US","countryName":"United States","postalCode":"24739","stateOrProvinceCode":"WV","stateOrProvinceName":"West Virginia","phone":"3044250086"},"shippingPerson":{"name":"James Bennett","companyName":{},"street":"276 Teaberry St.","city":"Princeton","countryCode":"US","countryName":"United States","postalCode":"24739","stateOrProvinceCode":"WV","stateOrProvinceName":"West Virginia","phone":"3044250086"},"shippingOption":{"shippingCarrierName":"U.S.P.S.","shippingMethodName":"U.S.P.S. Priority Mail 3-Day\u2122","shippingRate":"8.75","estimatedTransitTime":"1-3"},"handlingFee":{"name":"Handling Fee","value":"0","description":{}},"additionalInfo":{},"paymentParams":{},"hidden":{}},"item1":{"vendorOrderNumber":"0137073","subtotal":"22","total":"38.5","email":"cjuttner04@hotmail.com","externalTransactionId":"4UA97564429585111","paymentModule":"PayPalStandard","paymentMethod":"PayPal \/ Credit Card","tax":"0","ipAddress":"198.53.126.146","couponDiscount":"0","paymentStatus":"PAID","paymentMessage":"Your order has been approved","fulfillmentStatus":"AWAITING_PROCESSING","orderNumber":"7073","refererUrl":"http:\/\/fvhardmerchandise.com\/shop.php","volumeDiscount":"0","customerId":"24526391","membershipBasedDiscount":"0","totalAndMembershipBasedDiscount":"0","discount":"0","usdTotal":"38.5","globalReferer":"https:\/\/www.google.ca\/","createDate":"2016-01-23 16:38:47 +0000","updateDate":"2016-01-23 16:45:34 +0000","createTimestamp":"1453567127","updateTimestamp":"1453567534","items":{"item0":{"id":"70561192","productId":"9673066","categoryId":"2455976","price":"22","productPrice":"22","sku":"00005","quantity":"1","shortDescription":"The original. Worn by Captain Marciano and his First Mate Jay from the very first season of Wicked Tuna , and from the ...","tax":"0","shipping":"16.5","quantityInStock":"184","name":"Black T-Shirt","isShippingRequired":"1","weight":"2","trackQuantity":"1","fixedShippingRateOnly":{},"imageUrl":"https:\/\/dpbfm6h358sh7.cloudfront.net\/images\/1039296\/36454966.jpg","smallThumbnailUrl":"https:\/\/dpbfm6h358sh7.cloudfront.net\/images\/1039296\/36454968.jpg","fixedShippingRate":"0","digital":{},"productAvailable":"1","couponApplied":{},"selectedOptions":{"item0":{"name":"Size","value":"X-Large","valuesArray":{"item0":"X-Large"},"type":"CHOICE"}}}},"billingPerson":{"name":"Christie J Juttner","companyName":{},"street":"704 - 12A ST NE","city":"Calgary","countryCode":"CA","countryName":"Canada","postalCode":"T2E 4R8","stateOrProvinceCode":"AB","stateOrProvinceName":"Alberta","phone":"4036677751"},"shippingPerson":{"name":"Christie J Juttner","companyName":{},"street":"704 - 12A ST NE","city":"Calgary","countryCode":"CA","countryName":"Canada","postalCode":"T2E 4R8","stateOrProvinceCode":"AB","stateOrProvinceName":"Alberta","phone":"4036677751"},"shippingOption":{"shippingCarrierName":"U.S.P.S.","shippingMethodName":"U.S.P.S. First-Class Package International Service\u2122","shippingRate":"16.5"},"handlingFee":{"name":"Handling Fee","value":"0","description":{}},"additionalInfo":{},"paymentParams":{},"hidden":{}},"item2":{"vendorOrderNumber":"0137072","subtotal":"46","total":"67.05","email":"kady_bug16@yahoo.com","externalTransactionId":"052953609D493691S","paymentModule":"PayPalStandard","paymentMethod":"PayPal \/ Credit Card","tax":"0","ipAddress":"24.156.66.75","couponDiscount":"0","paymentStatus":"PAID","paymentMessage":"Your order has been approved","fulfillmentStatus":"AWAITING_PROCESSING","orderNumber":"7072","refererUrl":"http:\/\/fvhardmerchandise.com\/shop.php","volumeDiscount":"0","customerId":"18235174","membershipBasedDiscount":"0","totalAndMembershipBasedDiscount":"0","discount":"0","usdTotal":"67.05","globalReferer":"https:\/\/www.google.com\/","createDate":"2016-01-23 04:48:59 +0000","updateDate":"2016-01-23 04:50:56 +0000","createTimestamp":"1453524539","updateTimestamp":"1453524656","items":{"item0":{"id":"70529558","productId":"35271535","categoryId":"2455976","price":"24","productPrice":"24","sku":"00352","quantity":"1","shortDescription":"This slightly redesigned shirt from Hard Merchandise now has the CUDA brand knife logo on the back in their awesome whi...","tax":"0","shipping":"7.89375","quantityInStock":"47","name":"Tech Fabric Friends of Hard Merchandise Shirt","isShippingRequired":"1","weight":"1.2","trackQuantity":"1","fixedShippingRateOnly":{},"imageUrl":"https:\/\/dpbfm6h358sh7.cloudfront.net\/images\/1039296\/313266743.jpg","smallThumbnailUrl":"https:\/\/dpbfm6h358sh7.cloudfront.net\/images\/1039296\/313266748.jpg","fixedShippingRate":"0","digital":{},"productAvailable":"1","couponApplied":{},"selectedOptions":{"item0":{"name":"Size","value":"XX- Large","valuesArray":{"item0":"XX- Large"},"type":"CHOICE"}}},"item1":{"id":"70529559","productId":"9673066","categoryId":"2455976","price":"22","productPrice":"22","sku":"00006","quantity":"1","shortDescription":"The original. Worn by Captain Marciano and his First Mate Jay from the very first season of Wicked Tuna , and from the ...","tax":"0","shipping":"13.15625","quantityInStock":"82","name":"Black T-Shirt","isShippingRequired":"1","weight":"2","trackQuantity":"1","fixedShippingRateOnly":{},"imageUrl":"https:\/\/dpbfm6h358sh7.cloudfront.net\/images\/1039296\/36454966.jpg","smallThumbnailUrl":"https:\/\/dpbfm6h358sh7.cloudfront.net\/images\/1039296\/36454968.jpg","fixedShippingRate":"0","digital":{},"productAvailable":"1","couponApplied":{},"selectedOptions":{"item0":{"name":"Size","value":"2X-Large","valuesArray":{"item0":"2X-Large"},"type":"CHOICE"}}}},"billingPerson":{"name":"Katie Bardonne","companyName":{},"street":"Po Box 65","city":"Big Pine","countryCode":"US","countryName":"United States","postalCode":"93513","stateOrProvinceCode":"CA","stateOrProvinceName":"California","phone":"7609383141"},"shippingPerson":{"name":"Katie Bardonne","companyName":{},"street":"261 Hall St\nPo Box 65","city":"Big Pine","countryCode":"US","countryName":"United States","postalCode":"93513","stateOrProvinceCode":"CA","stateOrProvinceName":"California","phone":"7609383141"},"shippingOption":{"shippingCarrierName":"U.S.P.S.","shippingMethodName":"U.S.P.S. Priority Mail 3-Day\u2122","shippingRate":"21.05","estimatedTransitTime":"1-3"},"handlingFee":{"name":"Handling Fee","value":"0","description":{}},"additionalInfo":{},"paymentParams":{},"hidden":{}}}}
  3. Thanks Muddy - I was able to get the xml export a lot easier than trying to get the data to csv format. // function to convert multi-dimensional array to xml function array2XML($obj, $array) { foreach ($array as $key => $value) { if(is_numeric($key)) $key = 'item' . $key; if (is_array($value)) { $node = $obj->addChild($key); array2XML($node, $value); } else { $obj->addChild($key, htmlspecialchars($value)); } } } $xml = new SimpleXMLElement('<root/>'); array2XML($xml, $json_obj); echo (($xml->asXML('data.xml')) ? 'Your XML file has been generated successfully!' : 'Error generating XML file!'); //Store data as a string to send to database //$data = $xml->asXML(); I can now move on to looking at making a connection and passing this data off to the fulfillment system. Any info to point me into making a SOAP connection and transferring my data to their format would be great. Again thanks for all the help.
  4. Using the below function I was able to get the exported xml data to a file in the correct format. // function to convert multi-dimensional array to xml function array2XML($obj, $array) { foreach ($array as $key => $value) { if(is_numeric($key)) $key = 'item' . $key; if (is_array($value)) { $node = $obj->addChild($key); array2XML($node, $value); } else { $obj->addChild($key, htmlspecialchars($value)); } } } $xml = new SimpleXMLElement('<root/>'); array2XML($xml, $json_obj); echo (($xml->asXML('data.xml')) ? 'Your XML file has been generated successfully!' : 'Error generating XML file!'); //Store data as a string to send to database //$data = $xml->asXML();
  5. I am trying to convert JSON to XML using php. The json file is part of the Ecwid e-commerce sites api. http://developers.ecwid.com/api-documentation#orders PHP <?php # An HTTP GET request example $url = 'https://app.ecwid.com/api/v3/{STOREID}/orders?paymentStatus=PAID&fulfillmentStatus=AWAITING_PROCESSING&token={TOKEN}'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_TIMEOUT, 5); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $data = curl_exec($ch); curl_close($ch); $data = str_replace("<br>", " ", $data); $json_obj = json_decode($data, true); var_dump($json_obj); echo '<br> <br> <br> <br>'; echo '<h1> PHP Array (json_decode)</h1>'; foreach ($json_obj['items'] as $item) { echo "<pre>"; print_r($item); } echo '<br> <br> <br> <br>'; echo '<h1> XML CONVERSION</h1>'; $xml = new SimpleXMLElement('<root/>'); array_flip($xml); array_walk_recursive($json_obj, array ($xml, 'addChild')); print $xml->asXML(); ?> The XML is coming out with the keys and values flipped. I am trying to use array_flip() to fix this but not sure how to get this to work. XML - without array_flip() <1>total<1>count<0>offset<100>limit<0137062>vendorOrderNumber<79>subtotal<138.65>totalemail<96U34224JE632150D>externalTransactionIdpaymentModulepaymentMethod<0>tax<80.217.64.221>ipAddress<0>couponDiscounttrackingNumberpaymentStatuspaymentMessagefulfillmentStatus<7062>orderNumberrefererUrlorderComments<0>volumeDiscount<24198510>customerId<0>membershipBasedDiscount<0>totalAndMembershipBasedDiscount<0>discount<138.65>usdTotalglobalReferer<00:20 +0000>createDate<31:09 +0000>updateDate<1452261620>createTimestamp<1452630669>updateTimestamp<69399848>id<51555117>productId<2455976>categoryId<40>price<40>productPrice<00604>sku<1>quantityshortDescription<0>tax<17.289855072464>shipping<23>quantityInStockname<1>isShippingRequired<2>weight<1>trackQuantityimageUrlsmallThumbnailUrl<0>fixedShippingRate<1>productAvailablenamevalue0type<69399849>id<15479536>productId<2455976>categoryId<20>price<20>productPrice<00096>sku<1>quantityshortDescription<0>tax<10.373913043478>shipping<211>quantityInStockname<1>isShippingRequired<1.2>weight<1>trackQuantityimageUrlsmallThumbnailUrl<0>fixedShippingRate<1>productAvailable<69399850>id<37228667>productId<2455976>categoryId<15>price<15>productPrice<30701>sku<1>quantityshortDescription<0>tax<30.257246376812>shipping<104>quantityInStockname<1>isShippingRequired<3.5>weight<1>trackQuantityimageUrlsmallThumbnailUrl<0>fixedShippingRate<1>productAvailablenamevalue0type<69399851>id<46912544>productId<2455976>categoryId<2>price<2>productPrice<00421>sku<1>quantityshortDescription<0>tax<0.86449275362319>shipping<59>quantityInStockname<1>isShippingRequired<0.1>weight<1>trackQuantityimageUrlsmallThumbnailUrl<0>fixedShippingRate<1>productAvailable<69399852>id<46912548>productId<2455976>categoryId<2>price<2>productPrice<00423>sku<1>quantityshortDescription<0>tax<0.86449275362319>shipping<44>quantityInStockname<1>isShippingRequired<0.1>weight<1>trackQuantityimageUrlsmallThumbnailUrl<0>fixedShippingRate<1>productAvailablenamestreetcitycountryCodecountryName<12371>postalCodestateOrProvinceCodestateOrProvinceName<0046707340555>phonenamestreetcitycountryCodecountryName<12371>postalCodestateOrProvinceCodestateOrProvinceName<0046707340555>phoneshippingCarrierNameshippingMethodName<59.65>shippingRate<6-10>estimatedTransitTimename<0>value Using array_flip() how I have above in the PHP does nothing.
  6. Using str_replace instead I was able to fix this issue. $data = str_replace("<br>", " ", $data); $json_obj = json_decode($data, true);
  7. Fixed the issue with the below code: $data = str_replace("<br>", " ", $data);
  8. Thanks again Muddy' I will look into flipping the array. One last thing hopefully.... Do you know how i can suppress the line breaks in the [orderComments]? It is giving me an parse error because of these hard returns. $json_obj = preg_replace('\n', " ", utf8_encode($data)); $json_obj = json_decode($data, true); The above didn't seem to work.
  9. I need to take this array and turn it into XML, but there is a parse error because of the line breaks in the [orderComments]. I need to figure out how to strip these out. Thanks.
  10. Trying to convert json to PHP array, and having issues with line breaks in the json output from Ecwid. Ecwid Shopping Cart (API) - GET Orders http://developers.ecwid.com/api-documentation#orders PHP using curl to get json data of new orders <?php # An HTTP GET request example $url = 'https://app.ecwid.com/api/v3/{STOREID}/orders?paymentStatus=PAID&fulfillmentStatus=AWAITING_PROCESSING&token={TOKEN}'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_TIMEOUT, 5); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $data = curl_exec($ch); curl_close($ch); $json_obj = preg_replace('\n', '', utf8_encode($data)); $json_obj = json_decode($data, true); foreach ($json_obj['items'] as $item) { echo "<pre>"; print_r($item); } ?> Array Output: (please see [orderComments]) Array ( [vendorOrderNumber] => 0137062 [subtotal] => 79 [total] => 138.65 [email] => annaschutt@hotmail.com [externalTransactionId] => 96U34224JE632150D [paymentModule] => PayPalStandard [paymentMethod] => PayPal / Credit Card [tax] => 0 [ipAddress] => 80.217.64.221 [couponDiscount] => 0 [paymentStatus] => PAID [paymentMessage] => Your order has been approved [fulfillmentStatus] => AWAITING_PROCESSING [orderNumber] => 7062 [refererUrl] => fbtab:https://www.facebook.com/fvhardmerchandise/?sk=app_251458316228 [orderComments] => If its possible to get an autograph from the captain and the crew to my husband Amadeus it would be great. He just loves the show on tv and is also a fisherman here in Sweden. Thank you Anna [volumeDiscount] => 0 [customerId] => 24198510 [membershipBasedDiscount] => 0 [totalAndMembershipBasedDiscount] => 0 [discount] => 0 [usdTotal] => 138.65 [globalReferer] => https://staticxx.facebook.com/platform/page_proxy/r/hv09mZVdEP8.js [createDate] => 2016-01-08 14:00:20 +0000 [updateDate] => 2016-01-08 14:04:15 +0000 [createTimestamp] => 1452261620 [updateTimestamp] => 1452261855 [items] => Array ( [0] => Array ............
  11. Looks like xml validator is showing errors because of the hard returns used in the [orderComments]. There a way to fix this or do i need to see if i can restrict the hard returns on the front end? http://codebeautify.org/xmlvalidate Error on-> Line :1 Column :2 Message :StartTag: invalid element name Error on-> Line :1 Column :2 Message :Extra content at the end of the document
  12. Thanks i will see what I can figure out using the simpleXML example. What is the <root> mean for the SimpleXMLElement? $url = 'https://app.ecwid.com/api/v3/{STOREID}/orders?paymentStatus=PAID&fulfillmentStatus=AWAITING_PROCESSING&token={TOKEN}'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_TIMEOUT, 5); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $data = curl_exec($ch); curl_close($ch); $json_obj = json_decode($data, true); $xml = new SimpleXMLElement('<root/>'); array_walk_recursive($json_obj, array ($xml, 'addChild')); print $xml->asXML(); Result: <2>total<2>count<0>offset<100>limit<0137064>vendorOrderNumber<44>subtotal<78.3>totalemail<51608869UC712171W>externalTransactionIdpaymentModulepaymentMethod<0>tax<110.92.125.18>ipAddress<0>couponDiscountpaymentStatuspaymentMessagefulfillmentStatus<7064>orderNumberrefererUrl<0>volumeDiscount<24249682>customerId<0>membershipBasedDiscount<0>totalAndMembershipBasedDiscount<0>discount<78.3>usdTotalglobalReferer<29:32 +0000>createDate<31:00 +0000>updateDate<1452500972>createTimestamp<1452501060>updateTimestamp<69590723>id<9673066>productId<2455976>categoryId<22>price<22>productPrice<00003>sku<2>quantityshortDescription<0>tax<34.3>shipping<10>quantityInStockname<1>isShippingRequired<1.5>weight<1>trackQuantityimageUrlsmallThumbnailUrl<0>fixedShippingRate<1>productAvailablenamevalue0typenamestreetcitycountryCodecountryName<541330>postalCodestateOrProvinceCodestateOrProvinceName<+65 91698222>phonenamestreetcitycountryCodecountryName<541330>postalCodestateOrProvinceCodestateOrProvinceName<+65 91698222>phoneshippingCarrierNameshippingMethodName<34.3>shippingRatename<0>value<0137062>vendorOrderNumber<79>subtotal<138.65>totalemail<96U34224JE632150D>externalTransactionIdpaymentModulepaymentMethod<0>tax<80.217.64.221>ipAddress<0>couponDiscountpaymentStatuspaymentMessagefulfillmentStatus<7062>orderNumberrefererUrl Thank you Anna>orderComments Thank you Anna><0>volumeDiscount<24198510>customerId<0>membershipBasedDiscount<0>totalAndMembershipBasedDiscount<0>discount<138.65>usdTotalglobalReferer<00:20 +0000>createDate<04:15 +0000>updateDate<1452261620>createTimestamp<1452261855>updateTimestamp<69399848>id<51555117>productId<2455976>categoryId<40>price<40>productPrice<00604>sku<1>quantityshortDescription<0>tax<17.289855072464>shipping<23>quantityInStockname<1>isShippingRequired<2>weight<1>trackQuantityimageUrlsmallThumbnailUrl<0>fixedShippingRate<1>productAvailablenamevalue0type<69399849>id<15479536>productId<2455976>categoryId<20>price<20>productPrice<00096>sku<1>quantityshortDescription<0>tax<10.373913043478>shipping<211>quantityInStockname<1>isShippingRequired<1.2>weight<1>trackQuantityimageUrlsmallThumbnailUrl<0>fixedShippingRate<1>productAvailable<69399850>id<37228667>productId<2455976>categoryId<15>price<15>productPrice<30701>sku<1>quantityshortDescription<0>tax<30.257246376812>shipping<104>quantityInStockname<1>isShippingRequired<3.5>weight<1>trackQuantityimageUrlsmallThumbnailUrl<0>fixedShippingRate<1>productAvailablenamevalue0type<69399851>id<46912544>productId<2455976>categoryId<2>price<2>productPrice<00421>sku<1>quantityshortDescription<0>tax<0.86449275362319>shipping<59>quantityInStockname<1>isShippingRequired<0.1>weight<1>trackQuantityimageUrlsmallThumbnailUrl<0>fixedShippingRate<1>productAvailable<69399852>id<46912548>productId<2455976>categoryId<2>price<2>productPrice<00423>sku<1>quantityshortDescription<0>tax<0.86449275362319>shipping<44>quantityInStockname<1>isShippingRequired<0.1>weight<1>trackQuantityimageUrlsmallThumbnailUrl<0>fixedShippingRate<1>productAvailablenamestreetcitycountryCodecountryName<12371>postalCodestateOrProvinceCodestateOrProvinceName<0046707340555>phonenamestreetcitycountryCodecountryName<12371>postalCodestateOrProvinceCodestateOrProvinceName<0046707340555>phoneshippingCarrierNameshippingMethodName<59.65>shippingRate<6-10>estimatedTransitTimename<0>value
  13. I would think these are the items i would need to export and get into the fulfillment software to process the order and have the extra info for reporting capabilities. $output['vendorOrderNumber'] = $item['vendorOrderNumber']; $output['total'] = $item['total']; $output['email'] = $item['email']; $output['paymentMethod'] = $item['paymentMethod']; $output['tax'] = $item['tax']; $output['paymentStatus'] = $item['paymentStatus']; $output['fulfillmentStatus'] = $item['fulfillmentStatus']; $output['orderNumber'] = $item['orderNumber']; $output['orderComments'] = $item['orderComments']; $output['customerId'] = $item['customerId']; $output['discount'] = $item['discount']; $output['usdTotal'] = $item['usdTotal']; $output['createTimestamp'] = $item['createTimestamp']; //['items'] $output['id'] = $item['items'][0]['id']; $output['productId'] = $item['items'][0]['productId']; $output['categoryId'] = $item['items'][0]['categoryId']; $output['price'] = $item['items'][0]['price']; $output['productPrice'] = $item['items'][0]['productPrice']; $output['weight'] = $item['items'][0]['weight']; $output['sku'] = $item['items'][0]['sku']; $output['quantity'] = $item['items'][0]['quantity']; $output['shipping'] = $item['items'][0]['shipping']; $output['quantityInStock'] = $item['items'][0]['quantityInStock']; $output['name'] = $item['items'][0]['name']; $output['productAvailable'] = $item['items'][0]['productAvailable']; //['selectedOptions'] $output['name'] = $item['selectedOptions'][0]['name']; $output['value'] = $item['selectedOptions'][0]['value']; $output['valuesArray'] = $item['selectedOptions'][0]['valuesArray']; $output['Big'] = $item['selectedOptions'][0]['Big']; $output['type'] = $item['selectedOptions'][0]['type']; // THERE ARE MORE SELECTED OPTIONS BUT I AM LOST AT HOW THEY SHOULD BE ADDED TO THE ARRAY. //['shippingPerson'] $output['name'] = $item['shippingPerson'][0]['name']; $output['companyName'] = $item['shippingPerson'][0]['companyName']; $output['street'] = $item['shippingPerson'][0]['street']; $output['city'] = $item['shippingPerson'][0]['city']; $output['countryCode'] = $item['shippingPerson'][0]['countryCode']; $output['countryName'] = $item['shippingPerson'][0]['countryName']; $output['postalCode'] = $item['shippingPerson'][0]['postalCode']; $output['stateOrProvinceCode'] = $item['shippingPerson'][0]['stateOrProvinceCode']; $output['stateOrProvinceName'] = $item['shippingPerson'][0]['stateOrProvinceName']; $output['phone'] = $item['shippingPerson'][0]['phone']; and again these keys are taken from the response example in the api: http://developers.ecwid.com/api-documentation#orders
  14. Well as mentioned I am new to php and web services. Usually just front end development for ecommerce and the company sites. So taking this on may be more than I was thinking it was going to be. That being said our fulfillment system (VeraCore) does use web services via XML/SOAP/WSDL/UDDI and may be the better route for a direct connection over a csv export import type of system.
  15. The above json is an order export from the Ecwid shopping cart for my clients orders. I am looking to create a csv file to import into our fulfillment order processing system. Right now we can manually export orders from the front end and drop that csv in a folder that auto imports them. End result would be looking for the script to export the orders hourly and drop in that ftp folder to automate the process. So you are correct i wouldn't need things like thumbnails, but the more info i can get out and into our fulfillment house's system the more reporting for the client I will be able to provide for their orders. Thanks again. Ryan
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.