Replace Woocommerce shop page with home page

I have been building woocommerce sites for many years and it has always been annoying to have that main shop page… So here is how to do it the clean way.

Add the following to your function.php file :

/* Redirect WooCommerce Shop URL
add_filter( 'woocommerce_return_to_shop_redirect', 'st_woocommerce_shop_url' );
function st_woocommerce_shop_url(){
return site_url();