Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author ELEXtensions

    (@elextensions)

    Hello @thomaswebdesigns ,

    Thanks for contacting us. Please use this code snippet below to achieve your requirement.

    function custom_shipping_method_sorting( $rates, $package ) {
    ? ? $sorted_rates = array();
    ? ? $australia_post_rates = array();

        // Separate the Australia Post rates from other rates
        foreach ( $rates as $rate_id => $rate ) {
            if ( $rate->method_id === ‘wf_australia_post’ ) {
                $australia_post_rates[ $rate_id ] = $rate;
                unset( $rates[ $rate_id ] );
            }
        }

        // Add the Australia Post rates at the top
        $sorted_rates =  $australia_post_rates + $rates ;

    ? ? return $sorted_rates;
    }
    add_filter( ‘woocommerce_package_rates’, ‘custom_shipping_method_sorting’, 10, 2 );

    Let us know the feedback.

    Thread Starter thomaswebdesigns

    (@thomaswebdesigns)

    I have added code. But click & collect is still showing on top. Its a local pickup option. How can i move it to last?

    Plugin Author ELEXtensions

    (@elextensions)

    Hello @thomaswebdesigns ,

    With the same code snippet, we were able to make the required change on our test environment. Attached is the screenshot for your reference.

    https://prnt.sc/TPjGmswKnL5J

    Could you please confirm if you have updated the snippet on the functions.php file of your website?or with any code snippet plugins? Recommend you to raise a ticket with us share your test site access with?our?support team?so that we can look?into?your site to configure the snippet properly.

    Looking forward to hearing from you soon.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Move Flat rate shipping at end of shipping options on checkout pag’ is closed to new replies.