WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
woocommerce_international_shipping (1 post)

  1. kwmlr439
    Member
    Posted 5 months ago #

    Any ideas how to auto select international shipping when choosing another country other than the U.S? I wrote the following function but it is not working:

    add_filter( 'woocommerce_available_shipping_methods', 'cj_woocommerce_available_shipping_methods' );

    function cj_woocommerce_available_shipping_methods( $available_methods ) {
    if ( isset( $available_methods['international_shipping'] ) ) {
    foreach ( $available_methods as $key => $value ) {
    if ( 'international_shipping' != $key ) {
    unset( $available_methods[ $key ] );
    }
    }
    }

    return $available_methods;
    }

    https://wordpress.org/plugins/woocommerce/

Reply

You must log in to post.

About this Plugin

About this Topic