Hello,
I’m so sorry to hear about the death in the family. My condolences to you and the rest of your family, and hope you are ok.
For example, someone bought one of my heavyweight hoodies, size Large, shipped to Los Angeles, CA. My website only charged them $3.95 dollars for shipping but once I got to the post office, it actually ran me $13!
[…]
How do I set shipping costs so they apply to distance?
If you were just using the built-in Flat Rate shipping method, this would generally be done by setting up different shipping zones to represent different shipping areas.
Shipping Zones are essentially geographic areas (cities, towns, countries, etc). When the customer enters their shipping address, WooCommerce will start at the top of the list of shipping zones and go down the list until it has a match between the address and a zone. Once it matches, it will return the shipping methods in that zone and stop.
So you might have something like:
Zone1 – Los Angeles: with methods Flat Rate($5), Local Pickup
Zone2 – California: Flat Rate($10)
Zone3 – USA: Flat Rate($15)
Zone4 – International: Flat Rate($30)
Alternatively, if you wanted to charge specifically on the “distance” from your shop to the customer’s address, you could use a Distance Rate Shipping extension, which would connect to Google to calculate the actual distance and charge based on that:
https://woocommerce.com/products/woocommerce-distance-rate-shipping/
On the other hand, if you wanted to get live rates from an API, you could use an extension like USPS, UPS, FedEx, etc (depending on the shipping service you are using). They would use the weights/dimensions of your products to pack a box, and then send the info to the carrier’s online service to get actual rates to display/charge the customers:
USPS: https://woocommerce.com/products/usps-shipping-method/
FedEx: https://woocommerce.com/products/fedex-shipping-module/
UPS: https://woocommerce.com/products/ups-shipping-method/
With those, you would add (for example), the USPS method to whichever shipping zones you want to offer the service in (i.e. only add it for orders in the USA). Then if a customer enters a shipping address in that zone, they would be able to choose from those rates/services.
There’s more information about Shipping Zones here:
https://docs.woocommerce.com/document/setting-up-shipping-zones/