I'm not quite sure what i'm doing wrong here, but i cannot get the Canada Post Shipping module to calculate shipping, all i ever get when i hit the "calculate shipping" button is "You must select a shipping option before continuing."

I uncommented these two lines in my code:

    //drupal_set_message('<pre>'. check_plain(var_export($xml, TRUE)) .'</pre>');
    //drupal_set_message('<pre>'. check_plain(var_export($response, TRUE)) .'</pre>');

And got the following output. could you help me decipher where my problem is? thanks!

<li><pre>&#039;&lt;?xml version=&quot;1.0&quot; ?&gt;&lt;eparcel&gt;&lt;language&gt;en&lt;/language&gt;&lt;ratesAndServicesRequest&gt;&lt;merchantCPCID&gt;CPC_GLITCH_HOP_FORUM&lt;/merchantCPCID&gt;&lt;turnAroundTime&gt;24&lt;/turnAroundTime&gt;&lt;itemsPrice&gt;20&lt;/itemsPrice&gt;&lt;lineItems&gt;&lt;item&gt;&lt;quantity&gt;1&lt;/quantity&gt;&lt;weight&gt;1&lt;/weight&gt;&lt;length&gt;1&lt;/length&gt;&lt;width&gt;1&lt;/width&gt;&lt;height&gt;1&lt;/height&gt;&lt;description&gt;1 items&lt;/description&gt;&lt;readyToShip /&gt;&lt;/item&gt;&lt;/lineItems&gt;&lt;city&gt;woodbridge&lt;/city&gt;&lt;provOrState&gt;ON&lt;/provOrState&gt;&lt;country&gt;CA&lt;/country&gt;&lt;postalCode&gt;L4L1A7&lt;/postalCode&gt;&lt;/ratesAndServicesRequest&gt;&lt;/eparcel&gt;&#039;</pre></li>
<li><pre>false</pre></li>

PHP 5.2.9
Drupal 6.13
Modules:
Ubercart 6.x-2.0-rc6
Canada Post Shipping Quotes for Ubercart 6.x-1.x-dev (2009-Aug-26)
Ubercart Views 6.x-2.0
Theme: Vigilianty 6.x-1.1

Comments

deweydb’s picture

Sorry about the messy XML dump, i've cleaned it up a bit here:

<li><pre>'<?xml version=&quot1.0&quot ?><eparcel>
<language>en</language>
<ratesAndServicesRequest>
<merchantCPCID>CPC_GLITCH_HOP_FORUM</merchantCPCID>
<turnAroundTime>24</turnAroundTime>
<itemsPrice>20</itemsPrice>
<lineItems><item>
<quantity>1</quantity>
<weight>1</weight>
<length>1</length>
<width>1</width>
<height>1</height>
<description>1 items</description>
<readyToShip /></item></lineItems>
<city>woodbridge</city>
<provOrState>ON</provOrState>
<country>CA</country>
<postalCode>L4L1A7</postalCode>
</ratesAndServicesRequest></eparcel>'</pre></li>

<li><pre>false</pre></li>

This alone leads me to believe something is off, the weight is set at 180 grams in the ubercart product definition. Are grams not compatible with uc_canadapost?

tr’s picture

Your weight question is addressed at http://drupal.org/node/570318

The XML being sent to the Canada Post server looks correct. However, the parsed result returned from the server is "false", indicating an HTTP error or a network error. No way to tell without sticking in some debug print statements and seeing what is happening. My guess is that it's something like your server blocking port 30000, causing the POST to fail, or that the CP server was just off-line when you did your testing. There's a possibility that some debug information is in your logs at admin/reports/dblog.

deweydb’s picture

Thanks TR. I've made some progress with this, i called my hosting and got them to open port 30000 and now i can get quotes when ever i finish entering the mailing address info and click outside the box. But the moment i actually hit the "calculate shipping" button the page refreshes and i get an error "you must select a shipping option before continuing". In fact if i have any of the "next" buttons enabled during checkout the page always refreshes. I guess that this is more of an ubercart bug, but if you have any ideas i would appreciate it.

Also thanks for clearing up the weight issue.

tr’s picture

Search the Ubercart forums for that error - lot's of possible causes not related to this or any other shipping module. The most common one is having a JavaScript error on the checkout page.

tr’s picture

Status: Active » Postponed (maintainer needs more info)
tr’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No activity in two months, so I'm going to assume it's solve. Re-open if you continue to have the problem and can provide more information.