Free delivery for Postcodes
Hi,
Would like to create a shipping rule where shipping is FREE if the order postcode is listed in the FREE postcode database I have created.
Any ideas?
Thanks
Hi,
Would like to create a shipping rule where shipping is FREE if the order postcode is listed in the FREE postcode database I have created.
Any ideas?
Thanks
you would need to create a recordset to lookup the entered postal code, then set a session variable using Recordset Not Empty trigger to signal that the postal code was found. set the value of the session to 1.
in your shipping rule, add a trigger for Based on session variable value:
if the Session Variable "freeShipping" is "!=" a value of "1"
this will cause shipping to be applied only if the postal code is not found.
ok that makes sense...
But I cant understand how to write the rule what exactly would the rule look like? Id there a guide for how to write rules?
Its a while since I have used eCart rules but I am pretty sure that you just trigger it based on a value.
You would set it to use a shipping value of 0 if a certain value is found. I think the trigger terminology is 'Based on a value'
And in the value field you would write
$_SESSION['freeshipping'] == '1'
Sorry for being a bit vague, but hopefully will point in the right direction a bit.
Cheers
Ian
Ok thanks I understand how to write rules now - thanks... I now have another issue.
I want the Shipping to show up when
No free postcode is set and the total cart amount is less than $150 - so the only way the shipping should be removed is when 2 conditions are met at once. Shipping Free Postcode set, and cart amount more than $150
function WAEC_eCart1_fREE() {
$totalShipping = 0;
if (true && (((isset($_SESSION['freePostcode'])?$_SESSION['freePostcode']:"") != "1") && ($this->TotalColumn("TotalPrice") < 150))) {
$totalShipping += 10;//Result
}
I have the Free Postcode Part Working and I can Get the under $150 to work, but when I add them as one rule is never adds shipping to the order?
Wouldn't you just setup a separate trigger / rule rather than trying to join the two?
So if the free post code condition is met - you get free shipping
If the value of the total is > 150 - you get free shipping
Otherwise, the shipping is applied.
Cheers
Ian
Hi Ian,
And thanks for a reply - yes that would make sense and I would do that if the rules were separate..
In this rule, both conditions need to be met at once in order to have free shipping, not one or the other...
eg.... If the free postcode is set to true, but the cart subtotal is less than $150 then no free delivery
if Cart contents is over $150 but the Free postcode is not set - no free delivery.
Only when the cart subtotal and the free post condition is met - does the client get free shipping
in the shipping rule, set the triggers as:
Based on Session Variable value:
if the session variable "'freePostcode" is "!=" a value of "1"
AND
Based on Cart Subtotal:
if the Subtotal For the Cart is "<" a value of "150"
Hi Jason,
Yep thats exactly what I have done - but its not working for some reason..
As I mentioned I tried each rule individually - then logic dictates that all I need to do is, as you said, add them to the one trigger with the AND separator.
But it does not seem to work - I have tried every combination...
Here is my proccess...
I have added a recordset called rsFreepostcode...When the Postcode field is posted from the Chekout.php the recordset looks to see if the postcode exists... after the recordset I execute the following code to the confirm.php
session_start();
if($row_rsFreepostcode['freePostcode_postcode'] != "") {
$_SESSION['freePostcode'] = '1';
} else {
$_SESSION['freePostcode'] = '0';
}
I then added the Session rule to ecart if the Session Variable "freeShipping" is "!=" a value of "1"
Now by itself this works fine...
I then added the; if the Subtotal For the Cart is "<" a value of "150" ....... AND separated
but it is triggering individually - or not triggering at times - its seems a bit random
I have created a support ticket so we can look into this issue further.
To view and edit your support ticket, please log into your support history:
supporthistory.php
If anyone else is experiencing this same issue, please append to this thread.
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.