Blog posts of '2012' 'April'

RSS
More Complex Free Shipping Scenario- Monday, April 23, 2012

This is a more complex free shipping scenario that involves multiple free shipping methods (Fedex Ground & Standard), and also a "$5 Next Day Shipping".  So, some items can get Free Ground, other items can get Free Next Day, and other items can get $5 Next Day.  I won't go into too much detail about how this one works, so you should read the prior blog to understand the idea of packing for free shipping, and the multiple Option type records.  I know it looks a little daunting.  In the future I hope to provide a simpler interface, or the nopCommerce core will support product level shipping configuration.

Similar to last blog, separate Categories are used to pidgeonhole the products.  Note the Reference variable hasReducedNextDayShipping;  this covers both free next day and $5 next day.   The Fedex Name for standard next day is "FedEx Standard Overnight".   The idea is to first use Option(FedEx) to get the rates for all the products, then Pack/OptionReplace to get (replace) the rates for non-reduced items.  Finally, add in rate for $5 Next day items.

Note the new Packing method "Packing.ClearPackages".  This restores the original "single package" which is the default state prior to any other packing methods being used.  This is necessary because the Option record type with a  Rate Expression that is not a shipping method like Shipping.Fedex applies the Rate Expression for each package; we just want one package because we calculate variable "Number of $5 NextDay Items" based on sum of item quantities.  Then the last Option type record adds the appropriate number of $5 per item charges to the "FedEx Standard Overnight" rate (after it's been previously calculated by Fedex for the non-reduced next day items if any).

EvalType

Name

Expression

RateExpression

NameExpression

DescriptionExpression

Reference

HasCategory

ProductVariant.Product.ProductCategories.Any

 

 

 

Reference

hasReducedGroundShipping

[@HasCategory]
(Category.Name.Contains("Ground Shipping"))

 

 

 

Reference

hasReducedNextDayShipping

[@HasCategory]
(Category.Name.Contains("Next Day Shipping"))

 

 

 

Reference

has5$NextDayShipping

[@HasCategory]
(Category.Name = "$5 Next Day Shipping")

 

 

 

Integer

Number of $5 NextDay Items

Items.Where
([@has5$NextDayShipping]).Sum(Quantity)

 

 

 

Option

FedEx All Items

true

Shipping.Fedex

 

 

Packing

Pack exclude reduced-ground items

Items.Any([@hasReducedGroundShipping])

Packing.FirstFitSingleBox

 

[@hasReducedGroundShipping]

OptionReplace

FedEx Ground Only

Items.Any([@hasReducedGroundShipping])

Shipping.Fedex

[$Name].Contains("Ground")
 ? [$Name] : ""

 

Packing

Pack exclude
reduced-nextday items

Items.Any([@hasReducedNextDayShipping])

Packing.FirstFitSingleBox


[@hasReducedNextDayShipping]

OptionReplace

FedEx NextDay Only

Items.Any([@hasReducedNextDayShipping])

Shipping.Fedex

[$Name].Contains("Standard")
 ? [$Name] : ""

 

Packing

Clear Packages For Fixed Rates

true

Packing.ClearPackages

 

 

Option

$5 NextDay

Items.Any([@has5$NextDayShipping])

[Number of $5 NextDay Items] * 5.00

"FedEx Standard Overnight"

 

Tags :  FreeShipping
Comments (2)
Packing removes Free Shipping items- Monday, April 23, 2012

When configuring a product variant you can select "Free Shipping:".   However, there are a few caveats you should know.

1) If ALL the items in the cart are marked Free Shipping, then the shipping charge will be $0 regardless of any shipping method or configuration (country/weight, etc).  Even Shipping Director cannot override this, as it is calculated in the core system.

2) Free Shipping is currently not respected by online rate methods (FedEx, UPS, USPS, etc.).  It is respected by the offline methods ByTotal, and ByWeight.  And, it's also respected by Shipping Director's Packing.

By "respected", I mean that all the product items will be counted in the weight/dimensions.  To get an accurate rate, you need to only get a rate based on the weight/dimensions of the non-free-shipping items.

So, a simple setup to use the product variant Free Shipping with an online method looks like this

Type

Name

Expression

Rate Expression

Packing

Pack ignores items marked FreeShipping

true

Packing.FirstFitSingleBox

OptionExit

FedEx only sees packed items

true

Shipping.Fedex

However, the above will (for items that are not free shipping) calculate rates  for ALL the shipping methods - Ground, Priority, Standard, etc.

If you want to only offer Free Ground Shipping then it is necessary to first get a rate quote for all items, and then get a rate quote for just the non-free-shipping items for just the Ground method.  But, as pointed out above, if ALL items are marked Free Shipping in the product variant, then we always get a $0 rate.  So, we can't use the Free Shipping checkbox on the variant.  Instead, I recommend using a Category.  Set up a "Free Ground Shipping" Category, and mark it as unpublished (i.e. uncheck "Published" check box).  If the category is unpublished, you can still put products in the category, but it won't appear in the category navigation tree or elsewhere.   (If you need free ground on only a specific variant of a product, then you'll have to use some other mechanism; we won't cover that here.)

To get Ground only rates, we need to exclude certain methods (e.g. Priority, Standard).  For that we need to use the Option record type's ability to modify the shipping method Name returned by the offline shipping method; if the Name Expression evaluates to blank (""), then the entire method/rate is excluded.    Also, we need to replace the the first Ground rate calculated on all the product items.  For that, we use the new OptionReplace type.  The "Option" type adds rates to existing same-Name methods, whereas "OptionReplace" will replace the rate.

So, assuming we are not using product variant Free Shipping and instead using Categories, it looks like this - Get rates for all methods, pack only the non-Free Shipping items (by excluding Free-Shipping items), get the rates again but only keep the Ground rate replacing the original Ground rate.

EvalType

Name

Expression

Rate Expression

Name Expression

Description Expression
(Exclude)

Reference

hasFreeGroundShipping

Product.HasCategory("Free Ground Shipping")

 

 

 

Option

FedEx All Items

true

Shipping.Fedex

 

 

Packing

Pack exclude free-ground items

Items.Any([@hasFreeGroundShipping])

Packing.FirstFitSingleBox

 

[@hasFreeGroundShipping]

OptionReplace

FedEx Ground Only

Items.Any([@hasFreeGroundShipping])

Shipping.Fedex

[$Name].Contains("Ground")
? [$Name] : ""

 

Don't forget, you can use the $Debug variable as your first record, and this will provide detailed processing messages in the System Log (view source of page for readability).

EvalType

Name

Expression

Boolean

$Debug

true


(The above blog was updated 9/8/2013.  Older versions of Shipping Director did not have HasCategory() function, and used a more complex expression to get the Category – it had two References rather than one:

EvalType

Name

Expression

Reference

HasCategory

ProductVariant.Product.ProductCategories.Any

Reference

hasFreeGroundShipping

[@HasCategory](Category.Name =
 "Free Ground Shipping")


Tags :  PackingFreeShipping
Comments (0)
Shipping Director 1.05 available for NopCommerce 2.5- Monday, April 23, 2012

We've released Shipping Director 1.05 for NopCommerce 2.50.  You can download it from the Download Trial link on its product page.

I'll blogged about the new features shortly.  In brief:
  Support for complex Free Shipping and Reduced Shipping scenarios  (by Product, Category, etc.)

  Support for multi-location shipping
    - Pass location info to other shipping plugins
    - Sum rates for same method name :  e.g. FedEx Ground & UPS Ground  ==> "Ground"

  Can pack multiple times for complex scenarios

  Fabricate a package of given dimensions (CreatePackageFromBoxDims)
    - e.g. Convert Quantity into a Package Weight so you can use ByWeight shipping plugin's method/country/weight setup

  HTML entry in expression fields (for example, you can put map links in shipping description field)

  XML parsing - e.g. allows access to Checkout Attributes  ( SelectSingleNode() ) 

  Goto linenumber  (for complex flow control)

Comments (0)