This content originally appeared on DEV Community and was authored by mojawo
Setup and Configuration
To offer the free shipping method it must be added to a Shipping Zone and you can add it to as many Shipping Zones as you like. Here’s how:
1/ Go to: WooCommerce > Settings > Shipping.
2/ Select a Shipping Zone, Click Edit
3/ Click Add Shipping Method and a modal will display. Select Free Shipping from the dropdown and Add shipping method.
4/ Select Free Shipping in the row you wish to define and select Edit.
5/ This takes you to a different screen to configure the free shipping method for that specific shipping zone.
6/ Enter a Title that displays to customers in checkout.
7/ Open the dropdown next to Free Shipping Requires…
8/ If you have selected any of the options that include a minimum amount, enter a Minimum Order Amount.
9/ Finally, if you’ve selected any of the options that include a minimum amount, you can choose to apply this amount rule before or after coupon discounts have been applied. Below we explain this is a bit more detail (see: Coupon Discounts: When to Apply Minimum Order Total)
10/ Save changes.
Enabling or Disabling Free Shipping via Hooks
The free shipping method has an is_available function that can be hooked into:
return apply_filters( 'woocommerce_shipping_' . $this->id . '_is_available', $is_available );
This means you can use add_filter() on woocommerce_shipping_free_shipping_is_available and return true or false.
Reference Blog
How To Easily Set Up Free Shipping In WooCommerce
This content originally appeared on DEV Community and was authored by mojawo
mojawo | Sciencx (2022-03-22T13:17:48+00:00) How To Easily Set Up Free Shipping In WooCommerce. Retrieved from https://www.scien.cx/2022/03/22/how-to-easily-set-up-free-shipping-in-woocommerce/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.