• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

REQ Plugin autocompete woocommerce orders

Hahaha - It's funny. I've been looking for this kind of plugin just now that can automatically change the Order status from "On hold" to "Completed" when someone trying to complete from the cart to the checkout process.

Been searching in google, but it's not working, free plugins/snippets, but no luck. So I decided to ask ChatGPT. It provides me with a working one hahaha :p

Copy and paste it into your WordPress theme's functions.php file or in a custom plugin...

function auto_complete_orders_on_hold() {
$args = array(
'status' => 'on-hold',
'limit' => -1,
);
$orders = wc_get_orders( $args );
foreach ( $orders as $order ) {
$order->update_status( 'completed' );
}
}
add_action( 'woocommerce_thankyou', 'auto_complete_orders_on_hold' );

Important note:
I've been doing some tests in localhost, not on the live site.
 
  • Like
Reactions: alex1111
Hah!
That IS funny, and kind of cool too.

I'm not at all good at adding custom code - where or how should I add this?
Or what should I use to place the code snippet to the site?
ANY guidance you can offer would be greatly appreciated~
 
Hah!
That IS funny, and kind of cool too. Oddly any time I try to get on CahtGPT I keep being told its full/has no access.
Let me know if you find this works on a live site, pls sir.
 
There are 2-ways to use/implement a snippet/custom snippet in a theme's functions.php file or in a custom plugin. In my case, I just put it in a theme's functions.php, worth noting that every time the theme updates, the custom snippet will be vanished/gone. Just take note of that. Always back up the custom snippet/s if find it useful.

In my case, I just put it in a theme's functions.php. Here's how:

Go to Appearance > Theme File Editor > then choose the right/correct used theme > function.php

Here, (I just put it at the bottom of the code). And I add a separator, something like that to easily locate in case of editing the codes. And paste the code. It works in my case, in offline tests. If it works offline, for sure, it works on live sites too.

Or can edit the file directly from the file manager.

1.PNG
 
  • Like
Reactions: KomissarMinsky
Hahaha - It's funny. I've been looking for this kind of plugin just now that can automatically change the Order status from "On hold" to "Completed" when someone trying to complete from the cart to the checkout process.

Been searching in google, but it's not working, free plugins/snippets, but no luck. So I decided to ask ChatGPT. It provides me with a working one hahaha :p

Copy and paste it into your WordPress theme's functions.php file or in a custom plugin...

function auto_complete_orders_on_hold() {
$args = array(
'status' => 'on-hold',
'limit' => -1,
);
$orders = wc_get_orders( $args );
foreach ( $orders as $order ) {
$order->update_status( 'completed' );
}
}
add_action( 'woocommerce_thankyou', 'auto_complete_orders_on_hold' );

Important note:
I've been doing some tests in localhost, not on the live site.
Still, AI will defeat us)
 
  • Like
Reactions: 3nails1cross
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock