You can use this code to add an action on the admin order page:
const CUSTOM_ACTION_CODE = "my-plugin__custom-action-code";
add_filter("woocommerce_order_actions", function ($actions) {
$actions[CUSTOM_ACTION_CODE] = "label of the custom action";
return $actions;
});
add_action("woocommerce_order_action_" . CUSTOM_ACTION_CODE, function (\WC_Order $order) {
// here the code of the treatement of $order
//...
});
Related Posts:
- WooCommerce: Add New Report Tab
- Woocommerce change tax rate programmaticly
- How do I get the latest note on the order at woocommerce? [closed]
- Create WooCommerce new order with specific ID
- Remove Order List Row Link in WooCommerce Admin?
- How can I add an additional action button into the woocommerce admin order page?
- Woocommerce: Prevent sending of email when order is “Completed”
- Admin access for custom user capabilities
- how to do a processing Orders into Complete after x Minutes or x hour in WooCommerce [closed]
- WooCommerce quick checkout form? [closed]
- How to be able to edit custom address fields in WooCommerce admin?
- WooCommerce order complete email logic
- WooCommerce orderby template disappears and not longer works on search page
- How to Update the Order-Items While Editing an Order on the WooCommerce Admin Order Screen [closed]
- How to get woocommerce selected variation from order object
- How to search variable product by its variation id in woocommerce admin product search box?
- Send email notifications to a defined email address depending if a product in order has a specific TAG [closed]
- Cancelled orders move to Trash automatically in Woocommerce – how to disable?
- Create a regular post for every WooCommerce order
- How to alter taxes amounts when updating an order
- WordPress woocommerce new order email not working
- Custom Email via Hook only for completed order
- Access custom meta_data in processing order email
- Sort products by Sale price and stock status
- Create order actions from custom fields woocommerce
- How to sort products by price ASC and place all no price products to the end? (Woocommerce)
- how can my customers view their purchased products history like an invoice in a specific page on WordPress
- Change the customer’s name to a link on an order management page
- How to save one API response to WooCommerce order meta data
- Add button linked to single product page on order detail page
- Multiple sorting criteries (order by)
- Woocommerce order_complete email dont send after changing order status via sql
- Conditional email recipient based off Shipping Method [closed]
- How to hide metaboxes in WordPress Admin on WooCommerce “Add Product” page – Remove side sortables for a specific user role
- Some Admin disappeared
- Product atributes in title of order (not in description)
- WooCommerce: Order Details Table > Add Product Meta
- Why is my WordPress admin not working
- Woocommerce admin order email customize – remove product short description
- Critical error on woocommerce checkout page
- How to display product price of the product in loop
- Limit users to one active subscription in WooCommerce Subscriptions? [closed]
- WooCommerce add_to_cart() with custom price [closed]
- WooCommerce HTML after short description if product is in specific category
- How to get total count for each star rating?
- WooCommerce Apply Coupon to order AFTER taxes
- Auto update cart after quantity change
- Sort wp_nav_menu() by menu order
- How to implement Handling Fee like the Shipping on Cart and Checkout page on WooCommerce [closed]
- why featured product not updated in postmeta table in woocommerce?
- woocommerce image product add a class and data-src attributes
- Woo create order only after payment done
- Change Category Widget Dropdown List Select Name
- wooCommerce checkout page State / County (optional) validate not working
- WooCommerce – Multiple meta query not working
- WooCommerce limited role
- Skip WooCommerce 4.5.x onboarding with WP-CLI [closed]
- WP All Import manual Cron
- Download permission for non-purchased products
- Display FREE for $0 products in woocommerce ++++ [closed]
- How to add existing categories into a post using wp_insert_post
- create comment box in woo-commerce shop order [closed]
- Woocommerce: how to know if the customer is canceled the order or the shop owner? [closed]
- Have I got this IF Statement correct?
- WooCommerce Price Filter not working? [closed]
- How to replace WooCommerce Product Gallery Trigger icon using PHP/CSS? [closed]
- Woocommerce Sort by default variation price
- Add Name and SKU Main Product to Secondary Product to Cart
- WooCommerce – Split Multiple Items into Individual Line Items
- Change “Select Options” label in button to “Buy Now!” in store page
- How to use Custom Field to display product brief description in shop page with Woocommerce?
- Woocommerce product import exports product with price rounded to integer? [closed]
- How to hook to function of woocommerce product export _regular_price?
- Woocommerce custom log in and register
- Add “new” tag for existing products
- CallBack URL for payment gateway redirecting to homepage instead of executing callback function
- Display when items are in Woocommerce cart but hide when empty
- Printing product variation return array to string conversion error
- woocommerce deposit Form with AJAX and shortcode won’t update but add to previous output
- How to retrieve a Menu Name by Menu Location with ACF fields
- How to update permalink programmatically?
- Custom pagination permalink structure Product page
- Display shipping class in single product page woocommerce
- Editing product categories suddenly crashes website and goes back to wordpress installation
- ACF in WooCommerce mail template
- Woocommerce – Add custom email footer to specific email template
- Merge “description” and “additional informations” product tab
- I need to refresh the checkout page if someone changes the zip code
- Correct method of reducing the number of images created by WP and Woo together
- add_filter not works in ajax
- How to skip woocommerce checkout after payment page? [closed]
- Product thumbnail size in catalog
- how can i import the csv file in wordpress woocommerce.?
- some products free and some product is not free for shipping
- Change wp-login.php? Problem with .htaccess password protection and multi user shop
- Save Woocomerce discount as percentage to database
- How to bypass Woocommerce checkout validation from the plugin? [closed]
- Custom product loop avoiding duplicates
- Woocommerce – Remove ‘Buy Product’ Button + Make Product Thumbnails Clickable
- Making product image in woocommerce invoice linkable [closed]