• Resolved schamberlin

    (@schamberlin)


    Hello! Can anyone describe what I should expect to see happen when a customer doesn’t select any shipping method, and no shipping method is actually available, and then they attempt to check out? I’ve temporarily disabled all my shipping methods to destinations outside the USA, and here’s what I see happening:

    1. add an item to the cart, and then view the cart
    2. ignore “calculate shipping” and don’t enter a shipping country or address
    3. click Proceed to Checkout button
    4. at the PayPal Express page, enter a non-USA shipping address and continue
    5. back at my store’s review order page, the shipping method in the review data says “Shipping costs will be calculated once you have provided your address.”
    6. click the Submit button

    End result: customer with a non-USA address is able to place an order even when I’d attempted to temporarily disable non-USA orders, *and* the order has no shipping method, so in effect they get free international shipping.

    I’m unsure whether I’ve accidentally broken something in my WooCommerce store to be seeing this behavior, or if the behavior I’m seeing is normal and expected for this situation. Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter schamberlin

    (@schamberlin)

    It appears that if customers go through the Checkout page without choosing a shipping method, they will correctly see an “invalid shipping method” error if they try to proceed to PayPal. But if they use the PayPal Express checkout button directly from the Cart page (as most do), then it skips validation and lets them proceed with no shipping method selected. Is this expected?

    Thread Starter schamberlin

    (@schamberlin)

    I think this is actually a problem with the PayPal plugin, rather than WooCommerce itself. I’ve edited the plugin, and I think I’ve fixed the problem. In the file wc-gateway-paypal-express-angelleye.php, at the top of the function paypal_express_checkout(), I added this code:

    $chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' );
    if( empty( $chosen_shipping_methods ) ) { 
        wc_add_notice("Please select a shipping method before proceeding to checkout.", 'error');
        if (!is_ajax()) {
            wp_redirect(get_permalink(wc_get_page_id('cart')));
            exit;
        } else
            return;
    }
    • This reply was modified 3 years, 6 months ago by schamberlin.

    Hey @schamberlin,

    You may want to pass that along to the developer of the plugin.

    Cheers

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘What’s expected behavior when no shipping method is available?’ is closed to new replies.