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.
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
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:
foreach $row(@services) {
my ($service_name,$service_rate) = @$row;
And right above it, add:
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.
Offline
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
Sorry. The line:
} elsif ($trackitem_shipcountry eq "$name_us" && ($trackitem_shipstateprov ne "Alaska" && $trackitem_shipstateprov ne "Hawaii") {
Should have an extra paren as in:
} elsif ($trackitem_shipcountry eq "$name_us" && ($trackitem_shipstateprov ne "Alaska" && $trackitem_shipstateprov ne "Hawaii")) {
Offline
I have added the update and still not getting free shipping. Still figuring shipping the same way.
Offline
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.
Offline
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
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)?
Offline
no, I did not change a thing, in fact this was a fresh upgrade install.
Offline
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
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:
foreach $row(@services) {
my ($service_name,$service_rate) = @$row;
And right above it, add:
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.
Offline
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
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.
Offline
OK now this is what I get, the code can't be right
Shipping Method *
Standard Carrier - $15.00
Offline