Created
May 23, 2024 11:58
-
-
Save webtoffee-git/e0ece1cb56caa35f41ff8103703cf201 to your computer and use it in GitHub Desktop.
Code snippet to hide print button in my account order details page and order list page - By WebToffee ( WooCommerce PDF Invoice, Packing Slips, Delivery Notes and Shipping labels )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //Do not copy this line of code | |
add_filter('wt_pklist_is_frontend_order_list_page_print_action','wt_hide_print_button_order_list_page',10,3); | |
function wt_hide_print_button_order_list_page($show_button, $template_type, $action) | |
{ | |
if ( 'invoice' === $template_type ) { | |
if ( 'print' === $action ) { | |
$show_button = false; | |
} | |
} | |
return $show_button; | |
} | |
add_filter('wt_pklist_show_document_button','wt_hide_print_button_my_account_order_details',10,5); | |
function wt_hide_print_button_my_account_order_details($show_button,$action,$location,$template_type,$order) | |
{ | |
if ( 'invoice' === $template_type ) { | |
if ( 'print' === $action ) { | |
$show_button = false; | |
} | |
} | |
return $show_button; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment