Viewing 2 replies - 1 through 2 (of 2 total)
  • With the help of below hook you can set default shipping method.

    
    function set_default_shipping_method( $method, $available_methods ) {
        $method = key($available_methods);
        return $method;
    }
    add_filter('woocommerce_shipping_chosen_method', 'set_default_shipping_method', 10, 2);
    
    • This reply was modified 7 years, 8 months ago by Jan Dembowski. Reason: Fixed code formatting
    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Side note to @ukwpexperts Thanks for the help but your code block is more readable when you wrap it using the code button. ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘UPS as default shipping’ is closed to new replies.