Jump to content
Latest News: (loading..)
nobodyfamous

canada post XML parsing error (GoDaddy)

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?

Share this post


Link to post
Share on other sites

@@nobodyfamous

 

I am not sure about current Godaddy server settings, BUT in the past a special request to open the port for Canada Post was required. It is NOT normally open on Godaddy servers.

 

 

Chris


:|: Was this post helpful ? Click the LIKE THIS button :|:

 

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

Share this post


Link to post
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


:|: Was this post helpful ? Click the LIKE THIS button :|:

 

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

Share this post


Link to post
Share on other sites

still waiting on GoDaddy - I mirrored the site to my custom server, out there on the internet, and had the same problem. So I downloaded all the files again and ran them through a file compare program. The files are identical. . . :wacko:

Share this post


Link to post
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?

Share this post


Link to post
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:info@bitsnbridles.ca"><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">
)

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

SOLVED!!! turns out it was a session error. the osCid was being passed in the URL all the time, and this began blocking the AJAX from getting the right session values, ex. cartID.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×