Different shipping fees for certain postal code [zip code/postcode]?

  • Posts: 58
  • Thank you received: 7
  • Hikashop Multisite
1 month 1 week ago #364411

-- HikaShop version -- : 5.1.1
-- Joomla version -- : 5.2.1
-- PHP version -- : 8.2.23
-- Browser(s) name and version -- : Chrome 130.0.6723.117

Hello,

My client would like to have certain postcodes to have another fee. All of the Netherlands has €7,50 shipping fee, but for 8881-8896, 8899, 9161-9163 and 9166 it has to be €19,-
Besides that, when ordering over €100,- is free of charge. But for the areas mentioned before, the limit is free shipping for orders over €250,-

Right now, the shipping is for the whole country. Can you please give me a hint how to configure this the right way?

Thanks in advance!

Regards,

Ans

Please Log in or Create an account to join the conversation.

  • Posts: 83022
  • Thank you received: 13403
  • MODERATOR
1 month 1 week ago #364413

Hi,

You want to use the "Post code RegEx" setting of your shipping methods to restrict them to different post codes.
For example with the regex:

#^(888[1-9]|889[0-6]|8899|916[1-3]|9166)$#
You'll only target the region with the more expensive shipping fee
Or the regex:
#^(?!88(8[1-9]|9[0-6]|99)|916[1-3]|9166)\d{4}$#
to target the rest

And you can use the min price / max price restrictions for the free shipping.

So, instead of one manual shipping method for the Netherlands, you'd have 4:
- one with the first regex and a min price of 250 and a price of 0
- one with the second regex and a min price of 100 and a price of 0
- one with the first regex and a max price of 249.999 and a price of 19
- one with the second regex and a max price of 99.999 and a price of 7.50

Please Log in or Create an account to join the conversation.

  • Posts: 58
  • Thank you received: 7
  • Hikashop Multisite
6 days 12 hours ago #364992

Hi Nicolas,

First, I'm really sorry for the belated reply. Unfortunately I'm having some health issues, that's why I haven't been around lately... Sorry for that!

This morning I've tried your Regex 'strings', I'm not sure how to call them. I don't know if I did something wrong, but at checkout there isn't any shipping option. For explanation reasons I've created print screens from all 4 shipping methods. Although on the images it looks like the shipping methods are disabled, at the testing time they were enabled. It's a live website, I don't want to take too much risks...
Perhaps good to know either: there is also an option to collect your purchase at the store. So when all 5 methods are published, only the collect option is available. I've tried several postcodes, all with the same result.

Would you mind take a look at the attachments to this post? It would be very helpful to me...

Thanks in advance Nicolas, and sorry again for not responding any earlier.

Regards,

Ans

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 83022
  • Thank you received: 13403
  • MODERATOR
6 days 8 hours ago #364993

Hi,

No worries. I hope you're getting better.

Make sure you don't have extra spaces at the end of the regex.
Also, when you test, unpublish the other shipping methods. That way, HikaShop will display the error message corresponding to the problem with these shipping method which will help us understand what is wrong.

Please Log in or Create an account to join the conversation.

  • Posts: 58
  • Thank you received: 7
  • Hikashop Multisite
3 days 11 hours ago #365022

Hi Nicolas,

Thanks for the kind words, I'm trying to hangin there. :)

I've created the four shipping methods again. This time not on the live website, it's just to risky, but on a sub domain. mitz.basisbedrijfskleding.nl . As you can see on the print screen, at checkout I get a message that there aren't any shipping methods found. And that's quit peculiar, because they are for sure enabled. All other methods are disabled.
I'm sure there are no spaces at the end of the regex, if you'ld like me to send some screen prints of the settings of those 4, please let me know. If I need to do something else to help with this, I also would like to know.
Your help is much appreciated, as always!

Thanks in advance!

Regards,

Ans

Last edit: 3 days 11 hours ago by Ans van Tongeren. Reason: Link wasn't complete

Please Log in or Create an account to join the conversation.

  • Posts: 83022
  • Thank you received: 13403
  • MODERATOR
3 days 7 hours ago #365023

Hi,

Could you provide a backend access to that sub domain in order to check the settings ?
Could you also provide a test user account for the frontend in order to easily reproduce the problem ?

Please Log in or Create an account to join the conversation.

  • Posts: 83022
  • Thank you received: 13403
  • MODERATOR
2 days 13 hours ago #365041

Hi,

Well, I don't see the problem on your website.
The test account you provided didn't had a cart already set nor an address already filled. So I added a random product to the cart, and entered a random address with the post code 8899 and it worked fine:
i.imgur.com/jB6IpPZ.png
Then, I tried with several products to increase the price above 250€ and the shipping method changed automatically:
i.imgur.com/2eXfdUs.png
Then, I changed the post code to 1234, and the shipping method changed again as expected:
i.imgur.com/5wPXsMF.png
And, then I reduced the products in the cart, and it changed the shipping method yet again:
i.imgur.com/s5i0UCZ.png
So, as far as I can see, all 4 shipping methods display as expected during the checkout, and I'm not able to reproduce a case where no shipping method appears.

If you still have the issue, please provide precise instructions to reproduce the problem.

Please Log in or Create an account to join the conversation.

  • Posts: 58
  • Thank you received: 7
  • Hikashop Multisite
1 day 14 hours ago #365053

Hi Nicolas,

Your absolutely right, with the information I started with, everything works just fine. But I only now see my original question wasn't complete. Overhere in the Netherlands we don't only use numbers, we also have letters combined. For example: my own zip code is 2141 TC. But also 2141TC [so without the space] is being used, and is valid.

I'm really very sorry for sending you the misinformation, I just hadn't thought about the "1234AB" or "1234 AB" combo. This is, I suppose, why it doesn't work on my side of the line.
Is it too much to ask if you would adjust both the Regex lines?

Again, I feel quit ashamed for this. Sorry for wasting your time...

Regards,

Ans

Please Log in or Create an account to join the conversation.

  • Posts: 83022
  • Thank you received: 13403
  • MODERATOR
1 day 7 hours ago #365056

Hi,

Ok, that explains why it didn't work for you while it did for me.
Then, you can change the regexes to support these two extra letters:

#^(888[1-9]|889[0-6]|8899|916[1-3]|9166) ?[A-Z]{2}$#
#^(?!88(8[1-9]|9[0-6]|99)|916[1-3]|9166)\d{4} ?[A-Z]{2}$#

Please Log in or Create an account to join the conversation.

Time to create page: 0.085 seconds
Powered by Kunena Forum