woocommerce / woocommerce-paypal-payments

https://wordpress.org/plugins/woocommerce-paypal-payments/
GNU General Public License v2.0
62 stars 47 forks source link

WooCommerce Bookings products don't remain in Cart as a guest when PayPal button active on single product (1966) #1645

Closed csmcneill closed 1 year ago

csmcneill commented 1 year ago

Describe the Bug

When testing a combination of WooCommerce Bookings and PayPal Payments, we've found that when Pay Later Messaging is enabled and a bookable product is added to the cart by a guest user, navigating to the cart page removes this product from the cart.

To Reproduce

  1. Download, install, and activate WooCommerce Bookings.
  2. Create and publish a bookable product.
  3. Create a simple product.
  4. Download, install, activate, and configure PayPal Payments.
  5. Ensure that Pay Later Messaging at the /wp-admin/admin.php?page=wc-settings&tab=checkout&section=ppcp-gateway&ppcp-tab=ppcp-pay-later page is enabled.
  6. Navigate to the store in an incognito window or another browser so that you can experience the checkout flow as a guest user.
  7. Add the product from step 3 to the cart from the single product page.
  8. Navigate to the cart page. This product should be in the cart.
  9. Empty the cart.
  10. Add the product from step 2 to the cart from the single product page.
  11. Navigate to the cart.
  12. Notice that the cart is empty.
  13. Navigate to the /wp-admin/admin.php?page=wc-settings&tab=checkout&section=ppcp-gateway&ppcp-tab=ppcp-pay-later page and disable Pay Later Messaging.
  14. Repeat steps 10 and 11.
  15. Notice that the cart has the bookable product as expected.

Screenshots

Markup on 2023-08-29 at 19:29:12

Screen Capture on 2023-08-29 at 19-33-26

Expected Behavior

Enabling Pay Later Messaging doesn't impact Bookings products being added to cart by guest users.

Actual Behavior

Bookings products added to the cart by guest users are removed from cart when PayPal Payments Pay Later Messaging is enabled.

Environment

Additional Details

6743504-zen

System status ``` ` ### WordPress Environment ### WordPress address (URL): http://cmmulti.local/bookings Site address (URL): http://cmmulti.local/bookings WC Version: 8.0.3 REST API Version: ✔ 8.0.3 WC Blocks Version: ✔ 10.6.6 Action Scheduler Version: ✔ 3.6.1 Log Directory Writable: ✔ WP Version: 6.3.1 WP Multisite: ✔ WP Memory Limit: 256 MB WP Debug Mode: – WP Cron: ✔ Language: en_US External object cache: – ### Server Environment ### Server Info: nginx/1.16.0 PHP Version: 8.2.8 PHP Post Max Size: 1,000 MB PHP Time Limit: 1200 PHP Max Input Vars: 4000 cURL Version: 7.88.1 (SecureTransport) LibreSSL/3.3.6 SUHOSIN Installed: – MySQL Version: 8.0.16 Max Upload Size: 1 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Database ### WC Database Version: 8.0.2 WC Database Prefix: wp_2_ Total Database Size: 16.06MB Database Data Size: 13.71MB Database Index Size: 2.35MB wp_2_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_2_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_2_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_2_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_2_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_2_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_2_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_2_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_2_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_2_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_2_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_2_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_2_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_2_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_2_actionscheduler_actions: Data: 0.02MB + Index: 0.13MB + Engine InnoDB wp_2_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_2_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_2_actionscheduler_logs: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_2_afwc_campaigns: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_2_afwc_commission_plans: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_2_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_2_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_2_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_2_options: Data: 4.03MB + Index: 0.08MB + Engine InnoDB wp_2_postmeta: Data: 0.34MB + Index: 0.27MB + Engine InnoDB wp_2_posts: Data: 0.09MB + Index: 0.06MB + Engine InnoDB wp_2_snippets: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_2_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_2_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_2_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_2_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_2_wc_admin_note_actions: Data: 0.06MB + Index: 0.02MB + Engine InnoDB wp_2_wc_admin_notes: Data: 0.09MB + Index: 0.00MB + Engine InnoDB wp_2_wc_booking_relationships: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_2_wc_bookings_availability: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_2_wc_bookings_availabilitymeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_2_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_2_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_2_wc_deposits_payment_plans: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_2_wc_deposits_payment_plans_schedule: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_2_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_2_wc_order_addresses: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_2_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_2_wc_order_operational_data: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_2_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_2_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_2_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_2_wc_orders: Data: 0.02MB + Index: 0.11MB + Engine InnoDB wp_2_wc_orders_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_2_wc_product_attributes_lookup: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_2_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_2_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_2_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_2_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_2_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_2_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_2_wcpv_commissions: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_2_wcpv_per_product_shipping_rules: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_2_woocommerce_exported_csv_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_2_woocommerce_square_customers: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_2_wpml_mails: Data: 1.52MB + Index: 0.00MB + Engine InnoDB wp_blogmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_blogs: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_registration_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_signups: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_site: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_sitemeta: Data: 0.25MB + Index: 0.03MB + Engine InnoDB wp_usermeta: Data: 6.11MB + Index: 0.06MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB ### Post Type Counts ### attachment: 4 bookable_person: 4 bookable_resource: 39 custom_css: 1 page: 9 post: 2 product: 46 revision: 24 shop_coupon: 3 shop_order: 13 wc_booking: 47 wcpd: 2 wp_global_styles: 1 ### Security ### Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ ### Active Plugins (7) ### WooCommerce PayPal Payments: by WooCommerce – 2.2.2 WooCommerce: by Automattic – 8.0.3 Disable Real MIME Check: by Sergey Biryukov – 1.0 WP Mail Logging: by WP Mail Logging Team – 1.12.0 WooCommerce Stripe Gateway: by WooCommerce – 7.5.0 User Switching: by John Blackbourn & contributors – 1.7.0 WooCommerce: by Automattic – 8.0.3 ### Inactive Plugins (1066) ### [Removed due to length] ### Settings ### API Enabled: – Force SSL: – Currency: USD ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: accommodation-booking (accommodation-booking) booking (booking) external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: – Enforce Approved Product Download Directories: – HPOS feature screen enabled: – HPOS feature enabled: – Order datastore: WC_Order_Data_Store_CPT HPOS data sync enabled: – ### WC Pages ### Shop base: #6 - /shop/ Cart: #7 - /cart/ Checkout: #8 - /checkout/ My account: #9 - /my-account/ Terms and conditions: ❌ Page not set ### Theme ### Name: Storefront Version: 4.2.0 (update to version 4.5.2 is available) Author URL: https://woocommerce.com/ Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ✔ ### Templates ### Overrides: – ### Admin ### Enabled Features: activity-panels analytics product-block-editor coupons core-profiler customer-effort-score-tracks import-products-task experimental-fashion-sample-products shipping-smart-defaults shipping-setting-tour homescreen marketing mobile-app-banner navigation onboarding onboarding-tasks remote-inbox-notifications remote-free-extensions payment-gateway-suggestions shipping-label-banner subscriptions store-alerts transient-notices woo-mobile-welcome wc-pay-promotion wc-pay-welcome-page Disabled Features: minified-js new-product-management-experience product-variation-management settings async-product-editor-category-field Daily Cron: ✔ Next scheduled: 2023-08-30 18:52:58 -07:00 Options: ✔ Notes: 148 Onboarding: completed ### WooCommerce PayPal Payments ### Onboarded: ✔ Shop country code: US WooCommerce currency supported: ✔ Advanced Card Processing available in country: ✔ Pay Later messaging available in country: ✔ Webhook status: – PayPal Vault enabled: – ACDC Vault enabled: – Logging enabled: – Reference Transactions: – Used PayPal Checkout plugin: – Tracking enabled: ✔ ### Action Scheduler ### Complete: 31 Oldest: 2023-08-29 10:07:05 -0700 Newest: 2023-08-29 17:37:57 -0700 Pending: 4 Oldest: 2023-08-29 17:43:32 -0700 Newest: 2023-09-28 10:07:05 -0700 Failed: 16 Oldest: 2023-03-21 22:05:11 -0700 Newest: 2023-08-29 17:43:06 -0700 ### Status report information ### Generated at: 2023-08-29 17:43:39 -07:00 ` ```
gabriel-fuentes commented 1 year ago

6733826-zen

gabriel-fuentes commented 1 year ago

6742688-zen

senff commented 1 year ago

6748336-zen

Note: deactivating "Pay Later" does not fix it! It does when Paypal is fully disabled as a payment method.

InpsydeNiklas commented 1 year ago

Update 2.2.1 added compatibility for the PayPal buttons on the single product page for WooCommerce Bookings products. But it introduced this issue when the buyer is not logged in and attempting to add the bookable product to the Cart from the single product page. After performing some tests, we do not see any direct relationship with the Pay Later features, as this issue appears to require the following:

Disabling the PayPal button on the single product page should be a way to circumvent the issue until a proper fix is available in the next version.

gabriel-fuentes commented 1 year ago

👋 Hi @InpsydeNiklas! A user came up with the following workaround for this issue, which is to enable the "Redirect to the cart page after successful addition". Screenshot: https://d.pr/i/DLFiH6

I gave it a whirl, and it seemed to be working just fine. However, I'm not entirely sure if it keeps working smoothly when someone decides to browse before finishing the checkout process. It would be really helpful if you could give it a quick test to make sure we can also suggest this workaround in the meantime.

InpsydeNiklas commented 1 year ago

Hi @gabriel-fuentes, it does look like this also works around the issue, and the item persists in the Cart even when continuing to browse the store. We expect a fix package for testing to be available in the coming week.

InpsydeNiklas commented 1 year ago

Hi @csmcneill @senff @gabriel-fuentes! A test package with the proposed fix can be downloaded from here. It's worth mentioning this package has only gone through initial testing so far, and a fully tested pre-release version should be available in the Releases section at the end of next week. We would appreciate feedback in any case.

thisissandip commented 1 year ago

7082236-zen 7052379-zen 6743882-zen 6805619-zen 6800910-zen