warleb2 Posted May 19, 2023 Share Posted May 19, 2023 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) So drilling down into the Northern Ireland Geo Zone I can enter all of the Counties Here 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 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 The result is as follows Attach you new Geo Zone to it 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 If a customer lives in Scotland lets say Aberdeen then when they enter the county the shipping will be applied or freeshipping for Bedfordshire Make sure you select United Kingdom in the settings Hope it helps CHD-UK and Ken Shea 2 Quote Link to comment Share on other sites More sharing options...
Ken Shea Posted May 20, 2023 Share Posted May 20, 2023 I can see where that was a big deal for you to get right and your sharing will surely save others a lot of time and frustration. warleb2 1 Quote Link to comment Share on other sites More sharing options...
CHD-UK Posted May 20, 2023 Share Posted May 20, 2023 Thanks for sharing Steve, excellent write up! remember to keep a local copy just incase the files are removed with a future update. warleb2 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.