Support » Plugin: WooCommerce Cancel Abandoned Order » Not getting it to work (WooCommerce Bookings)

  • Resolved Limpinho


    Hey guys!

    Sorry to bother you 🙁
    Thans for the great plugin, it’s really handy, expecially because I’m using Bookings, so

    I can’t use Woocommerce native Hold Stock (booking product has no stock).

    So I have managed to set the hook correctly for my custom gateway (multibanco_ifthen_for_woocommerce), set it for 24 hours (also tried 1 day), and it’s not working property:

    function woa_custom_gateways_hook( $gateways ) {
         $gateways[] = 'multibanco_ifthen_for_woocommerce';
         $gateways[] = 'mbway_ifthen_for_woocommerce';
         return $gateways;
    add_filter( 'woo_cao_gateways', 'woa_custom_gateways_hook', 10, 1 );

    I used Crontrol Plugin to force the cron to execute, it runs, but i still have orders > 24h 🙁

    I’ve runned your query straight in MySQL (with proper changes), and it returns the correct out of time ID’s:

    FROM $wpdb->posts as posts
    INNER JOIN $wpdb->postmeta as meta
    ON posts.ID = meta.post_id
    WHERE posts.post_type = 'shop_order'
    AND posts.post_status = 'wc-on-hold'
    AND posts.post_date < %s
    AND meta.meta_key = '_payment_method'
    AND meta.meta_value = %s

    I’ve also tried to change wc-on-hold to ‘wc-pending’, but it also does not work 🙁

    Any clues what might be wrong?
    Thanks a lot!

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Limpinho


    Guys, somehow, it ran at 00:09 and it’s working! =D

    Don’t know why Crontrol force run did not run lol.

    Thanks anyway 🙂

    Best regards,

    Plugin Author RVOLA


    Hello !
    Happy that it works.

    Normally if you use the “daily” mode, the search date is necessarily “the current date – the number of days requested at 0:00”.

    For example :

    We are the 2019-01-18 09:00:00
    I choose daily mode and 1 day delay.
    I am doing a test with WP Crontrol, the system will find in the date of research: 2019-01-17 00:00:00

    If my order is less than this date, it will be canceled.

    Be careful also, because if the server + WooCommerce is not correctly set at the date management (UTC), we can get offsets in hours.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Not getting it to work (WooCommerce Bookings)’ is closed to new replies.