Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for custom status to be cancelled #9

Open
jordantrizz opened this issue May 13, 2020 · 2 comments
Open

Allow for custom status to be cancelled #9

jordantrizz opened this issue May 13, 2020 · 2 comments

Comments

@jordantrizz
Copy link

Hello, I'm wondering if you'd be interested in allowing custom order statuses to be canceled? Right now it's not possible as you're checking the status being passed with an array of authorized statutes.

            $woo_status_authorized = array(
                    'pending',
                    'on-hold',
                    'processing',
                    'completed',
                    'refunded',
                    'failed'
            );

You should be able to use any status, regardless if it's authorized. It just provides more flexibility.

Also, have you considered adding in debugging so that if a mistake occurs, a user can recover all the orders that were canceled? Furthermore, a "Don't do anything" option for testing that doesn't actually cancel the order but prints out debugging information on what orders would have been cancelled.

@rvola
Copy link
Owner

rvola commented May 14, 2020

hello @jordantrizz and thanks for the donation 👍

Yes it is true that the status check is annoying, but at the origin of the plugin, was normally for pending orders. Then someone asked me to cancel orders in another status.

The concern which could have is to make a request for cancellation on a post which is not an order.

I will think to open this possibility.

When it comes to testing and dry-running, I don't think it's necessary (or else I'm wrong), because in general,
the system is not supposed to crash (the actions it does are low) and the dry-run was not considered, because from the beginning the plugin wanted the simplest and lightest (that's why we use hooks).

I don't know if this function would interest a lot of people

@jordantrizz
Copy link
Author

You could check to confirm the post is an order, you could also confirm what statuses are set up in WooCommerce. Some installations do have custom order statuses.

If you do allow statuses outside of the current defined by a default WooCommerce installation, the dry run helps the user confirm what they're doing is correct.

Thanks for making this!

rvola added a commit that referenced this issue Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants