Add shipping charge based on state?
My client wants to add a $3 charge if she's delivering to a state west of Mississippi. Would I have to use a custom calculation for that? Can you give me an example?
Thanks - Joe
My client wants to add a $3 charge if she's delivering to a state west of Mississippi. Would I have to use a custom calculation for that? Can you give me an example?
Thanks - Joe
eCart stores the shipping state selected in a session called "eCartCheckoutForm_shipping_state_province"
you would need to hand code an array of all the states to the west of the mississippi:
$toTheWest = array();
$toTheWest[] = "CA";
$toTheWest[] = "WA";
$toTheWest[] = "UT";
$toTheWest[] = "TX";
etc...
then set a session if the selected shipping state is in the $toTheWest array:
$_SESSION['toTheWest'] = 0;
if(in_array($_SESSION['eCartCheckoutForm_shipping_state_province'], $toTheWest)) $_SESSION['toTheWest'] = 1;
in eCart create a new shipping rule as:
Based on Session Variable value:
if the session variable "toTheWest is "=" a value of "1"
Flat rate charge of "3"
Thanks, Jason - I'll give that a shot and let you know how it goes.
Jason - is the placement of the $toTheWest array creation and the session setting critical? I was going to put it on the checkout page before the WA redirect. Would that work?
Thanks - Joe
The code to create the array needs to be on the confirm page, after the code that sets the eCartCheckoutForm_shipping_state_province session variable
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.