Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'woocommerce_after_shipping_rate', 'blm_action_after_shipping_rate', 20, 2 );
- function blm_action_after_shipping_rate ( $method, $index ) {
- if( is_cart() ) {
- return; // Exit on cart page
- }
- // Use $method->method_id in here to check delivery option
- }
- add_action( 'woocommerce_after_shipping_rate', 'blm_action_after_shipping_rate', 20, 2 );
- function blm_action_after_shipping_rate ( $method, $index ) {
- if( is_cart() ) {
- return; // Exit on cart page
- }
- $shipping_country = WC()->customer->get_shipping_country();
- $shipping_state = WC()->customer->get_shipping_state();
- // Testing output
- echo '<br><small>Country code:' . $shipping_country . ' | State code: ' . $shipping_state . '</small>';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement