Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

canada post XML parsing error (GoDaddy)


nobodyfamous

Recommended Posts

this site http://www.bitsnbridles.ca/ is live. All of a sudden the Canada Post shipping module is not working. It works on my local MAMP fine. (I hate GoDaddy, but it's where the client has the site)

 

I have tracked the error down as far as where XML data is missing.

 

In /includes/modules/shipping/canadapost.php around line 244 the function _canadapostGetQuote() is not returning any data for the lines inside <lineItems>

 

Further it would seem that the function (around line 190) _addItem ($quantity, $rate, $weight, $length, $width, $height, $description, $ready_to_ship) is not being called.

 

again, the $canadapostQuote array is full at the top of the page, but empty when the module is displayed.

 

I am lost, this only happens on the GoDaddy Server.

 

Any ideas?

Link to comment
Share on other sites

@@nobodyfamous

 

ok, I thought the site was still on your MAMP server because of this " It works on my local MAMP fine.". But if it's already been live for 6 months, it could be another issue or perhaps the closed the required port by mistake.

 

 

Chris

Link to comment
Share on other sites

so GoDaddy's response was useless.

Thank you for contacting Hosting Online Support Team. Please be aware that your website can only connect to other computers using port 80 (HTTP) or 443 (HTTPS). Other ports can not be used.

 

If other ports were usable before this would have been a configuration error.

 

So back to my issue. . . any ideas?

Link to comment
Share on other sites

why might this be happening?

 

I added the line print_r($this->quotes); just before return $this->quotes; in the canadapost.php function quote so I could see what is being returned.

 

At the very top of the site, before any code is output I get this (which is correct)

Array
(
   [id] => canadapost
   [module] => Canada Post [1 box(es) to be shipped]<br>medium - 6.55(kg)
   [methods] => Array
    (
	    [0] => Array
		    (
			    [id] => Priority
			    [title] => Priority, <acronym title='Estimated Delivery Date'>EDD</acronym>: February 24, 2014
			    [cost] => 27.32
		    )
	    [1] => Array
		    (
			    [id] => Expedited
			    [title] => Expedited, <acronym title='Estimated Delivery Date'>EDD</acronym>: February 25, 2014
			    [cost] => 13.72
		    )
	    [2] => Array
		    (
			    [id] => Regular
			    [title] => Regular, <acronym title='Estimated Delivery Date'>EDD</acronym>: February 26, 2014
			    [cost] => 13.72
		    )
    )
   [icon] => <br><img src="images/icons/shipping_canadapost.gif" width="145" height="37" border="0" alt="Canada Post" title="Canada Post">
)

 

But, then what is just below the title Shipping Method I get

Array
(
   [module] => Canada Post
   [error] => XML parsing error. <br>If you prefer to use canadapost as your shipping method, please contact the Bits N Bridles via <a href="mailto:[email protected]"><u>Email</u></a>.
   [icon] => <br><img src="images/icons/shipping_canadapost.gif" width="145" height="37" border="0" alt="Canada Post" title="Canada Post">
)

Link to comment
Share on other sites

I have further refined the problem to an empty array. again, at the top of the page, AKA at the time of loading this arry is right

 

$products_array = $cart->get_products();

Array
(
   [0] => Array
    (
	    [id] => 291{2}4
	    [name] => All Canadian Farmer men’s tee
	    [model] =>
	    [image] => All Canadian Farmer.PNG
	    [price] => 22.9900
	    [quantity] => 1
	    [weight] => 1.54
	    [length] => 11.50
	    [width] => 9.00
	    [height] => 9.00
	    [ready_to_ship] =>
	    [final_price] => 22.99
	    [tax_class_id] => 1
	    [attributes] => Array
		    (
			    [2] => 4
		    )
    ))

 

Yet down the page (I assume, is after it is refreshed via AJAX) I get this for the same array

array()

 

It is empty. Why is that?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...