Table of Contents
Problem Description #
You set shipping conditions based on customer’s city, shipping zone, or other location data, but these restrictions do not apply correctly, or shipping method remains visible even for excluded cities.
Common symptoms:
- Users from excluded cities still see restricted shipping methods.
- Shipping method disappears even for allowed cities.
- Mixed behavior depending on browser or address input.
Cause:
Location-based conditions rely on correct detection of customer’s shipping address, and sometimes on JS to trigger shipping‑method reevaluation on checkout when the city field changes. Mistakes in spelling city names, address formatting, or caching/JS conflicts may prevent correct condition evaluation. WPFactory has marked “City conditions + JS update_checkout trigger” as relevant part of the plugin logic. WordPress.org+1
Solution – step‑by‑step #
- Double-check city names spelling and match exactly
- In plugin condition settings, re-enter city names as they are stored (case, accents, naming). Avoid extra spaces.
- Test with fresh checkout page & different address
- Clear browser cache, use incognito, and fill shipping address manually to ensure correct city enters.
- Ensure checkout form triggers shipping‑method update after city change
- The plugin relies on update_checkout JS event to reevaluate shipping methods when address changes; ensure no optimization or misfiring JS prevents this.
- Disable cache/minification for checkout page
- Especially for JS that runs on checkout (city-based conditions), exclude checkout/cart/payload from caching or minification to avoid interference.
- Test using default theme & minimal plugins
- Switch temporarily to default theme, disable other plugins, and test city-based restriction to exclude a theme or plugin conflict source.
- If still failing – enable debug mode or contact support
- The plugin may allow enabling debug (check plugin docs). Use this to log which conditions were evaluated and why shipping methods remained visible. Provide logs to support if needed.
- The plugin may allow enabling debug (check plugin docs). Use this to log which conditions were evaluated and why shipping methods remained visible. Provide logs to support if needed.
Prerequisites #
- Admin access + ability to test checkout.
- No heavy checkout caching or minification.
Additional Notes / Prevention #
- Maintain a list of accepted city spellings to avoid user input variation issues.
- For wide stores (multiple cities), consider restricting by ZIP/postcode if city matching becomes unreliable.
