Just to clarify, both orders are ON-HOLD orders.
Plugin Author
RVOLA
(@rvola)
Hi @srifaia
I reassure you the plugin works.
Have you activated cancellation in the gateways?
The hourly cancellation combined with the lifetime settings, will search every hour for pending orders which have more than X hours according to your settings.
This plugin works with WP-cron from WordPress.
The site must therefore be visited regularly to perform its cron tasks on time.
Hi,
Maybe I forgot to also add the status type (I thought it only needed the gateway):
function woa_custom_statustocancel_hook( $status ) {
// More explication on WooCommerce status : https://docs.woocommerce.com/document/managing-orders/
//$status[] = 'pending';
$status[] = 'on-hold';
//$status[] = 'processing';
//$status[] = 'completed';
//$status[] = 'refunded';
//$status[] = 'failed';
return $status;
}
add_filter( 'woo_cao_statustocancel', 'woa_custom_statustocancel_hook', 10, 1 );
The payment method goes to ON-HOLD, so I only defined that status.
I´m testing this new setup.
Thanks.
-
This reply was modified 5 years, 9 months ago by
Samir Rifai.
Plugin Author
RVOLA
(@rvola)
by default it only takes care of the “on-hold” status, this hook allows the developer to change that. You don’t need it in your example.
Just the gateway
Oh…
I’m confused then.
For the gateway I have this:
function woa_custom_gateways_hook( $gateways ) {
$gateways[] = 'wocommerce_yape_peru'; // Yape.
return $gateways;
}
add_filter( 'woo_cao_gateways', 'woa_custom_gateways_hook', 10, 1 );
The settings on Yape method shows fine, I have activated the cancellation, hourly mode and 1 hour. But for some reason is not working for me.
Plugin Author
RVOLA
(@rvola)
From your explanation, everything seems ok.
If the order is not canceled, it is probably the cron that does not wake up or the payment method for the order to be canceled is not Yape.
Ok, I’ll do some further testing during the weekend.
Maybe I’ll disable the default wordpress cron and activate a real one in my hosting panel.
I’ll let you know how it goes.
Many thanks.
Plugin Author
RVOLA
(@rvola)
ok, I’m waiting for your news
good luck
Ok, I finally got it to work.
I had to do the following:
1. Disable WordPress native script in wp-config.php file:
define('DISABLE_WP_CRON', true);
2. Set up a real cron job in my hosting provider and execute the wp-cron.php file with it (in my case Siteground):
wget -q -O - http://yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
These got the plugin to work.
Thanks for the support.
Plugin Author
RVOLA
(@rvola)
Thanks for your feedback !