Hi @photon1
Thanks for your issue report. The team is looking into improving the performance when using Pay upon Invoice with highly variable products.
The plugin is currently checking all variations from the product in the cart to understand if any of them are virtual/downloadable. In a normal setup with a hand full of variations, this should not be a problem, but with thousands of variations, this approach may not scale well.
If you do not have any virtual/downloadable product variation in your store, then you could consider temporarily removing or commenting the code from line 102-110 in the file /wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-wc-gateway/src/Helper/CheckoutHelper.php
Then the mentioned query for the highly variable product should not run anymore. Please let us know how this works for you.
Thanks!
Kind regards,
Niklas
Hi Niklas,
thank you for your answer! This works very well for us!
Kind regards, Photon1
Hi @photon1
Thanks for the feedback!
Since you nicely documented this issue here on GitHub, I’ll mark this thread resolved for now. The GitHub issue is linked to an internal issue and will be updated whenever there are any relevant developments.
Please also be aware that a new update will be released soon. So any modifications made to the core plugin will be overwritten during an update.
It is possible to create code customizations that persist through updates by creating a custom module. But this requires significantly more involvement to set up compared to changing the core code:
But we’ll investigate how use cases with Pay upon Invoice and thousands of product variations could be improved for better performance.
Kind regards,
Niklas