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 12-20-2008 12:32:44

enchant
Member
From: Marshfield, MA
Registered: 02-02-2005
Posts: 84
Website

Fedex charging extra for Saturday

In my ongoing problemfest with Fedex, we find that purchases made on Saturdays have MUCH higher prices returned by Fedex than on other days.  A Fedex rep believes that this is because we must be specifying Saturday as a pickup day.

Is there any way to specify the next weekday, or simply not specify a day?

Offline

 

#2 12-20-2008 12:55:16

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Fedex charging extra for Saturday

I ran into this before.  By default, CCP does not specify a day.  And in the absence of a specified day, the FedEx API assumes the same day as the quote.   To change this behavior, you'll need to edit ste_ship.pl.  For instructions about editing PERL files, search previous posts on the forum.  Make a backup first, and if you aren't sure about what you're doing, consider professional assistance (Stephen at cartmod.com).  To proceed, locate the following code (around line 1365 or thereabouts):

Code:

$rescom = ste_ship_encodetxt($rescom);
$packaging_type = ste_ship_encodetxt($packaging_type);
$weight = ste_ship_encodetxt($weight);
$drop_off_type = ste_ship_encodetxt($drop_off_type);

Right  the above, insert the following code block:

Code:

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

### Mod for Sending Ship Date On Next Weekday

my $epoch = time();
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = localtime($epoch);
if ($wday eq 5) {
  $epoch += 259200;
} elsif ($wday eq 6) {
  $epoch += 172800;
} else {
  $epoch += 86400;
} ## endif
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = localtime($epoch);
$year += 1900;
$mon ++;
$mday = sprintf("%02d",$mday);
$mon = sprintf("%02d",$mon);
my $ship_date = "$year$mon$mday";
$ship_date = ste_ship_encodetxt($ship_date);

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

Then, locate this code (around line 1479 or thereabouts):

Code:

$request_string .= "1401,\"$weight\"";
$request_string .= "1333,\"$drop_off_type\"";

Right  the above, insert this code block:

Code:

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

####### Append Ship Date Field to Request ########

$request_string .= "24,\"$ship_date\"";

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

That will append a ship date field to the request so that the FedEx API will not assume the current day.  Right now, it should be set up to use the next week day, but you can easily modify the times above (they're in seconds) to put it as far in the future as you'd like (I used to keep it set to one week in the future when I was using FedEx).  I haven't used FedEx in a while, but that was working last I checked.  Of course, use at your own risk and if it doesn't work, revert to your backup.  Good luck!


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#3 12-20-2008 14:32:12

enchant
Member
From: Marshfield, MA
Registered: 02-02-2005
Posts: 84
Website

Re: Fedex charging extra for Saturday

Rachael, YOU DA MAN.

Easy edits and it worked first time!

On behalf of my client...

Thank you!!

Offline

 

#4 12-20-2008 16:17:43

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Fedex charging extra for Saturday

Well, technically I'm Da BatGirl smile  But I take your meaning, and thank you.  I'm glad it worked for you!


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#5 12-20-2008 16:28:05

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Fedex charging extra for Saturday

Whew, I was a bit worried there for a moment big_smile big_smile

Offline

 

#6 12-20-2008 16:59:40

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Fedex charging extra for Saturday

Me too!  LOL! big_smile


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#7 12-20-2008 18:15:04

enchant
Member
From: Marshfield, MA
Registered: 02-02-2005
Posts: 84
Website

Re: Fedex charging extra for Saturday

I figure "da man" is sort of ambidextrous.

Offline

 

#8 12-20-2008 18:44:39

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Fedex charging extra for Saturday

And all this time I thought he was left handed tongue


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

Board footer