• Resolved dineintec

    (@dineintec)


    Hi there, having difficulties in working out how I separate 6 and 7 character postcodes in the UK, it is causing some orders to sneak through that are too far away.

    I currently enable delivery for the following postcodes for free in one shipping zone:
    PO1*
    PO2*
    PO3*
    PO4*
    PO5*

    Another zone for paid deliveries:
    PO6*
    PO7*
    PO9*

    And final zone covering all of the UK to allow for collection outside of these areas.

    All of the allowed postcodes are 6 character postcodes eg PO1###. Now the problem we are having are postcodes with 7 characters eg PO16### are sneaking in and we are having to disappoint and refund customers. How can we stop this from happening please? Happy to use a snippet if this cannot be done in the woocommerce shipping settings.

    It would also be good to know how to set up a separate zone with this postcode so I could potentially make a minimum charge and higher delivery fee without it affecting the other postcodes.

    Thanks in advance.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • You need to use a space before the * – for example:

    PO1* – will trigger PO1, PO10, PO11 etc
    PO1 * – will only trigger PO1

    You can set up as many zones as you like but remember, WooCommerce only uses the first one that is triggered – and it works through the zones in the order they appear in the Zones list. So, set up a zone with that postcode and move it to the top of the list – that will make sure it is selected first.

    • This reply was modified 2 years, 11 months ago by seank123.
    Thread Starter dineintec

    (@dineintec)

    Fantastic, this works perfectly, thank you so much for your help.

    This method is also foolproof if a user decides not to include a space in their postcode for either 6 or 7 character postcodes.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Differentiate between UK Postcodes that have 6 and 7 Characters’ is closed to new replies.