One of the main concerns when building an e-shop is configuring your shipping methods in a way that your customers won't abandon on the last step because they get confused.
WordPress and WooCommerce is an open source solution used worldwide by a large amount of people to build an e-shop or a website.
Here at GOZEN Host we provide a wide hosting solutions for WordPress and WooCommerce, from self-managed to full-managed! If you want to test drive...please ask our always around staff, or check our prices here
Our tip for today we will show you how to configure FREE Shipping for WooCommerce and hide Shipping costs when the Free condition applies.
An easy solution is the use of a plugin that will help you configure easily
* Hide shipping rates when free shipping is available.
* Updated to support WooCommerce 2.6 Shipping Zones.
*
* @param array $rates Array of rates found for the package.
* @return array
function my_hide_shipping_when_free_is_available( $rates ) {
$free = array();
foreach ( $rates as $rate_id => $rate ) {
if ( 'free_shipping' === $rate->method_id ) {
$free[ $rate_id ] = $rate;
break;
}
}
return ! empty( $free ) ? $free : $rates;
}
add_filter( 'woocommerce_package_rates', 'my_hide_shipping_when_free_is_available', 100 );