Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Canada Post Automated Labels 2.0 AND Canada Post Shipping Module 4.0


insaini

Recommended Posts

Hello.

 

I have installed Canada Post module on to my client's website (not automated labels though) and everything seems to be working like a charm. Once I get to the checkout_confirmation.php page, it displays the sub-total, then it displays the Canada Post shipping rate and the then the total. So it looks great on the checkout confirmation page.

 

However, when I click the "continue" button to confirm my order, once it takes me to Paypal to pay, it only allows me to pay the sub-total but the Shipping rate does not get added! The website I am talking about is http://www.pauletterose.com.

 

Can somebody help me figure this out?

I would be extremely appreciative.

Thank you so much for your help and support!

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 230
  • Created
  • Last Reply

Top Posters In This Topic

Just a screenshot..

 

screenshot.jpg

 

I have install these moodules, but some questions.

 

1. I can't find any place that shows this label page?

2. There is no place to enter the demension?

3. What is the box size file for and where does it go?

 

 

Glen

Edited by TCOB1
Link to comment
Share on other sites

  • 3 weeks later...

I tried to install this contribution and I am getting errors. I uploaded the new files and edited the others and uploaded them. I then installed the module and when I went to a product I received this error.

 

1054 - Unknown column 'p.products_length' in 'field list'

 

select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, p.products_price, p.products_weight, p.products_length, p.products_width, p.products_height, p.products_ready_to_ship, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from products p, products_description pd where p.products_id = '562' and p.products_id = pd.products_id and pd.language_id = '1'

 

[TEP STOP]

 

I then realized I hadn't ran the SQL file so I imported the file and I got the following error

 

SQL query:

 

###########################################################################

# CANADA POST SHIPPING MODULE DB QUERIES

###########################################################################

# Canada Post Shipping Module with dimensions using osCommerce stored units

ALTER TABLE products ADD products_length DECIMAL( 6, 2 ) DEFAULT '12' NOT NULL AFTER products_dim_type,

ADD products_width DECIMAL( 6, 2 ) DEFAULT '12' NOT NULL AFTER products_length,

ADD products_height DECIMAL( 6, 2 ) DEFAULT '12' NOT NULL AFTER products_width,

ADD products_ready_to_ship ENUM( '0', '1' ) NOT NULL default '0' AFTER products_height;

 

MySQL said: Documentation

#1054 - Unknown column 'products_dim_type' in 'products' "

 

What is wrong?

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...

AHHHH I broke it!

 

Cannot reach Canada Post Server. You may refresh this page (Press F5 on your keyboard) to try again.

 

I have several different versions of admin\ship_canadapost_ajax.php and I'm trying to figure out which one was the backup that actually works - neither file is fixing this now!

 

 

		 case 2:
               // curl init
               $ch = cp_setup(false);
               // new login
               $response = cp_get_page($ch, SSO.'/cpid/apps/signIn?LOCALE=en&~language=EN&APP_ID=B2B&SSO_REFERRER_URL=https://obc.canadapost.ca/zcpb2b/b2b/init.do?language=EN&shop=CPENCOMM');
               // new login form
               $query_string = 'frmCPIDSignIn:signIn.x=46&frmCPIDSignIn:signIn.y=11&frmCPIDSignIn_SUBMIT=1'
                                       . '&frmCPIDSignIn:j_username=' . urlencode(MODULE_SHIPPING_CANADAPOST_USERID)
                                       . '&frmCPIDSignIn:j_password=' . urlencode(MODULE_SHIPPING_CANADAPOST_PASSWORD);

               $response = cp_post_page($ch, SSO.'/cpid/apps/signIn?execution=e1s1', $query_string);
               // login post vars
               $query_string = 'SHOP=CPFRCOMM&SSO_ITS_URL=%2Fcpid%2login%2FsignIn%3F&SSO_ACTION=0&P_SHOP=CPFRCOMM'
                                       . '&login_type=2&password_length=0&language=EN&APP_ID=B2B'
                                       . '&SSO_USERID=' . urlencode(MODULE_SHIPPING_CANADAPOST_USERID)
                                       . '&SSO_PASSWORD=' . urlencode(MODULE_SHIPPING_CANADAPOST_PASSWORD);

 

or

 

	case 2:
	// login post vars
	$query_string = 'SHOP=CPFRCOMM&SSO_ITS_URL=%2Fsso%2Flogin.jsp&SSO_ACTION=0&P_SHOP=CPFRCOMM'
				. '&login_type=2&password_length=0&%7Elanguage=EN&APP_ID=B2B'
				. '&SSO_USERID=' . urlencode(MODULE_SHIPPING_CANADAPOST_USERID)
				. '&SSO_PASSWORD=' . urlencode(MODULE_SHIPPING_CANADAPOST_PASSWORD);
	// curl init
	$ch = cp_setup(false);

Link to comment
Share on other sites

my host company restored the backup and it is still not working. Did Canada Post change something? Am I the only one?

They seem to have some kind of outages with their servers. I wasn't even able to login from the Canada Post website for some time. It just said that password is wrong... But it's working again now.

 

Always check first if you can login manually to see if it's a problem on their end.

Link to comment
Share on other sites

They seem to have some kind of outages with their servers. I wasn't even able to login from the Canada Post website for some time. It just said that password is wrong... But it's working again now.

 

Always check first if you can login manually to see if it's a problem on their end.

 

Thanks but no that isn't it ... I can login to Canada Post http://sellonline.canadapost.ca/servlet/LogonServlet without any problem.

 

This hasn't worked for over a week and three orders came in without shipping charged!

Link to comment
Share on other sites

Thanks but no that isn't it ... I can login to Canada Post http://sellonline.canadapost.ca/servlet/LogonServlet without any problem.

 

This hasn't worked for over a week and three orders came in without shipping charged!

 

It's fixed... the host had closed port 30000 ... I had asked the host a week ago if this was open they said it was but it wasn't. It is reopened and all is working fine. At least it wasn't anything I did!

Link to comment
Share on other sites

  • 3 weeks later...

I'm getting an error in Step 5

"Step 5. Error: Failed check in /admin/ship_canadapost.php at line 873. This most likely means that Canada Post has changed their user interface. You need to update your Canada Post Automatic Shipping Labels module."

 

I'm trying to ship to the US using XpressPost USA.

 

This is my Step 5 coding;

  // 5. SHIPPING METHOD

 $query_string = 'translatorName=' . urlencode('cpc.ui.online.shipping.ShippingServiceTranslator')
               . '&pageName=' . urlencode('shipping/estShipping.jsp?locale=en_CA&formId=' . $form_prefix . '1')
               . '&errorMessage='
               . '&errorField='
               . '&nextPageFormId='
               . '&formId=' . $form_prefix . '1'
               . '&manifestTemplateCount=0'
               . '&isDocument=false'
               . '&userAction='

               // shipping method
               . '&serviceType=' . $HTTP_POST_VARS['service_type']
               . '&optionSO=' . ($HTTP_POST_VARS['signature_option'] == 'on' ? 'true' : 'false') // Signature Option
               . '&optionCOV=' // Coverage $
               //. '&optionUP=false' // Unpackaged
               . '&optionCYL=false' // Mailing Tube
               . '&saveAsTemplate=false'
               . '&templateName='

               // email updates

               . '&subject=TRACKING' // TRACKING or REFERENCE or ADDITION (i.e. additional reference number)

               . '&recipientEmail='
               . '&notifyRecipientShip=false'
               . '&notifyRecipientException=false'
               . '&notifyRecipientDelivery=false'

               . '&recipientCcEmail='
               . '&notifyCcRecipientShip=false'
               . '&notifyCcRecipientException=false'
               . '&notifyCcRecipientDelivery=false'

               . '&senderEmail='
               . '&notifySenderShip=true'
               . '&notifySenderException=true'
               . '&notifySenderDelivery=true'

               . '&senderCcEmail='
               . '&notifyCcSenderShip=false'
               . '&notifyCcSenderException=false'
               . '&notifyCcSenderDelivery=false'

               . '&comment='

 ;
 if ($delivery_country == 'CA') {
   $query_string = $query_string
                 . '&optionPA18=' // Proof of Age Required (18 years)
                 . '&optionPA19=' // Proof of Age Required (19 years)
                 . '&optionHFP='  // CARD FOR PICK UP
                 . '&optionDNS='  // DO NOT SAFE DROP
                 . '&optionLAD='  // LEAVE AT DOOR - DO NOT CARD
   ;
 } 
 $response = cp_post_page($ch, 'https://est-oee.canadapost-postescanada.ca/ShippingServlet', $query_string);

 $errorMessage = cp_get_error($response);
 if ($errorMessage != '') {
   cp_error(5, $errorMessage);
   curl_close($ch); die(); /////////////////////
 }

 // Sanity Check and Progress Report
 if ($delivery_country != 'CA') {
   $form_id = $form_prefix . '2';
 } else {
   $form_id = $form_prefix . '4';
 }
 if (strstr($response, '<input type="hidden" name="formId" value="' . $form_id . '">') === FALSE) {
   cp_error(5, 'Failed check in ' . __FILE__ . ' at line ' . __LINE__  . '. This most likely means that Canada Post has changed their user interface. You need to update your Canada Post Automatic Shipping Labels module.');
   curl_close($ch); die(); /////////////////////
 } else {
   cp_progress(5, 'Selected shipping method.');
   if ($delivery_country == 'CA') {
     cp_progress(6, 'Customs information not necessary for Canada.');
   }
 } 

 if ($delivery_country != 'CA') {
   $regexp = "name=\"manifestCategoryType\"\svalue=\"([^\"]*)\"";
   $matches = '';
   preg_match("/$regexp/siU", $response, $matches);
   $manifestCategoryType = $matches[1];

   $regexp = "name=\"isSmallPackets\"\svalue=\"([^\"]*)\"";
   $matches = '';
   preg_match("/$regexp/siU", $response, $matches);
   $isSmallPackets = $matches[1];

   $nonDeliveryInstructions = '';
   if ($delivery_country == 'US' || $delivery_country == 'CA') {
     $nonDeliveryInstructions = 'RETSUR'; // return via surface
   } else {
     $nonDeliveryInstructions = 'RETAIR'; // return via air
   }

 ////

 

Please help!

Edited by oyb
Link to comment
Share on other sites

Hey everyone.. its been a while since ive logged into here.. seems as though some of you have some issues with my contribution.. i may be able to offer some help over the next few days.. and ill be uploading a new contribution package that fixes up the automated labels routines. I probably wont be uploading an upgrade doc.. just fixing the lines that have issues..

Link to comment
Share on other sites

  • 2 weeks later...

Now it seems that I'm getting an error in Step 7; the odd thing is.. my credit card is getting charged but it's not producing a label, it's failing.

 

Step 1. Initialized.

Step 2. Logged in.

Step 3. Started shipping application.

Step 4. Entered address.

Step 5. Selected shipping method.

Step 6. Customs information not necessary for Canada.

Step 7. Error: Failed check in .../public_html/shop/admin/ship_canadapost.php at line 738. This most likely means that Canada Post has changed their user interface. You need to update your Canada Post Automatic Shipping Labels module.

 

Any idea? Is anyone else getting this?

Edited by oyb
Link to comment
Share on other sites

  • 2 weeks later...

I'm getting this Step 2 error:

 

"Step 2. Error: Failed check in /path_to_admin/includes/languages/english/ship_canadapost.php at line 9. This most likely means that Canada Post..."

 

This appears to be related to cookies, but as far as I can tell they are set correctly - not being very familiar with cookies though - here is the section from application_top.php:

 

// set the session cookie parameters

if (function_exists('session_set_cookie_params')) {

session_set_cookie_params(0, DIR_WS_ADMIN);

} elseif (function_exists('ini_set')) {

ini_set('session.cookie_lifetime', '0');

ini_set('session.cookie_path', DIR_WS_ADMIN);

}

 

Suggestions?

 

Thanks!

 

John :-#)#

Edited by Jan Zonjee
Link to comment
Share on other sites

Hey everyone.. its been a while since ive logged into here.. seems as though some of you have some issues with my contribution.. i may be able to offer some help over the next few days.. and ill be uploading a new contribution package that fixes up the automated labels routines. I probably wont be uploading an upgrade doc.. just fixing the lines that have issues..

 

Hi Insaini

 

I'm planing to do a reinstall of this program and was wondering if you have updated the download files?

 

 

Thanks

Link to comment
Share on other sites

 

(revised)

 

I'm getting this Step 2 error:

 

"Step 2. Error: Failed check in /.../catalog/admin/includes/languages/english/ship_canadapost.php at line 9. This most likely means that Canada Post..."

 

 

The cookie directory (chmod 777) is pointed to correctly - and if I create a zero length file called cp_cookie.txt and drop it in the cookie directory it is eaten by the application while it produces the error code. I guess it was hungry...

 

What am I missing about setting cookie parameters? Where do I do this? I hate being a noobie!

 

Suggestions?

 

Thanks!

 

John :-#)#

Link to comment
Share on other sites

  • 2 weeks later...

The cookie directory (chmod 777) is pointed to correctly - and if I create a zero length file called cp_cookie.txt and drop it in the cookie directory it is eaten by the application while it produces the error code. I guess it was hungry...

 

What am I missing about setting cookie parameters? Where do I do this? I hate being a noobie!

 

Suggestions?

 

Thanks!

 

John :-#)#

 

Problem solved, my typo in an edit...

 

John :-#)#

Link to comment
Share on other sites

I have found there is an obsolete section in admin/catagories.php which is this line of code - the link to launch a search page for Harmonized Shipping Codes/Tariffs in catalog/admin/categories.php while in the Add/Edit :

 

-----------------------

***REPLACE this added (Automated Labels) code:

 

<td class="main"><a href="http://www.cbsa-asfc.gc.ca/trade-commerce/tariff-tarif/tariff2007/01-99/table-e.html" target="_blank">HS Tariff</a>:</td>

 

******With this code:

 

<td class="main"><a href="http://www.statcan.gc.ca/trade-commerce/cec/trade-commerce-eng.htm" target="_blank">HS Tariff</a>:</td>

 

-----------------------

 

This (when you click on "HS Tariffs:") opens a new tab/window for Statistics Canada search "Canadian Export Classification" and you can search for your code using key words (start with a single word) or part of a tariff code - say the first 4 numbers, no "." in the search window.

 

John :-#)#

Link to comment
Share on other sites

  • 8 months later...

My client tells me that Tax isn't charging on the Postage.... I thought this broke when I switched the store from GST/PST to HST but now they tell me they don't think it was ever working. The guy on the phone at Canada Post told my client it was a matter of adding a line to the shopping cart that simply adds the 13% to the shipping cost before the total gets to the customer. BUT the shipping module has a way to handle this it just isn't working.

 

I have the Canada Post module set to use the "HST on Postage" tax class on shipping

The "HST on Postage" tax class is set to use the tax Zone "Canada Post"

The "Canada Post" Tax zone is set to All Countries and All Zones

The Tax Rate for The "HST on Postage" tax class is set to 13%

 

No matter what I do the Canada Post module won't add tax to shipping charge.

Link to comment
Share on other sites

  • 9 months later...

I have been reviewing the posts on the following error:

 

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in /nfs/c08/h04/mnt/125063/domains/store.trainingfx.com/html/tfxstoreadmin/includes/functions/ship_canadapost.php on line 13

 

I have confirmed that safe more is not enabled and port 30000 is open, the only thing left is "open_basedir" but I am not sure where to start looking for this issue. Could anyone provide direction ?

 

Thanks

 

Anthony

Link to comment
Share on other sites

  • 3 weeks later...

Can anyone confirm that the Automated Labels still works successfully in September 2011? I have the correct compilation of curl, cookies file is OK but Step 2 fails with a general error when no pages are returned in the result.

 

Is anyone else experiencing this?

 

Thanks,

Ben

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...