Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Geo Zone Shipping by County UK, SCOTLAND, NI etc OSC V4.XXXXX


warleb2

Recommended Posts

So I have now solved my shipping cost issues and want to share what I have done.

My store in particular sells high end goods.  So it was important for me to get the shipping costs correct.

So Northern Ireland, Scotland, England & Wales have there own shipping costs.  There are many ways to handle the shipping costs but there is nothing that can do it based on where the customer lives.  This can be extended to the Highlands and Islands of Scotland also.  Even a seperate one for Jersey, Guernsey if needed.

Step 1
First step you need to visit settings>Locations>Geo Zones

Step2
Create your Geo Zone Shipping Areas.   In my case I create Scotland, Northern Ireland, and Free Shipping (This is the free shipping for the UK and Wales)

image.png.7bac0002dd969e5f7ff94b0e6e6c6835.png

So drilling down into the Northern Ireland Geo Zone I can enter all of the Counties Here
image.thumb.png.ef016a21b296a8b4bed189ffcfe25e6b.png

 

Step 3
So now I want to create a new shipping module for Northern Ireland only and only for people that live in these counties

So now we access via FTP or CPANEL of what ever you use
Lib>Common>modules>ordershipping

Here I will take a copy of flat.php and this will be the Northern Ireland shipping module

I rename it to NI.php and modify the following important values:

Class XX extends Moduleshipping {     'the XX has to be unique for any new shipping module'

In this case I change it to NI

image.png.046fc060d003902611ae2d790dfac5b8.png

The next important steps are anything that contains MODULE_SHIPPING_XXXXXXX.  Rename XXXXXX to be your new shipping module name.  In my case I have chosen NI.  

Change this for all values in the file.
example
class NI extends ModuleShipping {

    var $code, $title, $description, $icon, $enabled;

    protected $defaultTranslationArray = [
        'MODULE_SHIPPING_NI_TEXT_TITLE' => 'NI Rate',
        'MODULE_SHIPPING_NI_TEXT_DESCRIPTION' => 'NI Rate',
        'MODULE_SHIPPING_NI_TEXT_WAY' => 'Northern Ireland'
    ];

// class constructor
    function __construct() {
        parent::__construct();

        $this->code = 'NI';
        $this->title = MODULE_SHIPPING_NI_TEXT_TITLE;
        $this->description = MODULE_SHIPPING_NI_TEXT_DESCRIPTION;
        if (!defined('MODULE_SHIPPING_NI_STATUS')) {
            $this->enabled = false;
            return;
        }
        $this->sort_order = MODULE_SHIPPING_NI_SORT_ORDER;
        $this->icon = '';
        $this->tax_class = MODULE_SHIPPING_NI_TAX_CLASS;
        $this->enabled = ((MODULE_SHIPPING_NI_STATUS == 'True') ? true : false);

Step4
Once you have changed all of the values save your changes.
Now move that file back into the Lib>Common>modules>ordershipping folder

Step5
Now head to modules>shipping>offline and click show not installed.  The file you created will be shown below.  Click intsall
image.thumb.png.3baf7e77172e2f6208f680d99d6699d7.png

The result is as follows
image.thumb.png.d074298db365134c72380584965e6da1.png

Attach you new Geo Zone to it
image.thumb.png.96829d4357f88c88847988b5059f0343.png

And make sure it is enabled for checkout etc...

Now when a customer orders an item from my store they will be charged the correct shipping rate.  This is how I am doing it and for me it works as I need it to work

image.png.92fe9b9024483122ad650cfcb545264d.png

If a customer lives in Scotland lets say Aberdeen then when they enter the county the shipping will be applied

image.png.26e4f343fa2dec003a580b641db3e102.png

 

or freeshipping for Bedfordshire
image.png.aebb580d2f6a69d249870332752658fa.png

 

Make sure you select United Kingdom in the settings
image.png.f0f57ca997cb53a515dd599a1e09505b.png


Hope it helps

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...