• Resolved idaryl

    (@idaryl)


    Want to reorder the shipping list to show ups ground first and active first – tried this code in functions but no response

    /******** start new function **********/
    /* set default shipping */
    function reset_default_shipping_method( $method, $available_methods ) {
    $default_method = ‘wf_shipping_ups:03’; //provided here the service name which will selected default
    if( array_key_exists($method, $available_methods ) )
    return $default_method;
    else
    return $method;
    }
    add_filter(‘woocommerce_shipping_chosen_method’, ‘reset_default_shipping_method’, 10, 2);
    /**** end new function ********/

    Is the wf_shipping_ups:03 correct? or should it be ….???? Tried GROUND, but that didnt work. ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi idaryl,

    This is the correct code snippet to rearrange the shipping methods : https://www.xadapter.com/code-snippet-rearrange-shipping-methods-cart-page/

    Can you please try this and let us know if you have any query.

    Thread Starter idaryl

    (@idaryl)

    I think I didnt explain well – the code you supplied ( and I appreciate it ) is to set the ups selector first ( if there are more than one carrier )

    However, all I use is UPS, so my query was to reset the order of the UPS selectors, with GROUND first

    **I know this is do-able using the pro version, but in this case is it possible using code for the free?

    Thats why I pointed at ( wf_shipping_ups:03 ) with my local pickup being ( local_pickup:8 ) – or ( local-pickup )

    Hi @idaryl,

    Unfortunately, the snippet that you had provided in the initial query will not work for you as the snippet will only assign the default selection.

    In order to satisfy your requirement, you would require a custom snippet which we do not have at this moment. However, as you said, we do provide additional snippets with our premium solution so this can be worked out with that.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Reorder Shipping Queue’ is closed to new replies.