Created
May 22, 2012 08:32
-
-
Save mikejolley/2767607 to your computer and use it in GitHub Desktop.
WooCommerce - Default shipping SUB-method 1.5.7/1.6+
This file contains hidden or 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
add_filter( 'woocommerce_shipping_chosen_method', 'custom_shipping_chosen_method', 10, 2 ); | |
function custom_shipping_chosen_method( $chosen_method, $_available_methods ) { | |
switch ( $_available_methods[0] ) { | |
case 'table_rate:0-USPS': | |
$chosen_method = 'table_rate:0-USPS'; | |
break; | |
case 'table_rate:1-USPS': | |
$chosen_method = 'table_rate:1-USPS'; | |
break; | |
case 'table_rate:2-USPS': | |
$chosen_method = 'table_rate:2-USPS'; | |
break; | |
case 'table_rate:3-USPS': | |
$chosen_method = 'table_rate:3-USPS'; | |
break; | |
case 'table_rate:4-USPS': | |
$chosen_method = 'table_rate:4-USPS'; | |
break; | |
}; | |
return $chosen_method; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
woocommerce/woocommerce@5c4799e