This is a short blog post about the shipping debug mode in WooCommerce. I will explain what it is, where you can find it, how you can use it and for what situations you should enable this setting.
Natively WooCommerce caches any earlier retrieved shipping rates for 48 hours in the session. Caching shipping rates is done for performance reasons. Calculating shipping rates can be a fairly complex and resource heavy process compared to other functions. This especially goes for things like live shipping quotes which make requests to external resources.
Not caching the rates would mean that these calculations would be done everytime the order totals are refreshed, meaning every page reload, an address field is changed or a shipping option is selected.
So caching is a good thing right?! For live websites absolutely! However when configuring a site and setting up shipping rates this can be skewed results as changes may not come through. Because of that I’d recommend to turn the shipping debug mode anytime working with/configuring shipping rates.
Enabling the shipping debug mode
To turn on the shipping debug mode, head over to the WooCommerce > Settings > Shipping > Shipping Options page. The last option there gives you the option to enable or disable the shipping debug mode.
Shipping Debug Notice
Aside from not caching the shipping rates, WooCommerce will display a notice on the cart/checkout page to show which shipping zone the customer is matching with.
This notice will disappear when the debug mode has been disabled.
I hope this will help some people who struggle with shipping rates that do not change, even though they put every setting right.