Last active
August 29, 2015 14:05
-
-
Save webgurus/33e0fee4694761ab56c5 to your computer and use it in GitHub Desktop.
WooCommerce - hide standard shipping option when free is available
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Hide Standard Shipping option when free shipping is available | |
* | |
* @param array $available_methods | |
*/ | |
function hide_standard_shipping_when_free_is_available( $available_methods ) { | |
if( isset( $available_methods['free_shipping'] ) AND isset( $available_methods['flat_rate'] ) ) { | |
// remove standard shipping option | |
unset( $available_methods['flat_rate'] ); | |
} | |
return $available_methods; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment