"Saturday Delivery" method, but only show it on Friday


You can use the day of week in your expressions.  For example, if you need to have Saturday Delivery, but only want to show that option on Friday, here's an example using Shipping By Weight. You can create another Shipping Method (e.g.  "Saturday Delivery"), and Shipping Director can exclude it conditionally (when not Fri) by using Name Expression.

The Name Expression would look like this (assuming your method name has the word "Saturday" in it - e.g.  "Saturday Delivery") :

    [$Name].Contains("Saturday") and DateTime.Today.ToString("ddd") <> "Fri" ? "" : [$Name]

Note, though, that you may also want to check the Time too (because if they place the order Fri at 11pm, you may not be able to get it there Sat ;)

Another example would be to show an additional set of shipping options with a surcharge.  For example, if you use Shipping By Weight, you can call it twice with the Option type. The 2nd call would check if the country is Belgium and the day of the week is Thu or Fri; it would have a Surcharge Expression, in this case just a fixed 2.50:

Order

Type

Name

Expression

Rate Expression

Surcharge Expression

110

Option

By Weight

true

Shipping.ByWeight

 

100

Boolean

AllowSaturday

Country = "BE" and "Thu,Fri".Contains(DateTime.Today.ToString("ddd"))

 

 

120

Option

By Weight Sat

[AllowSaturday]

Shipping.ByWeight

2.50

Tags :  Day-of-week
Comments
Leave your comment
:
sample@email.tst
Created on: 6/26/2023 5:31 PM
1
sample@email.tst
Created on: 6/26/2023 5:31 PM
1