Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 10-03-2003 18:44:05

5150tone
Member
Registered: 10-03-2003
Posts: 10

Free Shipping For Usa Customers Only

  wink I am needing help with the following.

I am currently running both USPS and UPS Realtime Shipping perfectly.

However, what I am needing to do is setup FREE SHIPPING for the lower 48 states and charge for shipping for Hawaii, Alaska and everywhere else in the country using our existing realtime shipping format.

We would like to also offer free shipp to those USA customer for purchases above 50.00.


Anyone have any ideas of how to do this?

Offline

 

#2 10-05-2003 14:34:06

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19976
Website

Re: Free Shipping For Usa Customers Only

Sure. Make no changes to your data, instead make changes to the routine 'ste_chkout_meth_realtime_proc' in the file ./cgi-bin/library/modules/ste_chkout.pl. Look for:

Code:


foreach $row(@services) {

my ($service_name,$service_rate) = @$row;

And right above it, add:

Code:


if ($tracking_subtotal >= "50" && $trackitem_shipcountry eq "$name_us") {

@services = ();
@services_temp = ('UPS Ground','0.00');
push(@services,[@services_temp]);

} elsif ($trackitem_shipcountry eq "$name_us" && ($trackitem_shipstateprov ne "Alaska"  && $trackitem_shipstateprov ne "Hawaii") {

@services = ();
@services_temp = ('UPS Ground','0.00');
push(@services,[@services_temp]);

} ######### End of if statement.


Nick Hendler

Offline

 

#3 10-06-2003 18:12:51

5150tone
Member
Registered: 10-03-2003
Posts: 10

Re: Free Shipping For Usa Customers Only

Made the adjustment and this is the error I get

Script Execution Error
The following error was just encountered:

syntax error at /home/tunnelv/www/cgi-bin/library/modules/ste_chkout.pl line 2972, near ") {" syntax error at /home/tunnelv/www/cgi-bin/library/modules/ste_chkout.pl line 3141, near "}" Compilation failed in require at /home/tunnelv/www/cgi-bin/library/common/initialize.pl line 292. 

Offline

 

#4 10-07-2003 06:57:34

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19976
Website

Re: Free Shipping For Usa Customers Only

Sorry.  The line:

Code:


} elsif ($trackitem_shipcountry eq "$name_us" && ($trackitem_shipstateprov ne "Alaska"  && $trackitem_shipstateprov ne "Hawaii") {

Should have an extra paren as in:

Code:


} elsif ($trackitem_shipcountry eq "$name_us" && ($trackitem_shipstateprov ne "Alaska"  && $trackitem_shipstateprov ne "Hawaii")) {


Nick Hendler

Offline

 

#5 10-07-2003 20:25:46

5150tone
Member
Registered: 10-03-2003
Posts: 10

Re: Free Shipping For Usa Customers Only

I have added the update and still not getting free shipping. Still figuring shipping the same way.

Offline

 

#6 10-08-2003 07:05:29

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19976
Website

Re: Free Shipping For Usa Customers Only

Have you changed the names of the United States and/or Alaska or Hawaii under Orders & Payment | Manage Countries and/or Manage States/Provinces?  The code, if placed in the right spot, does work.


Nick Hendler

Offline

 

#7 10-08-2003 14:05:46

5150tone
Member
Registered: 10-03-2003
Posts: 10

Re: Free Shipping For Usa Customers Only

This is how it looks, it was added just like you stated


#########
######### Loop through the services array and add choices as we go.
#########

if ($tracking_subtotal >= "50" && $trackitem_shipcountry eq "$name_us") {

@services = ();
@services_temp = ('UPS Ground','0.00');
push(@services,[@services_temp]);

} elsif ($trackitem_shipcountry eq "$name_us" && ($trackitem_shipstateprov ne "Alaska" && $trackitem_shipstateprov ne "Hawaii")) {

@services = ();
@services_temp = ('UPS Ground','0.00');
push(@services,[@services_temp]);

} ######### End of if statement.

foreach $row(@services) {

my ($service_name,$service_rate) = @$row;

if (defined($shiprealtimep_name{$service_name})) {

$service_count++;

$service_mark = "$shiprealtimep_mark{$service_name}";
$service_name = "$shiprealtimep_name{$service_name}";

if ($service_mark ne "N") {

$service_name .= " \($service_mark\)";

} ########## End of if statement.

Offline

 

#8 10-09-2003 07:09:22

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19976
Website

Re: Free Shipping For Usa Customers Only

What I'm asking is - did you change the name for the United States entry anywhere in the database (either under Manage Countries or Manage Store Settings)?


Nick Hendler

Offline

 

#9 10-09-2003 09:40:42

5150tone
Member
Registered: 10-03-2003
Posts: 10

Re: Free Shipping For Usa Customers Only

no, I did not change a thing, in fact this was a fresh upgrade install.

Offline

 

#10 10-10-2003 07:35:57

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19976
Website

Re: Free Shipping For Usa Customers Only

Arg!  You're going to kill me.  Where you see all of the variables in that code that start with '$trackitem_' change to '$fd_trackitem'.


Nick Hendler

Offline

 

#11 10-10-2003 11:23:39

5150tone
Member
Registered: 10-03-2003
Posts: 10

Re: Free Shipping For Usa Customers Only

OK I made the changes and now there is no shipping fee on everything. For example I placed and order for a product that was 29.95 and selected to have it shipped to Utah. It should have been charged for shipping since the price was under 50.00 however it brought up the shipping method ( US Mail) but there were no fees charged they displayed as 0.00 for the amount with no shipping options.

Sorry this just isn't working.

Offline

 

#12 10-13-2003 07:45:22

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19976
Website

Re: Free Shipping For Usa Customers Only

That's what you asked for - free shipping to continental US and free shipping to AK & HI if over $50.


Nick Hendler

Offline

 

#13 10-13-2003 11:42:58

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19976
Website

Re: Free Shipping For Usa Customers Only

From Email:



also it was only suppose to be free shipping to the lower USA States if
purchase was over 50.00.

Hawaii, Alaska and all other countries outside of the USA get charged for
all shipping regardless of cost..

Make changes to the routine 'ste_chkout_meth_realtime_proc' in the file ./cgi-bin/library/modules/ste_chkout.pl. Look for:

Code:


foreach $row(@services) {

my ($service_name,$service_rate) = @$row;

And right above it, add:

Code:


if ($tracking_subtotal >= "50" && $fd_trackitem_shipcountry eq "$name_us" && ($fd_trackitem_shipstateprov ne "Alaska"  && $fd_trackitem_shipstateprov ne "Hawaii")) {

@services = ();
@services_temp = ('UPS Ground','0.00');
push(@services,[@services_temp]);

} ######### End of if statement.


Nick Hendler

Offline

 

#14 10-13-2003 15:51:14

5150tone
Member
Registered: 10-03-2003
Posts: 10

Re: Free Shipping For Usa Customers Only

OK that works!

However......................

In my eyes of perfection there is one more tweek!

Yes free shipping is working but say you have a product that is mark as shipped via the US Mail, when you get to the shipping screen the shipping methods do not match. USP Ground 0.00 - US Priority Mail


This is the final fix.

If the product is setup to ship via US Priority Mail it should show free shipping for that service

Offline

 

#15 10-14-2003 07:40:14

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19976
Website

Re: Free Shipping For Usa Customers Only

For this, change:



if ($tracking_subtotal >= "50" && $fd_trackitem_shipcountry eq "$name_us" && ($fd_trackitem_shipstateprov ne "Alaska"  && $fd_trackitem_shipstateprov ne "Hawaii")) {

@services = ();
@services_temp = ('UPS Ground','0.00');
push(@services,[@services_temp]);

} ######### End of if statement.

To:



if ($tracking_subtotal >= "50" && $fd_trackitem_shipcountry eq "$name_us" && ($fd_trackitem_shipstateprov ne "Alaska"  && $fd_trackitem_shipstateprov ne "Hawaii")) {

@services = ();

if ($shiptype eq "USPS") {

@services_temp = ('US Mail','0.00');

} else {

@services_temp = ('UPS Ground','0.00');

} ######### End of if statement.

push(@services,[@services_temp]);

} ######### End of if statement.


Nick Hendler

Offline

 

#16 10-14-2003 09:17:40

5150tone
Member
Registered: 10-03-2003
Posts: 10

Re: Free Shipping For Usa Customers Only

OK now this is what I get, the code can't be right

Shipping Method *

Standard Carrier - $15.00

Offline

 

#17 10-15-2003 08:01:38

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19976
Website

Re: Free Shipping For Usa Customers Only

No, that's right.  Maybe you didn't set up your USPS connection and are getting an error back from the processor (which would circumvent this code).


Nick Hendler

Offline

 

Board footer