wordpress - Hide and show Complete action shortcut in woocommerce -


i searched lot didn't find solution work me.

i developing plugin wordpress work woocommerce. want when order status in pending state want hide complete action shortcut on orders listing page.

enter image description here

in above picture want hide middle button when order in pending state. want in plugin.

any suggestion. in advance.

yes can done using 'woocommerce_admin_order_actions' filter , adding function filter.

code added in plugin:

add_filter('woocommerce_admin_order_actions','wdm_verify_product_limitation',5,2); function wdm_verify_product_limitation( $actions, $the_order ){ if ( $the_order->has_status( array( 'pending','on-hold') ) ) { unset($actions['complete']); } return $actions; }

here checking if order in 'pending' or 'on-hold' state don't show complete button order.(in case remove 'on-hold' code )

enter image description here

have tested same. let me know if works you


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -