• Resolved virtual03

    (@virtual03)


    Hello,

    We have the problem that when local pickup is selected, an error occurs that the delivery address is incorrect. How can I deactivate the transfer of the delivery address from PayPal?

    best regards
    Daniel

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @virtual03

    We have the problem that when local pickup is selected, an error occurs that the delivery address is incorrect

    The PayPal plugin uses the shipping address that’s associated with the WooCommerce order.

    The interesting thing about WooCommerce is when a local pickup shipping option is selected, it still renders the shipping address info rather than showing the delivery location.

    I think the correct solution would be to update the WooCommerce order’s shipping address info using action woocommerce_checkout_create_order.

    Example (test first):

    add_action('woocommerce_checkout_create_order', function($order){
        $local_shipping = false;
        foreach($order->get_shipping_methods() as $method){
            if($method->get_method_id() === 'local_pickup'){
                $local_shipping = true;
                break;
            }
        }
        if($local_shipping){
            // all of the local pickup address info
            $order->set_shipping_country('US');
            $order->set_shipping_state('TX');
            $order->set_shipping_address_1('');  
            $order->set_shipping_postcode('');
            $order->set_shipping_city('');
        }
    });

    Kind Regards

    Thread Starter virtual03

    (@virtual03)

    Hi,

    Thank you very much for your support.

    Unfortunately the code doesn’t change anything. PayPal forces the delivery address to be taken over even though the shipping method of local pickup is selected.

    There is also an error (with or without code) I am sending you the log

    https://ibb.co/XyBKL29

    best regards
    Daniel

    Plugin Author Payment Plugins

    (@mrclayton)

    There is also an error (with or without code) I am sending you the log

    That error message isn’t caused by the Paypal plugin. It’s the result of an incorrectly translated text. The %s placeholder is for dynamic text. It should not be altered in translations. In your translation it’s been uppercased.

    Kind Regards

    Thread Starter virtual03

    (@virtual03)

    Hello,

    OK, thank you, the error is now gone, but the address is still taken over by PayPal.

    how can we solve the problem?

    best regards

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @virtual03

    Per my previous reply, it’s not the PayPal plugin that’s forcing the shipping address to be anything. WooCommerce is taking the shipping address from your checkout page and assigning that to the order.

    Here is a simple test you can perform to confirm what I am telling you.

    1. Go to WooCommerce > Settings > Payments and enable the Cash on delivery payment gateway.
    2. Add an item to the cart and navigate to your checkout page. Enter a unique shipping address, different than your store’s address.
    3. On your checkout page, choose local pickup as your shipping method and the Cash on delivery payment method.
    4. Click place order.
    5. Notice that the WooCommerce order’s shipping address shows the address that was entered on the checkout page, not your store’s address.

    It is WooCommerce that is taking the checkout page shipping address info and adding it to the order, not the PayPal plugin.

    Kind Regards

    Thread Starter virtual03

    (@virtual03)

    Hi @mrclayton,

    Per my previous reply, it’s not the PayPal plugin that’s forcing the shipping address to be anything. WooCommerce is taking the shipping address from your checkout page and assigning that to the order.

    That would of course be perfect, but it doesn’t work for me. I can send you a video about it.

    paypal always enforces paypal’s delivery address.

    I also spoke to PayPal on the phone and they say that we cannot pay for local pickup with PayPal. Can we maybe turn “free delivery” into “free pickup”? will the payment go through?

    best regards
    Daniel

    Thread Starter virtual03

    (@virtual03)

    Update.

    It turned out that a checkout plugin had problems and as a result the address was not accepted.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Local pickup and delivery address’ is closed to new replies.