Skip to content

Instantly share code, notes, and snippets.

@pipoulito
Created November 26, 2014 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pipoulito/cc40bf49ed14431d7e33 to your computer and use it in GitHub Desktop.
Save pipoulito/cc40bf49ed14431d7e33 to your computer and use it in GitHub Desktop.
Hi !
hi
i use woocomerce 2.112 so i tried these two different ways in my function.php but it nothing is called.
I need to hide my local_pickup options defined in my table rate plug setting if my contains a product with shipping class=="XX"
Please, I'm lost , thanks a lot
add_filter( 'woocommerce_package_rates', 'hide_shipping_when_free_is_available', 10, 2 );
function hide_shipping_when_free_is_available( $rates, $package ) {
mail('myemail', 'yo', $rates);
print_r($rates);
return $rates;
}
add_filter( 'woocommerce_available_shipping_methods','hide_table_rate_shipping_when_free_is_available' , 10, 1 );
function hide_table_rate_shipping_when_free_is_available( $available_methods ) {
mail('mymail', 'yo', $available_methods);
print_r($available_methods);
return $available_methods;
}
thanks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment