Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Free Shipping according to UK post code

Free Shipping according to UK post code

Views: 839

Results 1 to 2 of 2
8 Aug 2011, 2:33 PM
#1
curlym avatar

curlym

New Zenner

Join Date:
Aug 2011
Posts:
1
Plugin Contributions:
0

Free Shipping according to UK post code

Hi there!
I've very new to Zen Cart, and am currently struggling with what I hoped was a simple thing. I would like to offer free post and packaging within in my post code in the UK (Pre-fix LS29). Can anyone suggest a simple way of doing this?

8 Aug 2011, 3:26 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Free Shipping according to UK post code

You could customize the Free Shipping Options freeoptions by setting the Total >= 0 ...

Then customize the code for:
/includes/modules/shipping/freeoptions.php

by adding the code in RED to it:

      // disable only when entire cart is free shipping
      if (zen_get_shipping_enabled($this->code)) {
          $this->enabled = ((MODULE_SHIPPING_FREEOPTIONS_STATUS == 'True') ? true : false);
      }

// bof: free shipping for 1 zipcode
if (!IS_ADMIN_FLAG) {
        $this->enabled = false;
        $free_ship_postcodes = array('LS29');
        $customer_postcode = $order->delivery['postcode'];
        $check4digitcode = substr($customer_postcode, 0, 4);
        $valid_digits = in_array($check4digitcode, $free_ship_postcodes);
        if ($valid_digits) $this->enabled = true;
}
// eof: free shipping for 1 zipcode

      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FREEOPTIONS_ZONE > 0) ) {