Blog posts tagged with '1.07'

Shipping Director Setting - Sort Expression- Friday, March 8, 2013

Shipping Director introduced a Sort Expression in version 1.07.  The sort expression should evaluate to a string that represents an 'ordering clause'.  The ordering clause is one or more (comma separated) shipping option fields: Rate, Name, Description.  Each field can optionally be followed by ASC or DESC (the default is ASC = Ascending).   

Examples (Don't forget, it's a string Expression, so it's typically enclosed in double quotes):
"Rate ASC" 
"Name DESC" 

Example using ternary if-then-else  - If the cart weight <= 150, then sort by Rate, otherwise use the default sort. (The default is used when the expression results in blank string):
[$TotalWeight] <= 150 ? "Rate ASC" : "" 

In this example, we'd like to sort by Rate, but we want the "Pick up ..." option at the end, so sort by Name "prefix" then Rate:

"Name.SubstringBefore("" ""), Rate" 

FedEx Ground ($15.23) 
FedEx Express Saver ($51.51) 
FedEx Standard Overnight ($88.95) 
FedEx Priority Overnight ($108.35) 
Pick up at our warehouse ($0.00) 

UPDATE 2020-09-17  More example sort expressions:

Explicit sort of names (using ' ? : '  if-then-else operator):  

"Name = ""Ground"" ? 1 : Name = ""Priority"" ? 2 : Name = ""Special"" ? 3 : 4"

Tags :  1.07Sort
Comments (1)
Shipping Director 1.07 available for NopCommerce 2.70 and 2.65- Wednesday, December 5, 2012
Here are the new features (I'll blog about them in more detail soon :)

SortExpression setting
  An optional sort of the options after all records have been processed.
  You can sort the options by any expression involving the shipping option fields: Rate, Name, Description

Query Expression support for First(), FirstOrDefault() and Select()
  e.g. Instead of saying Items.Where(...).First(), you can just say Items.First(...)

More Extension functions:
    GetAttributeValues(attributeName, valueSeparator)
    HasAttributeValue(attributeName, valueName)
  A store owner or developer can test their shipping calculations in the configuration page.  Testing here is not limited to the 5 transaction limit in trial/evaluation mode.
  You can select a customer to use test cart/address. (You must take that test customer through checkout process to the point of shipping address selection for that address to be stored with customer.)

Export tab delimited
Import tab delimited 
  Export/Import is not only great for backup and migrations, but also allows store owner to use different shipping scenarios with ease.
  Additionally, you can work in Excel where data entry can be easier for advanced users - just save as "Text (tab delimited)".

Tags :  1.07
Comments (1)