This topic has 5 replies, 2 voices, and was last updated 9 years by Radu.

  • Author
  • #88794
     bruce7075
    Participant

    Hi,

    May I know how to hide WooCommerce shipping when free is available? Thank you very much for your kind help!

    #88826
     Radu
    Moderator

    Hi,

    Take a look here : https://docs.woothemes.com/document/hide-other-shipping-methods-when-free-shipping-is-available/

    Cheers

    RAdu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #88841
     bruce7075
    Participant

    Thanks! I have tried but not working …

    #89010
     Radu
    Moderator

    Hi,

    Try with this

    COPY CODE
    
    // Hide standard shipping option when free shipping is available
    add_filter( 'woocommerce_available_shipping_methods', 'hide_standard_shipping_when_free_is_available' , 10, 1 );
    
    /**
     *  Hide Standard Shipping option when free shipping is available
     *
     * @param array $available_methods
     */
    function hide_standard_shipping_when_free_is_available( $available_methods ) {
    
        if( isset( $available_methods['free_shipping'] ) AND isset( $available_methods['flat_rate'] ) ) {
    
            // remove standard shipping option
            unset( $available_methods['flat_rate'] );
        }
    
        return $available_methods;
    }
    

    Let me know if it works

    Cheers

    Radu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #89018
     bruce7075
    Participant

    Hi Radu,

    I have now used Woocommerce Jetpack and can do what I want. Thanks very much for your very kind efforts on this!

    #89044
     Radu
    Moderator

    You’re welcome

    I’m glad that you have solved your problem.

    Have a nice week

    Radu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 6 posts - 1 through 6 (of 6 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?