Skip to content

Commit

Permalink
FedEx shipping. If the customer orders on a Saturday, the rate calcul…
Browse files Browse the repository at this point in the history
…ation will use Saturday as the shipping date, and the rates will include a Saturday pickup surcharge. It was wrong.
  • Loading branch information
andreymaz committed Dec 9, 2013
1 parent ca2b3ba commit 151ee02
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Plugins/Nop.Plugin.Shipping.Fedex/Description.txt
@@ -1,7 +1,7 @@
Group: Shipping rate computation
FriendlyName: FedEx
SystemName: Shipping.FedEx
Version: 1.11
Version: 1.12
SupportedVersions: 3.20
Author: nopCommerce team
DisplayOrder: 1
Expand Down
11 changes: 10 additions & 1 deletion src/Plugins/Nop.Plugin.Shipping.Fedex/FedexComputationMethod.cs
Expand Up @@ -171,7 +171,16 @@ private void SetShipmentDetails(RateRequest request, GetShippingOptionRequest ge
request.RequestedShipment.TotalInsuredValue = new Money();
request.RequestedShipment.TotalInsuredValue.Amount = orderSubTotal;
request.RequestedShipment.TotalInsuredValue.Currency = currencyCode;
request.RequestedShipment.ShipTimestamp = DateTime.Now; // Shipping date and time


//Saturday pickup is available for certain FedEx Express U.S. service types:
//http://www.fedex.com/us/developer/product/WebServices/MyWebHelp/Services/Options/c_SaturdayShipAndDeliveryServiceDetails.html
//If the customer orders on a Saturday, the rate calculation will use Saturday as the shipping date, and the rates will include a Saturday pickup surcharge
//More info: http://www.nopcommerce.com/boards/t/27348/fedex-rate-can-be-excessive-for-express-methods-if-calculated-on-a-saturday.aspx
var shipTimestamp = DateTime.Now;
if (shipTimestamp.DayOfWeek == DayOfWeek.Saturday)
shipTimestamp = shipTimestamp.AddDays(2);
request.RequestedShipment.ShipTimestamp = shipTimestamp; // Shipping date and time
request.RequestedShipment.ShipTimestampSpecified = true;
request.RequestedShipment.RateRequestTypes = new RateRequestType[2];
request.RequestedShipment.RateRequestTypes[0] = RateRequestType.ACCOUNT;
Expand Down

0 comments on commit 151ee02

Please sign in to comment.