woocommerce / woocommerce-gateway-paypal-express-checkout

58 stars 65 forks source link

Flows initiated from the checkout page show "Ship To" even for virtual-only carts #851

Open jorgeatorres opened 3 years ago

jorgeatorres commented 3 years ago

Describe the bug

When purchasing a virtual product, initiating the payment flow on the checkout page makes PayPal display the "Ship To" section, which doesn't make much sense as there's nothing to ship. Also, the address can't be changed, so it isn't very useful.

While we correctly send NOSHIPPING when the cart doesn't require shipping, flows initiated from the checkout page also have the ADDROVERRIDE field set, which makes PayPal display the "Ship To" section.

To reproduce

  1. Add a virtual product to the cart.
  2. Initiate the payment flow from the Cart page and confirm that no "Ship To" section is displayed.
  3. Close the window without completing the process.
  4. Go to the Checkout page and initiate the payment flow. Confirm the "Ship To" section is displayed.

Screenshots

Screen Shot 2021-02-17 at 14 27 43

Expected behavior

Shipping-related sections should not be shown when purchasing only virtual products.