• Resolved Jamie

    (@scragglydoggames)


    Hi all,

    This isn’t a support request, but just wanted to put a step by step guide here for anyone who’s trying to add shipping zones for Northern Ireland, as I spent quite some time today trying different things and threads to get it working, and hopefully it’ll save at least one other person the headache! No need to edit functions etc this way.

    So in my case, the website I’m working on ships to Ireland and Northern Ireland at one rate, and then UK & Rest of World at the other.

    Just before I start, I also had Woocommerce Table Rate Shipping installed, as my friend was shipping items in 1’s or 2’s (ie 3 is 1×1 & 1×2), but should work fine without this.

    Into Woocommerce / Settings / Shipping

    I set up 3 zones, and then everything else in Locations not covered

    Ireland – Region = Ireland
    Northern Ireland – Region = UK, postcode = BT*
    UK (excluding NI) – Region, UK, postcode (the following list which you can copy/paste)

    PL*
    PH*
    PE*
    PA*
    OX*
    OL*
    NW*
    NR*
    NP*
    NN*
    NG*
    NE*
    N*
    ML*
    MK*
    ME*
    M*
    LU*
    LS*
    LN*
    LL*
    LE*
    LD*
    LA*
    L*
    KY*
    KW*
    KT*
    KA*
    IV*
    IP*
    IG*
    HX*
    HU*
    HS*
    HR*
    HP*
    HG*
    HD*
    HA*
    GU*
    GL*
    G*
    FY*
    FK*
    EX*
    EN*
    EH*
    EC*
    E*
    DY*
    DT*
    DN*
    DL*
    DH*
    DG*
    DE*
    DD*
    DA*
    CW*
    CV*
    CT*
    CR*
    CO*
    CM*
    CH*
    CF*
    CB*
    CA*
    BS*
    BR*
    BN*
    BL*
    BH*
    BD*
    BB*
    BA*
    B*
    AL*
    AB*
    PO*
    PR*
    RG*
    RH*
    RM*
    S*
    SA*
    SE*
    SG*
    SK*
    SL*
    SM*
    SN*
    SO*
    SP*
    SR*
    SS*
    ST*
    SW*
    SY*
    TA*
    TD*
    TF*
    TN*
    TQ*
    TR*
    TS*
    TW*
    UB*
    W*
    WA*
    WC*
    WD*
    WF*
    WN*
    WR*
    WS*
    WV*
    YO*
    ZE*

    ******

    So now when you check out with a NI postcode, it’ll show the NI postage, whereas if you use any other UK postcode it’ll show the other rates you have set (btw the reference I got the list from via a bit of excel reworking is https://www.doogal.co.uk/UKPostcodes.php for credit)

    This should also be easy to adapt if you’re trying to have different rates for England/Wales/Scotland as well, just get the first 2 letters of the relevant country’s postcode with a *, have that in one, and then dump everything else into the other.

    I hope this helps someone!

    • This topic was modified 4 years, 6 months ago by Jamie.
Viewing 15 replies - 1 through 15 (of 31 total)
  • You can also refine this even more if, for example, your courier charges more for areas like the Scottish Highlands.

    For example the following case:

    AB* would be the Aberdeen area – but AB37-52 are classed by some couriers as a different, more expensive, region.

    So using these in a new Shipping Zone (making sure you place it BEFORE the mainland UK one) would target those:

    AB37 *
    AB38 *
    AB40 *
    AB41 *
    AB42 *
    AB43 *
    AB44 *
    AB45 *
    AB46 *
    AB47 *
    AB48 *
    AB49 *
    AB50 *
    AB51 *
    AB52 *
    AB53 *
    AB54 *
    AB55 *
    AB56 *

    Plugin Support RK a11n

    (@riaanknoetze)

    Wow, that’s an impressive list @scragglydoggames and a nice workaround.

    For future reference though, I’m aware of a plugin that adds the regions for all of the UK – https://codecanyon.net/item/woocommerce-regions-pack/23194431. With that in hand, you could just select the exact regions for your shipping zones rather than rely on postcodes 🙂

    Hi there
    REALLY hoping someone can help with NI postcodes! So I am finding that when saving only specific postcodes into shipping as the company only ships to certain areas of NI at the moment due to the COVID-19 pandemic, that any other postcodes NOT saved in the shipping settings is still coming up as being able to ship to! Anyone know a fix?? Programmer thinks it is because say you have saved in Shipping settings BT1* and also BT17* to cover those 2 areas, then the site is seeing that as basically just BT1* and covering ALL postcodes starting with BT1 which would include say BT12 (even though BT12 is not saved in settings to ship to). Any ideas QUICK please! Many thanks in advance.

    @anorak254 Try BT1 * – the space before * is important!

    anorak254

    (@anorak254)

    Hi Sean
    Thanks for your speedy reply! So I think my programmer was thinking that the BT1 was acting the same for for the BT10, 11, 12, 13 etc. as it was taking anything with the BT1 in it and using that for the BT 10s basically. So do you suggest putting the space after the last number in the first part of code? Eg. BT1 * and for the teens BT10 *
    Many thanks

    seank123

    (@seank123)

    Yes that’s correct – WooCommerce will even make sure the postcode has the space in the correct place if the customer doesn’t add it:

    BT11AA will be read as BT1 1AA for example but BT111AA will be read as BT11 1AA so won’t be triggered by BT1 *

    For BT10, BT11 etc you can use BT10* etc without the space.

    anorak254

    (@anorak254)

    Great Sean, lifesaver!!! Works a treat! Thanks so much.

    dmac

    (@darrenmcentee)

    Brilliant Jamie @scragglydoggames, we are plagued by this on many e-commerce client sites. This works perfectly. Thanks!

    Thread Starter Jamie

    (@scragglydoggames)

    glad this has been helpful to a few people, and delighted it could be adapted in a few ways for both the north and scotland 🙂

    Paul

    (@paulhughes1982)

    Am I missing something on this? Trying to do the same thing here but if I have one region for Northern Ireland with the specific postcodes (BT*) then I have another United Kingdom region below that then I don’t need to add the postcodes minus the Northern Ireland ones? Or do I? Seem to work fine in my case.

    Thread Starter Jamie

    (@scragglydoggames)

    I have it set up like this – https://imgur.com/a/3VQNI2T

    @paulhughes1982 That’s right – you wouldn’t need the BT postcodes in another Zone below – the way it works is that WooCommerce will pick the first Zone that matches the postcode and then ignores the rest anyway – that’s why it’s important to have them in the correct order!

    Ive added the belfast postcodes for Belfast:

    BT1 *
    BT2 *

    so on ..

    BT16*
    BT17*
    BT29* (Airport)

    The problem with the wildcard is if i enter “BT18” into the checkout page it will accept it as a valid location im assuming due to the “BT1 *” wildcard.

    how do i go about fixing this, im also using
    “WooCommerce Advanced Shipping” Plugin by “Jeroen Sormani”

    Reason being we deliver localy by van, so want to offer free van delivery for postcodes BT25, BT26, BT27, BT28,

    Maybe £10 for deliver for Newry, Banbridge, etc,

    And £20 – £40 for further afield.

    If there’s a space between the 1 and the * then it shouldn’t pick up BT18 – not in the office now so can’t test it properly – certainly used to work like that!!

    For me the B* (Birmingham) was over prioritising BT*. I replaced B* with the following:

    B1*
    B2*
    B3*
    B4*
    B5*
    B6*
    B7*
    B8*
    B9*

    • This reply was modified 3 years, 3 months ago by andywozhere. Reason: Notifications alert
Viewing 15 replies - 1 through 15 (of 31 total)
  • The topic ‘Easily Adding Northern Ireland to Shipping Zones in Woocommerce’ is closed to new replies.