• Resolved siliconforks

    (@siliconforks)


    I’m seeing thousands of requests per day to the URL /?wc-ajax=ppc-simulate-cart in my server logs.

    This feature appears to have been added in version 2.2.1 (?) of the plugin but I don’t see anything that looks related to this in the changelog.

    I’m concerned about this because it is placing substantial additional load on the server and may be causing other issues as well. Any information you can provide would be helpful.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Krystian from Syde

    (@inpsydekrystian)

    Hello @siliconforks

    The URL /?wc-ajax=ppc-simulate-cart is related to a feature we introduced in version 2.2.0. This feature is called ‘Cart Simulation’. The primary objective of adding this feature was to ensure better compatibility on single product pages, especially when used alongside plugins such as WC Bookings or WC Product Add-ons.

    The appearance of this URL when someone is simply viewing a product (and not necessarily adding it to the cart) is a direct result of this cart simulation feature. It enables us to simulate the cart’s behavior to ensure the smooth functioning of our PayPal Payments plugin with other plugins on single product pages.

    Kind regards,
    Krystian

    Thread Starter siliconforks

    (@siliconforks)

    OK, I see on the single product page, it is making a large number of /?wc-ajax=ppc-simulate-cart requests – it looks like it is making 2 requests when the page loads, and then (if it is a variable product) it makes another 2 requests each time the customer selects an attribute. So if the product has 3 attributes, there might be a grand total of 8 AJAX requests.

    Are all of these requests necessary? Is there any way to turn these off?

    Plugin Support Krystian from Syde

    (@inpsydekrystian)

    Hello @siliconforks

    We have already created a request for our developers to look into this issue. Some potential solutions we’re considering are:

    1. Introducing a filter to disable these requests.
    2. Working on reducing the number of calls that are made.
    3. Exploring the possibility to only enable these requests when they may be necessary.

    Please be assured that we’re actively working on this to improve the user experience and reduce any unnecessary server load. We’ll make sure to keep you updated on the progress of this matter.

    Kind Regards,

    Krystian

    Thread Starter siliconforks

    (@siliconforks)

    Upon further investigation, it appears that if the “PayPal Smart Buttons” feature is disabled on the single product page, and the “Pay Later” feature is also disabled, then the plugin will no longer make the /?wc-ajax=ppc-simulate-cart AJAX requests. While this may not be ideal for sites which want these features, it seems an effective solution for now.

    It’s terrible, it takes 8s on my optimized with Cloudflare+LSCache+Redis+webp etc etc etc 16GB server to load a cart when paypal is enabled

    • This reply was modified 10 months, 2 weeks ago by mcdeth.
    Plugin Support Syde Joost

    (@joostvandevijver)

    Hello there,

    I wanted to add here that the cart simulation can be disabled with these two filters:
    add_filter( 'woocommerce_paypal_payments_simulate_cart_enabled', '__return_false' ); add_filter( 'woocommerce_paypal_payments_simulate_cart_prevent_updates', '__return_false' );

    More information concerning cart simulation behavior can be found here in case you are interested.

    This is most likely all you need to adjust the behavior to your requirements.

    Kind regards,
    Joost

    mniggemann

    (@mniggemann)

    Hi Joost,

    I’m also seeing lots of requests for /?wc-ajax=ppc-simulate-cart and would like to disable the function. Which negative side effects do I have to look for when getting rid of the cart simulation via the filter?

    Cheers,
    -martin

    yoonlaserwp23

    (@yoonlaserwp23)

    I also wonder what’s the negative effect if I use the filter code above.
    I have a conflict problem with klaviyo plugin.
    The ‘add to cart’ events have been fired on every product page load so we’re looking for the root of the issue.
    The Klaviyo support team found out that the ppc-simulate-cart network request is simulating the  woocommerce_add_to_cart hook, so I think disabling the 2 filters mentioned above could help solving the issue.
    I would like to add the filter to my store, but wonder it it’s okay for the regular PayPal activities.

    Hey @yoonlaserwp23, I’ve now activated both filters and everything’s fine so far. We are making use of attribute-based price variations, but there seeem to be no problems passing the variation prices over to PayPal.

    And we got rid of the excess traffic caused by the simulated cart, so for us, it works well.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘What is /?wc-ajax=ppc-simulate-cart ?’ is closed to new replies.