Closed marcelbusch closed 2 years ago
Can you send me a copy of that other plugin? I'm sure there's a function that needs to be whitelisted to get the actual stock instead of virtual
Is this happen when processing the IPN or on the checkout page?
It's this one https://de.wordpress.org/plugins/express-checkout-paypal-payment-gateway-for-woocommerce/
I'm not sure if either, you can click on the paypal express button on whatever page you're on, then it builds a request and redirects to paypal, it happens during the building of the request (/express-checkout-paypal-payment-gateway-for-woocommerce/includes/class-paypal-express-api.php:509
).
Are you using 'Express checkout' or 'Smart Button' payment button? Any other settings unique to that payment plugin that you have so I can try to duplicate the issue?
Edit: The exception text thrown doesn't seem to match with anything in WooCommerce, do you have another plugin (or a custom translation) that is throwing an exception with the text "is sold out and can't be purchased." The exception thrown in ReserveStock.php has text " is out of stock and cannot be purchased."
I have the plugin installed and setup enough for some testing though I haven't been able to reproduce the error yet. I'll keep trying but if you can share some more details about your setup it would help keep me from trying a lot of random stuff. What type of products are they?
I'm using the Express checkout button, anything else I could image that might be relevant is just that the button is on the cart page (with no possibility to go to the checkout page). Oh, my store runs in german and I translated it when I posted the log here and apparently didn't get the wording right, sorry for the confusion. I'm sure that the exception is really coming from the ReserveStock.php. I don't really have any other woocommerce-related plugins installed, just a stock manager, but even when it's deactivated the problem persists. There's nothing special to the products, they're simple products, don't have any variations, stock managing is activated and they have a low single digit stock amount and don't allow backorders. I attached the settings I'm using for your plugin. I use an ajax-cart, but the error also occurs when I try to check out from the normal, non-ajax cart-page or from the checkout-page, so I don't think it has anything to do with that. Anything else that might be useful for you?
Thanks for the info. Just wanted to make sure I wasn't chasing down a red herring. It looks like my test didn't trigger it because I don't have the 'woocommerce_hold_stock_minutes' option enabled. I'll do some more testing, but I suspect that function will need to be whitelisted to return actual stock.
I just pushed out version 3.85 to the WordPress repository. This should fix your issue.
I have not done much testing with the WooCommerce reserve stock feature, I've never seen a benefit to using that as well as this plugin at the same time. Please do further testing to see if you need it and it helps in any way.
Honestly I wasn't aware I had that option turned enabled, but your update works:) thanks a lot!
Hey, I'm using your plugin to reduce some items in an onlineshop I'm setting up at the moment. Now I'm facing a problem when checking out via Paypal (I'm using WebToffees Paypal Express Plugin): when I put all available items of one product in my cart, I get an error during checkout, this doesn't happen when I want to buy all but one items of the product. I was able to trace the problem down to the
ReserveStock.php
which lies inplugins/woocommerce/src/Checkout/Helpers/
. On line 86 it asks if$product->is_in_stock()
which resolves to false, which should return true during checkout, shouldn't it? I set up bank transfer as an alternative payment and here the error doesn't happen. Any advise?Error trace (reduced): ` 2021-12-02T18:40:33+00:00 DEBUG <------------------- WebToffee PayPal Express Payment ( catch Exception on Express Start/Credit Start ) -------------------> stdClass Object ( [0] => Exception Object ( [message:protected] => „Googly Eye“ is sold out and can't be purchased. [string:Exception:private] => [code:protected] => 0 [file:protected] => /var/www/virtual/fummel/html/wp-content/plugins/express-checkout-paypal-payment-gateway-for-woocommerce/includes/class-paypal-express-api.php [line:protected] => 510 [trace:Exception:private] => Array ( [0] => Array ( [file] => /var/www/virtual/fummel/html/wp-includes/class-wp-hook.php [line] => 303 [function] => perform_api_request_paypal [class] => Eh_PayPal_Express_Payment [type] => -> [args] => Array ( [0] => )
) `