Zen Cart Logo
Forums / Addon Shipping Modules / CanPar Shipping XML Module

CanPar Shipping XML Module

Locked

Views: 6,466

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
8 Aug 2007, 3:24 PM
#2
tully avatar

tully

New Zenner

Join Date:
Dec 2006
Location:
Toronto, Ontario, CANADA
Posts:
21
Plugin Contributions:
0

Re: CanPar Shipping XML Module

Fantastic module and it works great for Canada! :clap:

Now, is it limited to just Canada ? When I use a US 'ship to' address it returns $0 for the shipping amount which raises the question: is it only calling on domestic shipping rates?

Also, there is a blank input box when I go in to edit the settings for the module.. I've got True/False, Tax Class, a titleless box, and then Sort Order.. ?!

19 Sep 2007, 11:38 PM
#3
breck avatar

breck

Zen Follower

Join Date:
Sep 2007
Posts:
106
Plugin Contributions:
0

Re: CanPar Shipping XML Module

Your blank box is 'Mark Up'.

I am presently trying to get some help to re-write this mod to work with Can and USA at the same time. Presently you have to edit the file to use with USA.
On my oscommerce site, I created CanPar and CanParUSA so that it quoted for both, but I didn't like the results of the look of both showing together and 1 having 0 value.

28 Sep 2007, 9:56 PM
#4
coeus avatar

coeus

New Zenner

Join Date:
Jan 2005
Posts:
12
Plugin Contributions:
0

Re: CanPar Shipping XML Module

Hello Breck.

What edits are you making in the file to work with US. Perhaps I can apply your edits to the mod.

2 Oct 2007, 3:24 AM
#5
breck avatar

breck

Zen Follower

Join Date:
Sep 2007
Posts:
106
Plugin Contributions:
0

Re: CanPar Shipping XML Module

I am trying to get this mod to work both in canada and the us at the same time.
This is the line that regulates it:

$request = join('&', array('service=1',

If services=1 (CAN) If services=2 (USA)

This mod can work for either but not both as of now.
You have to manually change the file to use one or the other.

I was thinking that if the file could be rewrote to check the first character of the zip/postal code, then it could be set for 1 or 2 for the services.

Canada postal code k8a 1e3 - first character is a letter
USA zip code 59595 - first character is a number

I was thinking something like:

If zip character equal or greater than 0,

Then

//Connect to CanPar here to get quote, and parse XML.
$request = join('&', array('service=2',
'quantity=' . $shipping_num_boxes,
'unit=K',
'origin=' . $srcFSA,
'dest=' . $desFSA,
'weight=' . intval($shipping_weight),
'cod=0',
'put=0',
'xc=0',
'dec=0'));

ELSE

//Connect to CanPar here to get quote, and parse XML.
$request = join('&', array('service=1',
'quantity=' . $shipping_num_boxes,
'unit=K',
'origin=' . $srcFSA,
'dest=' . $desFSA,
'weight=' . intval($shipping_weight),
'cod=0',
'put=0',
'xc=0',
'dec=0'));

I don't know coding at all, so this is where I am stuck and need someone with coding experience to help me with this.

I know the file already grabs the first 3 characters for retrieving quotes.

20 Mar 2008, 7:14 PM
#6
amandabto avatar

amandabto

New Zenner

Join Date:
Jan 2008
Posts:
15
Plugin Contributions:
0

Re: CanPar Shipping XML Module

Actually, the code already grabs the first character of the postal code:
$desFSA1stLetter = substr(strtoupper($order->delivery['postcode']), 0, 1);

I just added a simple php is_numberic:
// if 1st letter is a number = US, otherwise Canadian
if( is_numeric( $desFSA1stLetter ) ) {
$request = join('&', array('service=2', ...
} else {
$request = join('&', array('service=1', ...
}

20 Mar 2008, 11:11 PM
#7
breck avatar

breck

Zen Follower

Join Date:
Sep 2007
Posts:
106
Plugin Contributions:
0

Re: CanPar Shipping XML Module

LOL - we are chasing each other.

Do you have a updated canpar module for 138?

This version doesn't work anymore.

22 Mar 2008, 11:52 PM
#8
evolver avatar

evolver

New Zenner

Join Date:
Jun 2007
Posts:
20
Plugin Contributions:
0

Re: CanPar Shipping XML Module

breck:

LOL - we are chasing each other.

Do you have a updated canpar module for 138?

This version doesn't work anymore.

Are you sure? Its working on my site atm even after an update to 1.38.

Arek

22 Mar 2008, 11:55 PM
#9
breck avatar

breck

Zen Follower

Join Date:
Sep 2007
Posts:
106
Plugin Contributions:
0

Re: CanPar Shipping XML Module

Really - I was getting alot of errors.
Must of did something wrong.

Will try it again later. Thanks for the info.

14 May 2008, 7:03 PM
#10
moonlilly avatar

moonlilly

New Zenner

Join Date:
Jan 2008
Posts:
18
Plugin Contributions:
0

Re: CanPar Shipping XML Module

It's not working on my 1.38 either... the amounts always show up as $0.00... help anyone?

27 May 2008, 12:35 AM
#11
breck avatar

breck

Zen Follower

Join Date:
Sep 2007
Posts:
106
Plugin Contributions:
0

Re: CanPar Shipping XML Module

Haven't been back to this thread for a while, and thought I would mention that I got it going. Had to reinstall the mod and everything started to work ok..

Thanks Amanda for the Can/Us fix. Code works great.

I've posted the edited file at:http://www.zen-cart.com/forum/showthread.php?t=96878&highlight=canpar

You can find it there coeus.

Replace the store/includes/modules/canpar.php with the file i attached and it works with both Canada and USA addresses.

12 Apr 2010, 10:43 PM
#12
roibert avatar

roibert

New Zenner

Join Date:
Nov 2009
Posts:
5
Plugin Contributions:
0

Re: CanPar Shipping XML Module

I'm a noob at this and i was wondering how do i install this to my site
http://www.cheapthermalpaper.com/ thank you:smile: