In this tutorial, I am going to share WooCommerce tricks which helps you if you want to hide other shipping methods if free shipping method is available on your WooCommerce store.
How to hide other shipping method if free shipping available
Copy the below code and add it at the end of the functions.php file.
$rate ) { if ( 'free_shipping' === $rate->method_id ) { $free[ $rate_id ] = $rate; break; } } //this will return only free shipping method return ! empty( $free ) ? $free : $rates; } ?>
Conclusion
I hope this tutorial helps you, if you have any questions regarding WordPress, then feel free to put your comments in below comment section. Do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials.
The post How to Hide Other Shipping Method if Free Shipping Available appeared first on FreeWebMentor.
This post first appeared on Programming Blog Focused On Web Technologies, please read the originial post: here