Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function _xmlToQuote(){
- require_once(dirname(__FILE__) . DS . 'include.php');
- $startTag = 'eparcel/ratesAndServicesResponse/';
- require_once(dirname(__FILE__) . DS . 'xmlparser.php');
- $xmlParser = new xmlparser();
- $array = $xmlParser -> GetXMLTree($this -> xml_response);
- if (!empty($array['EPARCEL'][0]['ERROR'])) {
- $this -> error = true;
- $this -> error_msg = $array['EPARCEL'][0]['ERROR'][0]['STATUSMESSAGE'][0]['VALUE'];
- } else {
- $this -> error = false;
- $xd = new MiniXMLDoc($this -> xml_response);
- $startTag = 'eparcel/ratesAndServicesResponse/';
- $this -> statusCode = fetchValue($xd, $startTag . 'statusCode');
- $this -> statusMessage = fetchValue($xd, $startTag . 'statusMessage');
- $this -> shipping_comment = fetchValue($xd, $startTag . 'comment') ;
- $shipping_fields = array("name", "rate", "shippingDate", "deliveryDate", "deliveryDayOfWeek", "nextDayAM", "packingID");
- $this -> shipping_methods = fetchArray($xd, $startTag, 'product', $shipping_fields);
- }
- /*
- $xd = new MiniXMLDoc($this -> xml_response);
- $this -> statusCode = fetchValue($xd, $startTag . 'statusCode');
- $this -> statusMessage = fetchValue($xd, $startTag . 'statusMessage');
- $this -> error = ('OK' == $this -> statusCode);
- $this -> error_msg = $this -> error ? $this -> statusMessage : "";
- if (!$this -> error) {
- $this -> shipping_comment = fetchValue($xd, $startTag . 'comment') ;
- $shipping_fields = array("name", "rate", "shippingDate", "deliveryDate", "deliveryDayOfWeek", "nextDayAM", "packingID");
- $this -> shipping_methods = fetchArray($xd, $startTag, 'product', $shipping_fields);
- }
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment