Shipping rule based on Postcode
Hi
I need to be able to set up a shipping rule based on the first three charactors of the postcode in the shipping address. Within the Ecart Object I can set eCartCheckoutForm_shipping_postcode session variable == NE3 which produces the following in the WA_eCart_definition_PHP.php file:
function WAEC_WA_Store_Cart_FreeDelivery() {
$totalShipping = 0;
if (true && (($this->InCart("1") == true) && ((isset($_SESSION['eCartCheckoutForm_shipping_postcode'])?$_SESSION['eCartCheckoutForm_shipping_postcode']:"") == "NE3"))) {
$totalShipping += 0;//Result
}
What I want though is to only check the first three charactors so if someone enters NE3 123 the rule will still be applied.
There doesnt seem to be the option to do this within the Dreamweaver eCart Object box so I assume I need to make a change to the definition file.
Unfortunately I am not very fluent in PHP but believe I need to add a substr command somwhere to only look at the first 3 charactors of the 'eCartCheckoutForm_shipping_postcode' variable but I am not sure where it should go.
Please can you help?
Thanks
Jon