Skip to content

Bug Report: ppc-simulate-cart triggered on variable product pages causing add-to-cart conflicts #4316

@algoasitf-star

Description

@algoasitf-star

Describe the Bug

When the "Pay Later" banner is enabled on the Product Page location, the plugin automatically fires a ppc-simulate-cart AJAX request on every variable product page load — before any user interaction. This causes conflicting messages to appear simultaneously and prevents customers from adding variable products to the cart correctly.

To Reproduce

  1. Install WooCommerce PayPal Payments 4.0.3
  2. Go to WooCommerce → Settings → Payments → PayPal → Styles
  3. Select "Product Page" as the button position and enable "Pay Later" banner
  4. Open any variable product page (with multiple color/size variations)
  5. Open Chrome DevTools → Network tab → filter by "ppc"
  6. Reload the page — observe ppc-simulate-cart firing automatically on page load
  7. See conflicting yellow and green messages appear without any user interaction

Screenshots

The following behavior is observed on page load without any user interaction:

  • Yellow message: "Please select product options visiting [Product Name]"
  • Green message: "[Product Name] has been added to your cart"
  • Mini-cart shows incorrect amounts from ghost products
  • ppc-simulate-cart visible in Network tab fired automatically

Expected Behavior

The ppc-simulate-cart request should not interfere with WooCommerce's variation_form AJAX system. It should not trigger any add-to-cart events or UI changes on variable product pages.

Actual Behavior

The ppc-simulate-cart request fires automatically on variable product page load to calculate the Pay Later banner amount. This interferes with WooCommerce's variation form, causing:

  1. Automatic yellow warning: "Please select product options"
  2. Automatic green success: "Product added to cart"
  3. Ghost products appearing in mini-cart
  4. Customers unable to add variable products correctly
  5. Out-of-stock variation errors appearing when switching between variations

Environment

  • WordPress Version: Latest
  • WooCommerce Version: 10.7.0
  • Plugin Version: WooCommerce PayPal Payments 4.0.3
  • Browser: Chrome (latest)
  • Theme: Woodmart + Woodmart Core 1.1.6
  • Other relevant plugins: Variation Swatches for WooCommerce
  • Store URL: https://algoasi.es

Additional Details

Workaround found: Disabling the Pay Later banner specifically on the Product Page location resolves the issue completely. The conflict does NOT occur when the banner is only enabled on Cart, Checkout, Home or Shop locations.

This confirms the root cause is the ppc-simulate-cart request being triggered on product page load specifically when Pay Later banner is active on that location.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions