• Resolved Arjun Parab

    (@arjun1638)


    Hi

    The selected shipping option on the cart page isn’t transferred to Paypal when clicking on the Paypal button. So now the customer has to manually select the shipping option from the dropdown on PayPal which is a bit confusing. Will it be possible to propagate somehow?

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

    (@mrclayton)

    Hi @arjun1638

    The PayPal plugin is designed to use the chosen shipping method that WooCommerce is indicating. Here is the exact line of code where the chosen shipping method is used.

    https://plugins.trac.www.ads-software.com/browser/pymntpl-paypal-woocommerce/tags/1.0.31/src/Factories/ShippingOptionsFactory.php#L15

    As you can see, the PayPal plugin is calling WC()->session->get(?'chosen_shipping_methods',?[]?) which is how WooCommerce stores the customer’s chosen shipping method.

    Are you using a 3rd party shipping plugin? If so, that shipping plugin may not be storing the selected shipping method correctly in the WooCommerce session.

    Can you reply with a link to your website where this behavior can be re-created?

    Thanks

    Thread Starter Arjun Parab

    (@arjun1638)

    Thanks for the quick reply. Visit https://bertrand.bio/pouches/ add some product -> cart -> change shipping to ups and click PayPal

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @arjun1638

    After debugging this behavior, there are two reasons that this happens on your cart page. One reason is expected and the other is something we can control.

    1. When the PayPal button is clicked, the guest customer does not have any address info besides what they might have entered for shipping calculation (That’s not a complete address). PayPal uses the customer’s default address (in the absence of a valid address provided to it) which may differ from the address info used for the shipping option calculation on the cart page. If that is the case, then the default shipping option associated with that configured zone will be used. That is normal and part of standard WooCommerce behavior.
    2. If the customer’s PayPal address does not differ from what was used for the shipping calculation on the cart page, the customer’s already selected shipping option should show as selected in the PayPal popup but it’s not, as you have pointed out. This is something we can change within the plugin. You’ll notice that behavior is only present on the cart page and it’s because of how WooCommerce works. We have made a note to change that behavior in the next release of the plugin.

    Kind Regards,

    Thread Starter Arjun Parab

    (@arjun1638)

    Great, looking forward to the upcoming release.

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @arjun1638

    Here is a link to a patch which you can test and confirm if it resolves your issue. https://drive.google.com/file/d/139SBzXdbSY1LEB1iFCJDrI_ZZnj9mJET/view?usp=sharing

    Keep in mind, if the customer doesn’t already have an address on file from a previous order, PayPal will use the default address associated with their PayPal account when calculating the shipping cost when the PayPal button is first clicked. That address can affect which shipping options are presented and may be different than what they see on the cart page.

    Kind Regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘selected shipping option isn’t propagated to paypal’ is closed to new replies.