X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Pre-Login Shipping Calculator (https://forum.x-cart.com/showthread.php?t=6927)

joestern 07-02-2004 01:56 PM

Here you go...

Code:

Environment components info:
 Component Status 
X-Cart version 3.5.8   
X-Cart directory /var/www/html/cart   
PHP 4.1.2  details >>
MySQL server 3.23.58   
MySQL client 3.23.58   
Web server unknown 
Operation system Linux   
Perl 5.006001  details >>
XML parser (expat) found   
HTTPS modules
Net::SSLeay 1.23  active 
libCURL libcurl 7.8 (OpenSSL 0.9.6b) (ipv6 enabled)   
CURL executable curl 7.8 (i386-redhat-linux-gnu) libcurl 7.8 (OpenSSL 0.9.6b) (ipv6 enabled)   
OpenSSL executable OpenSSL 0.9.6b [engine] 9 Jul 2001   
HTTPS-cli executable not found 
Modules for the payment methods
VeriSign PayFlow Pro client /var/www/html/cart/payment/bin/pfpro L305   
PayBox client not found 
Saferpay client not found 
TrustCommerce (tclink.so) not found


adpboss 07-02-2004 02:30 PM

Quote:

Originally Posted by joestern
We are using FedEx rates, which were downloaded into x-cart.

It may be because Fedex doesn't actually query a server but looks up a rate sheet?

Just guessing here...

adpboss 07-02-2004 10:44 PM

Just tried on 3.5.9 with no success.

I'm using Canada Post RealTime Shipping here. :(

I expanded the text field to 6 digits (characters) in the php file and the template, but basically this doesn't work so good for me.

adpboss 07-04-2004 11:22 AM

Rackit,

I think I may have tracked down why this is not working for Fedex or Canada Post.

Mod_UPS calls for

Code:

$dst_country_code=$userinfo["s_country"];
$dst_city=$userinfo["s_city"];
$dst_zipcode=$userinfo["s_zipcode"];


Mod_CPC (Canada Post Corporation) requires

Code:

$cp_dest_country = $userinfo["s_country"];
$cp_dest_city = $userinfo["s_city"];
$cp_dest_zip = $userinfo["s_zipcode"];
$cp_dest_state = $userinfo["s_state"];


I believe that the Canada Post server validates the Postal code with the province (state).

Mod_Fedex asks for a whole bunch of stuff which is probably beyond keeping this estimator simple.

Code:

# do all these queries only if FedEx is present.
if ($FEDEX_FOUND) {

$supportHome=array('US'=>1,'CA'=>1);
$supportGrnd=array('US'=>1,'CA'=>1,'PR'=>1);

$ozip = $config["Company"]["location_zipcode"];
$dzip = $userinfo["s_zipcode"];
$s2res = ($supportHome[$userinfo["s_country"]] ? $params["param02"] : "false");
$ctyp = ($supportGrnd[$userinfo["s_country"]] ? $params["param00"] : "Express");
$isex = ($ctyp == "Express" ? true : false);
$isgr = ((($ctyp == "Ground" || $ctyp == "Both") && $s2res != "true") ? true : false);


So because I am concerned with Mod_CPC (Canada Post) I need to add the province (state) data to the information sent by the shipping estimator.

I can either

1. Let the customer choose there province from a drop down (in addition to the postal code entry)
2. Have the postal code look-up in PHP for the correct province (state) info.

Canadian Postal Codes work like this

Letter-Number-Letter<space>Number-Letter-Number

ie.
R7N 2G6
A1N 9D9
N7X 4J0

The first character a letter dictates which province the postal code is for. List for lookup in PHP purposes.

Newfoundland/Labrador - "A"
Nova Scotia - "B"
Prince Edward Island - "C"
New Brunswick - "E"
Quebec - "G", "H", "J"
Ontario - "K", "L", "M", "N", "P"
Manitoba - "R"
Saskatchewan - "S"
Alberta - "T"
British Columbia - "V"
Northwest and Nunavut Territories - "X"
Yukon Territory - "Y"

I could use some help and would be happy to donate or something. I can guarantee that an ENTIRE nation of X-Cart users would be very excited and grateful to have this mod. ;)

joestern 07-04-2004 07:28 PM

I'd also be delighted to donate for the time it takes to tinker the code to work with FedEx lookup!

adpboss 07-09-2004 08:38 PM

Is this dead, because I only need a little help with the PHP to add a Canadian Postal Province (state) drop down and have it submit with the postal code.

It's worth some money to me if anyone is listening...

rackit 07-09-2004 08:51 PM

which parts exactly do you need help with?

adpboss 07-09-2004 10:14 PM

IN my second to last post (before this one)i chronicled how Canada Post needs one more piece of info over UPS. I need the state.

I think the easiest way is to use a drop down.

I am good at Smarty but lousy at PHP. I have no idea how to get started.

adpboss 07-15-2004 10:20 PM

BUMP

doersam@hotmail.com 07-21-2004 11:08 PM

Can't get this modification to work in 3.5.10
 
I can't get the zip code calculation to show up in 3.5.10 Can anyone tell me exactly where in the cart_totals.tpl I should insert the code? Thank you very much.


All times are GMT -8. The time now is 01:36 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.