• Resolved darklightfx

    (@darklightfx)


    We’ve been getting the following error report in WooCommerce Services error log (in the WordPress dashboard) about once a week ever since we’ve been using it:

    [date / time removed] - Error. Unable to get shipping rate(s) for wc_services_usps instance id 4. (calculate_shipping)
    [date / time removed] - wcc_server_error_response Error: The WooCommerce Services server returned: Bad Request child "destination" fails because [child "postcode" fails because ["postcode" is not allowed to be empty]] ( 400 ) (calculate_shipping)

    Occasionally while testing in different browsers etc, we also see the following error message on the store’s cart page when you first visit it, before entering address info to estimate shipping: “There are no shipping methods available. Please double check your address” I’m not sure this is directly related.

    Checkout and payment seems to function normally other than these error messages. So far my best guess is that sometimes the cart is looking for a shipping address when a customer first visits the cart page, doesn’t see one, can’t calculate shipping, so it gives an error. However when a customer first visits the checkout page they would not have been able to put in their shipping information yet so I’m not sure why that would output an error at all.

    We are using using USPS and some FedEx (for international) shipping calculations. Shipping zones, rules and regions are set up correctly as far as we can tell. Everything works fine other than these occasional errors.

    Any help to resolve this would be greatly appreciated. Thanks!

    • This topic was modified 7 years, 2 months ago by darklightfx.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Yuki K a11n.

    (@yukikatayama)

    Automattic Happiness Engineer

    Hi there,

    The error,

    wcc_server_error_response Error: The WooCommerce Services server returned: Bad Request child “destination” fails because [child “postcode” fails because [“postcode” is not allowed to be empty]] ( 400 ) (calculate_shipping)

    means that the customer did not put in their zip code so a rate could not be returned.

    Regarding the error “There are no shipping methods available. Please double check your address” before an address is added either at cart or at checkout, is there a specific product that this is happening to? A quick test of adding items to cart showed only the message “Enter your shipping address to view shipping options.”

    Thread Starter darklightfx

    (@darklightfx)

    Thanks for the reply! Good to know that the first error is normal (customer forgot to enter their zip).

    For the other error, which occasionally appears the first time you visit the cart, before entering a zip to estimate shipping:
    There doesn‘t seem to be any available shipping methods. Please double check your address, or contact us if you need any help.
    We have a lot of trouble reproducing it. It doesn’t seem linked to any specific products. Seems to maybe appear in Firefox more than Chrome, but I’m not 100% on that.

    It is interesting that you saw “Enter your shipping address to view shipping options.” — that is what we changed the error message to display by using a custom function.php code. woocommerce_no_shipping_available_html and woocommerce_cart_no_shipping_available_html are filtered to display the message you saw. However, for some reason when we test the site on our end, we only see the original error message — not the one you saw.

    Here’s the code we use for that. (Note that the error was being displayed before we changed anything. We implemented this change to the error message because the original message made it sound like we weren’t offering any shipping options.)

    add_filter( 'woocommerce_no_shipping_available_html', 'my_custom_no_shipping_message' );
    
    add_filter( 'woocommerce_cart_no_shipping_available_html', 'my_custom_no_shipping_message' );
    
    function my_custom_no_shipping_message( $message ) {
    
    	return __( 'Enter your shipping address to view shipping options.' );
    
    }

    Either way, is there a way to stop “woocommerce_cart_no_shipping_available_html” from displaying the first time a customer visits the cart? It shouldn’t be outputting an error before the customer even has a chance to enter their shipping information.

    Thanks!

    Plugin Support Yuki K a11n.

    (@yukikatayama)

    Automattic Happiness Engineer

    In regards to you not being able to see the “Enter your shipping address to view shipping options.” message that you added, have you cleared your browser cache?

    But getting back to why it says “There doesn’t seem to be any available shipping methods…”, do all your products have weight and dimensions?

    Could you enable debug mode for WC Services (https://darklightfx.com/wp-admin/admin.php?page=wc-status&tab=connect) to see if any errors are being called when you checkout (in incognito/private browser)? Would help to do the same for the FedEx plugin as well.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WooCommerce Services Error – Unable to get shipping rate(s) – repeatedly’ is closed to new replies.