• Resolved Samir Rifai

    (@srifaia)


    Hi,
    I’ve set HOURLY mode to 1 hour in a specific payment. I’ve made 2 test orders, in different times, but neither of them are canceled.
    It′s already been more than 2 hours since each order was made.
    Is there a bug or does it need an update?
    Much appreciated that you’ve made this plugin.
    Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Samir Rifai

    (@srifaia)

    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.

    Thread Starter Samir Rifai

    (@srifaia)

    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 4 years, 6 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

    Thread Starter Samir Rifai

    (@srifaia)

    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.

    Thread Starter Samir Rifai

    (@srifaia)

    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

    Thread Starter Samir Rifai

    (@srifaia)

    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 - https://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 !

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Hourly mode not working’ is closed to new replies.