• Hi,

    “no shipping method selected check addresses”
    I got this message on woocommerce checkout, When i develop a custom shipping method for “Fastway shipping API” (Australia).

    In admin, I create a shipping zone “Australia”. When I add my custom shipping method in zone, It does not show in method listing.

    For Code reference i use below wocommerce api code
    https://docs.woocommerce.com/document/shipping-method-api/

    But it not work properly.

    Then I resolve this issue by a small modification, When we add our custom shipping method, we use below code-

    function add_your_shipping_method( $methods ) {
    	$methods[] = 'WC_Your_Shipping_Method';
    	return $methods;
    }
    
    add_filter( 'woocommerce_shipping_methods', 'add_your_shipping_method' );

    But I have made a small change,

    function add_your_shipping_method( $methods ) {
    	<strong>$methods['your_shipping_method'] = 'WC_Your_Shipping_Method';</strong>
    	return $methods;
    }
    
    add_filter( 'woocommerce_shipping_methods', 'add_your_shipping_method' );

    “your_shipping_method” is the shipping method id which we define in below constructor code,

    public function __construct() {
    	$this->id                 = 'your_shipping_method';
    	$this->title       = __( 'Your Shipping Method' );
    	$this->method_description = __( 'Description of your shipping method' ); //
    	$this->enabled            = "yes"; // This can be added as an setting but for this example its forced enabled
    	$this->init();
    }

    Don’t frustrate, If you don’t understand my English.
    Because I am not good in English. But i am trying to make me best.

    Thanks

    https://www.ads-software.com/plugins/woocommerce/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘no shipping method selected check addresses’ is closed to new replies.