VirtueMart

WooCommerce

Others

Docs

Support

Demo

Blog

About

Forum
Welcome, Guest
Username: Password: Remember me

TOPIC: Different Shipping rates by city with the same ZIP

Different Shipping rates by city with the same ZIP 19 Sep 2017 17:26 #1

Hi,
I need to set different shipping rates for different cities. This is because we have different shipping rates in the same ZIP code for different cities.
Example 1:
ZIP: 04020
City: Ponza
Shipping rate: 15,50€

Example 2:
ZIP: 04020
City: Itri
Shipping rate: 5,50€

How can I fix it?
Thanks
The administrator has disabled public write access.

Different Shipping rates by city with the same ZIP 21 Sep 2017 00:59 #2

Dear Viper975,
In addition to the ZIP variable, there is also the City variable available, which holds the user-entered city name:
ZIP==04020; City="Ponza"; Shipping=15.5
ZIP==04020; City="Itri"; Shipping=5.5

Note, however, that this relies on the customer entering the city correctly. If the customer makes any typo in the city, none of the rules will match. To handle this case, you can add a fall-through rule that displays a warning/error message to the customer:
ZIP==04020; City="Ponza"; Shipping=15.5
ZIP==04020; City="Itri"; Shipping=5.5
ZIP==04020; Warning="Unknown city: the 04020 postal code consists only of the two cities Ponza and Itri. Please enter either."; NoShipping

Best regards,
Reinhold
The administrator has disabled public write access.

VM - Shopping cart

 x 

Cart empty

Login Formular