Home Forums WoodMart support forum hide flat rate shipping when free shipping is available not working

hide flat rate shipping when free shipping is available not working

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #32573

    natah
    Participant

    I have set a flat rate shipping and a free shipping for my shipping zone
    when the total of cart is over 100euros the free shipping is appearing but the flat rate is not hiding
    I have also tried the code at functions.php
    add_filter( ‘woocommerce_package_rates’, ‘bbloomer_unset_shipping_when_free_is_available_in_zone’, 10, 2 );

    function bbloomer_unset_shipping_when_free_is_available_in_zone( $rates, $package ) {

    // Only unset rates if free_shipping is available
    if ( isset( $rates[‘free_shipping:3’] ) ) {
    unset( $rates[‘flat_rate:1’] );
    }

    return $rates;

    }

    can you please check ?
    any suggestion will be great
    thanks in advance

    #32586

    Artem Temos
    Keymaster

    Hello,

    We are sorry but we are not able to check this code since it is related to WooCommerce functionality.

    Regards

Viewing 2 posts - 1 through 2 (of 2 total)