How To Add Custom Action Tools in WooCommerce

by Owais Alam  August 8, 2017

WooCommerce offers a list of useful default tools (accessed by going to System Status > Tools). However, it is easy to your own custom buttons to this area. This way, you could add custom functionality to your WooCommerce store.

Custom Action Tools in WooCommerce

In this tutorial, I will create a plugin that would add custom action in the WooCommerce tools. In order to add the button, I will start by the hook woocommerce_debug_tools. Next, when  I will create a callback function (called debug_button_action()) that would be triggered when the users click the button. I will place the custom code for the custom action in this function.

Here is the code for the plugin:

Install & Activate the Plugin

The next step is the activation of the plugin. The first step is the creation of a folder in the Plugin folder. Name the folder “Cloudways Tools” and then create a file inside this folder with the name “CW_tools_for_custom_button.php”.

Next go to the WordPress Admin Panel and you will see a new entry with the name Cloudways Tools For Custom Button.

Custom Tool Plugin

Once you have activated the plugin, go to WooCommerce > System  Status

Tool Button

Once you have hit the button, you will see the following:

Triggered Action

Conclusion

In this short tutorial, I discussed how you could easily create and activate a simple plugin that would create a custom order action to the WooCommerce System Status > Tools. You could easily extend this plugin to add your own custom action to WooCommerce store. Let me know if you need help with the code. Just leave a comment and I will get back to you.

Start Creating Web Apps on Managed Cloud Servers Now!

Easy Web App Deployment for Agencies, Developers and E-Commerce Industry

About Owais Alam

is the WordPress Community Manager at Cloudways - A Managed WooCommerce Hosting Platform and a seasoned PHP developer. He loves to develop all sorts of websites on WordPress and is in love with WooCommerce in particular. You can email him at owais.alam@cloudways.com

Stay Connected:

You Might Also Like...