Skip to content

Instantly share code, notes, and snippets.

@mikejolley
mikejolley / gist:11171530
Last active May 16, 2019 06:42 — forked from woogist/gist:6065863
Hide all/some shipping options when free shipping is available
/**
* woocommerce_package_rates is a 2.1+ hook
*/
add_filter( 'woocommerce_package_rates', 'hide_shipping_when_free_is_available', 10, 2 );
/**
* Hide shipping rates when free shipping is available
*
* @param array $rates Array of rates found for the package
* @param array $package The package array/object being shipped