我注意到我的WooCommerce结帐过程在取消付款后不会将客户返回到结帐页面,而是将其重定向到主页。
细节:
我使用一个WordPress网站,客户可以通过PayPal,CreditCard等付款等。PayPal和我的CreditCard设置都要求网站重定向到外部网站以进行付款,并且付款完成后,客户将被定向回订单。 - 接收页。这一切都很好。
但是,如果外部网站上的客户(例如paypal.com)决定击中“取消付款”,他将带有这样的URL回到主页:
我使用所有插件禁用和默认主题检查了我的网站,同一件事也发生了。它似乎是WooCommerce标准设置的一部分。
我已经搜索了一个解决方案,但没有找到任何解决方案。有人可以将我指向正确的方向吗?
I noticed that my Woocommerce checkout process does not return the customer to the checkout page after a payment is cancelled, instead he is redirected to the home page.
Specifics:
I use a Wordpress site where a customer can pay with Paypal, creditcard etc. Both Paypal and my creditcard setup require the website to redirect to an external site to do the payment and when the payment is complete, the customer is directed back to the order-received page. This is all working fine.
But if the customer on the external site (Paypal.com for example) decides to hit the "cancel payment" he arrives back to the home page with a URL like this: https://example.com/?cancel_order=true&order=wc_order_oEYInB5bC3mCo&order_id=225487&redirect&_wpnonce=99cfb8ef9f
I checked my site with all plugins disabled and default theme and the same thing happens. It seems to be part of Woocommerce standard setup.
I have searched for a solution but did not find anything about this. Can someone point me in the right direction?
发布评论
评论(1)
我在WooCommerce支持论坛上发布了同样的问题,并获得了解决该错误的帮助(尽管他们确实告诉我在Sandbox Fresh安装中,此问题没有发生)。
这是为我解决的代码段:
如果其他任何人都遇到了这一点。
I posted this same question on the woocommerce support forum and received assistance to fix the bug (though they did tell me that in the sandbox fresh installation this problem was not occuring).
Here is the code snippet which resolved it for me:
In case anyone else is running into this.