Order status not changing
-
Hi,
The order status is not changing. I made a test purchased to change the status from proecessing to cancelled after 5 minutes if the order payment has cash on delivery.
https://prnt.sc/26mnyqu – https://prnt.sc/26mnywo
But after 5 minutes the order didnt changed https://prnt.sc/26mnz6v
Any ideas? Thanks for the help!
-
Hi,
The order changed to cancelled but after 35 minutes and not 5 as is supposed to.
What can it be?
Hi @roberto22,
There is “Use WP cron > Interval” option in “WooCommerce > Settings > Order Status Rules > Advanced” – by default it’s set to “Once hourly”. This means that our plugin goes through the orders once per hour, and checks if the status needs to be changed for any of them. Try setting this option to e.g. “Once every minute” – I believe this should solve it.
Please give it a try and let me know what you think.
P.S. “Interval” option doesn’t affect rules where you set “Time trigger” to 0 (minutes). In this case, status is changed immediately, no matter what value is set for the “Interval” option.
Hi,
i changed the settings to “Once every minute” and is working. But now i have the following issue.
The order status changes only if i am logged in. I made a test purchase…and after the purchase i logged out as admin and customer, and the order status never changes. Once i log in the status changes.
Thanks again for the help!
Hi @roberto22,
I believe that the issue is not really if you are logged in or not, but if there are any visits on your site. Let me try to explain. WP Cron is triggered only when someone visits your site. As it’s stated in Cron documentation page on www.remarpro.com:
Note:WP-Cron does not run constantly as the system cron does; it is only triggered on page load.
So generally, as far as your site will be regularly visited, cron will be triggered. Now, if you think this will be a problem for you, there is a solution – you can replace WP cron with real (system) cron, as described here for example.
Hope this helps. Please let me know if you have any questions.
Hi,
Thanks for explaining this to me :).
I am interested in buying the pro version so i can add more rules, and was wondering if i can create these rules:
Rule #1
Change from Processing to Cancelled in 15 days all the orders that have only cash on delivery payment. No matter the category.Rule #2
Change from Processing to Cancelled in 90 days all the orders that have a product from a category “Gift Cards” and have only bank transfer as payment.Rule #3
Change from On-Hold to Cancelled in 72 hours all the orders that have a product from a category “Gift Cards” and have only bank transfer as payment.Rule #4
Change from Processing to Cancelled in 90 days all the orders that have a product from a category “Redeem Cashback” and have only wallet as payment. (Using tera wallet plugin)Thanks again for your time and help!
Happy to help ??
Yes, all you’ve described is doable. Settings are quite straightforward, but here there are, just in case:
Rule #1
* Status from: Processing
* Status to: Cancelled
* Time trigger: 15
* Time trigger unit: day(s)
* Conditions > Payment gateways: Cash on deliveryRule #2
* Status from: Processing
* Status to: Cancelled
* Time trigger: 90
* Time trigger unit: day(s)
* Conditions > Payment gateways: Bank transfer
* Conditions > Product categories: Gift CardsRule #3
* Status from: On hold
* Status to: Cancelled
* Time trigger: 72
* Time trigger unit: hour(s)
* Conditions > Payment gateways: Bank transfer
* Conditions > Product categories: Gift CardsRule #4
* Status from: Processing
* Status to: Cancelled
* Time trigger: 90
* Time trigger unit: day(s)
* Conditions > Payment gateways: Tera wallet
* Conditions > Product categories: Redeem CashbackGive it a try and let me know if you have any questions.
Awesome. Thank you!
Hi,
Sorry to bother you again.
I created a real cron job but now i have this warning message https://prnt.sc/26nmls9.
Crons (DISABLE_WP_CRON) are disabled on your server! Crons must be enabled for order status rules to be processed. You can read more here.
Alternatively you can use “real” (i.e. server) cron jobs. To do this, you need to enable “Allow rules processing via URL” option in plugin settings and set up a cron job on your server.I have already enable Allow rules processing via URL
Thanks again
Hi @roberto22,
If you’ve configured your WP cron as described here – simply ignore the message, it’s not entirely correct – I will update (or maybe even remove) it in the next plugin version.
P.S. As for the “Allow rules processing via URL” checkbox – as you are replacing all your WP cron jobs with a server cron, you can keep this checkbox disabled – it’s only needed if you are going to create a separate cron on your server for the order rules only (i.e. instead of replacing all WP cron jobs with a server cron, as I believe you did).
P.P.S. And make sure that you didn’t disable the “Use WP cron” checkbox in “WooCommerce > Settings > Order Status Rules > Advanced > Periodical Processing Options” – you still need it in your case.
Hope this helps. Please let me know if you have any questions.
Thanks!
Happy to help ?? Let me know if you need anything else.
And if you like the plugin, please consider leaving me a rating.
Hi,
I have my site on hostinger and they helped me create real cron job. So i think the real cron job is properly configured.
I disabled “Allow rules processing via URL” and i have still enabled Periodical Processing Options to once every minute.
But now the orders are not changing, not even on load page.
Any suggestions? Thanks again for your time and help!
Hi @roberto22,
Sorry for the late reply.
Hmm… Are you sure that other WP cron jobs are running properly (I mean, not related to our order rules plugin)? Also, when you’ve configured it on hostinger – what interval did you set? I.e. how often is WP cron triggered there?
We can also try to make it work another way. As mentioned, there is “Allow rules processing via URL” checkbox – if you enable it, you can create a real cron on hostinger for our order rules only. I.e. you can create a cron job there, which will trigger this e.g. every 1 minute:
https://example.com?alg_wc_order_status_rules_process_rules
* you need to replace
example.com
with your real domain name.And in this case, you can bring all standard WP cron jobs back from hostinger, as it was before.
Hi,
Thanks for the help!
Hi @roberto22,
Happy to help ?? Please let me know if you were able to solve it.
- The topic ‘Order status not changing’ is closed to new replies.