Support » Plugin: WooCommerce Cancel Abandoned Order » Cancel Order upon the canelation

  • Rahim

    (@rahimvaziri)


    Hello Author,
    Thank you for the plugin.

    How can I cancel the order immediately after coming back from the gateway, if the customer has refused to make the payment?

    I mean I would like to never see the payment option in the customer’s orders on my-account page.

    Thank you.

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author RVOLA

    (@rvola)

    Hello Rahim!
    Normally it is up to the author of the gateway to do this. I invite you to look at the hook level on the “thank_you” page

    Rahim

    (@rahimvaziri)

    Hi @rvola

    I have changed the mode to hourly and put “0” for those two options below that.

    This will not help with my purpose?

    Regards

    Plugin Author RVOLA

    (@rvola)

    I did a quick test, it seems to work.
    We must remember to put the status ‘pending’ also in this hook: https://github.com/rvola/woo-cancel-abandoned-order/wiki/Change-the-status-type-for-the-cancellation-process

    Rahim

    (@rahimvaziri)

    Hi @rvola
    Thank you.

    Can you please provide the final code to me?
    And also the function you provided on this link, has a syntax error in the end. https://prnt.sc/skhse1

    It needs “);” otherwise you get error via this function.

    Plugin Author RVOLA

    (@rvola)

    i just fixed it, thanks 😉

    function woa_custom_statustocancel_hook( $status ) {
    	$status[] = 'pending';
    	return $status;
    }
    add_filter( 'woo_cao_statustocancel', 'woa_custom_statustocancel_hook', 10, 1 );
    • This reply was modified 6 months, 1 week ago by RVOLA.
    Rahim

    (@rahimvaziri)

    @rvola
    I thank you 🙂

    So all I need to cancel the pending orders right after declining the payment from the customer is to install your plugin and add the code above to functions.php. am I right?

    Should I still keep the mode to hourly and “0” for two options below the mode in the gateway section?

    Plugin Author RVOLA

    (@rvola)

    yes it’s all good.
    If you have activated it on your gateway and set it to time and 0, it will pass every hour to cancel all the orders “pending”

    Rahim

    (@rahimvaziri)

    What about immediately?

    Is there any chance to don’t to wait for an hour to cancel all the unpaid orders right after the come back from the gateway to thank-you page?

    Plugin Author RVOLA

    (@rvola)

    not with this plugin. It is normally your gateway which must program it by me.

    I use a gateway and when I click on “cancel” it cancels my order.
    Contact the developer of this gateway.

    And finally if you have the pleasure of giving me a note here, thank you.
    https://wordpress.org/support/plugin/woo-cancel-abandoned-order/reviews/#new-post

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Cancel Order upon the canelation’ is closed to new replies.