Woocommerce Checkout Expiration Not Working


Support » Plugin: WooCommerce » Session expired on checkout when I return from a payment gateway with out paying

Session expired on checkout when I return from a payment gateway with out paying

Hi there,
I am having some issues with the check out
1.When I select a payment gateway, it redirects me to their website but my payment transaction fails as I dont have an account with that payment gateway so I come back to the checkout my cart is empty and gives a “session has expired error” although my order is not placed but my cart becomes empty,

The question is how to retain elements in cart until the order is successfully placed?
That is, If I come back from a failed transaction my cart shows products in cart that were there earlier
Please let me know if this is possible.

The page I need help with: [log in to see the link]

Automattic Happiness Engineer

This is called the “hold stock” setting. To change this, head to WooCommerce–> Settings–> Products–> Inventory, and up the hold stock to something more acceptable for your setup.

Hope this helps!

Apologies for the late reply, I lost this thread some how,,
My hold stock settings are by default set to same as you said above but cart does not retain products when I come back from a failed payment transactions or when payment is not done.

Automattic Happiness Engineer

I was going to test this on your site but cannot see a payment option which provides an offsite payment page.

If the cart is being cleared after returning to the site there must be a conflict happening here as this isn’t the default behaviour of WooCommerce.

I tested on my own site by using a PayPal method – when I chose “cancel and return” on the PayPal page, I was returned to my cart with the product still in the basket. See a screen gif of this here – http://cld.wthms.co/y42Ud9

My first thought is that whatever payment method you were using isn’t working as expected, or second, that there is a conflict on the site preventing the customer’s cart from being reinstated.

You can test using the standard PayPal method – enable this, no need to fill in anything else. At the checkout, proceed to PayPal then at the bottom of the card form, click the “Cancel and return” link – this shouldtake you back to the cart on your site.
If the product is still in the cart – the conflict is the payment gateway you have been using. If the cart is empty, there is a conflict somewhere. This could be another plugin, your theme, or caching (either a plugin or server-side from your host).

You can read more about plugin and theme conflicts in the documentation here: https://docs.woocommerce.com/document/woocommerce-self-service-guide/

Let me know how you get on!

Automattic Happiness Engineer

We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Thank you so much for you reply, that was really helpful and solved my problem. I found that the plugin I am using must have this bug and they haven’t fixed it yet.

Many thanks to you again.


Support » Plugin: WooCommerce Cart Stock Reducer » cart expiring: ignore order status setting not working

cart expiring: ignore order status setting not working

I am working on a clients website and I am having problems with this plugin:

WordPress, woocommerce and stock reducer plugins have been updated to latest versions; item expire is on and under ignore order status “pending payment” is selected, however, the items in those orders are expired anyway when timer runs out and thus someone else can purchase them leading into issue of multiple people being able to purchase the same item when stock is very limited

WooCommerce is a moving target and they might have changed some things that affect the way the expiration works (or doesn’t).

Was this working before on an older WooCommerce version and when upgrading it stopped working properly or are you just starting to use this?

fresh plugin installation, was not previously on the site in question

  • This reply was modified 3 months, 3 weeks ago by nettiwelho.

Are you certain of the status that the order is in? Some payment gateways work slightly different.

The payments are going through paytrail ( https://www.paytrail.com/en ).

Around 2-4% of the time the orders remain in pending mode in woocommerce instead of automatically being completed after customer has gone through checkout and paying.

I have repeatedly tested that the ‘ignore order status’ option under cart expiry does not work with following method;

1. Set stock for product X to 1 (backorders disabled), set cart expiration timer to 2 minutes and set ignore status to payment pending.

2. Add product to cart, go to checkout, submit order (do not complete payment), refresh stock page to see the current stock is at 0 as expected, refresh orders page to see the order is currently in payment pending as expected.

3. Wait for timer to run out and after that stock has been increased back to 1, allowing someone else to do purchase of the same item despite of ignore order status setting.

This also means the cart can expire while the customer is going thought the payment process.

  • This reply was modified 3 months, 3 weeks ago by nettiwelho.
  • This reply was modified 3 months, 3 weeks ago by nettiwelho.
  • This reply was modified 3 months, 3 weeks ago by nettiwelho.


Support » Plugin: WooCommerce » In the checkout page, order summary frame shows endless loading for cached nonce

In the checkout page, order summary frame shows endless loading for cached nonce

I have a problem in the checkout pageof WooCommerce plugin, I prefer not to disclose the site URL unless it’s really necessary for further analysis.
I suspect the problem being the one described in this WooCommerce documentation page, at point 3: “Invalid Response from an AJAX Call”where talks about cached nonce, quoting

You may also see a response of -1, This is a security failure and is caused by a cached nonce.

In fact the GET request to “https://mysite/homepage/?wc-ajax=update_order_review” gets a 403 response with “-1” as json response.

Since the site is not already in production I switched back to twenty-sixteen theme and disabled all the plugins but WooCommerce. Then I removed all transient data and clients sessions from the WooCommerce control panel.
Reading a bit about nonces I tried to purge the cache (if present) with a couple of plugins which I then deactivated and deleted, tried to complete the checkout from a different browser with cache disabled but this didn’t work.
I found this discussion on the forum that is about a slightly different error but I think doesn’t apply to my situation because I don’t require authentication to complete the checkout process.
For clarity consider that I have enabled Paypal as payment method but the issue persists even if I disable the option, with the one small difference: when Paypal is activated, inside this component:

I wonder if someone could complete the documentation page cited at the beginning of the post adding further explanation on how to solve the cached nonce problem.

I hope my explanation will help finding the solution. I will try to provide more details if needed, any help is appreciated.
Thanks in advance.

  • This topic was modified 5 months, 3 weeks ago by nic0net.

Leave a Reply

Your email address will not be published. Required fields are marked *