Last active
April 18, 2024 06:41
-
-
Save webtoffee-git/4a5d0c4dcde659496638177a1ea1e842 to your computer and use it in GitHub Desktop.
Code to to remove incl. tax text from subtotal and total - By WebToffee
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('wf_pklist_alter_find_replace','wt_pklist_show_order_total' ,10,6); | |
function wt_pklist_show_order_total($find_replace, $template_type, $order, $box_packing, $order_package, $html) | |
{ | |
if( 'invoice' === $template_type ) | |
{ | |
$order_id = (WC()->version < '2.7.0') ? $order->id : $order->get_id(); | |
$user_currency = get_post_meta($order_id, '_order_currency', true); | |
$total_price = (WC()->version< '2.7.0' ? $order->order_total : get_post_meta($order_id,'_order_total',true)); | |
if( !empty( $total_price ) ) | |
{ | |
$find_replace['[wfte_product_table_payment_total]']=wc_price($total_price,array('currency'=>$user_currency)); | |
} | |
} | |
return $find_replace; | |
} | |
add_filter('wf_pklist_alter_tax_info_text','wf_pklist_remove_tax_text',10,6); | |
function wf_pklist_remove_tax_text($tax_data, $tax_type, $tax_items_total, $user_currency, $template_type, $order) | |
{ | |
if( 'invoice' === $template_type ) | |
{ | |
return $tax_data = ''; | |
} | |
return $tax_data; | |
} | |
add_filter('wf_pklist_alter_subtotal_formated', 'wt_pklist_alter_formated_sub', 10, 4); | |
function wt_pklist_alter_formated_sub($sub_total_formated, $template_type, $sub_total, $order) | |
{ | |
$sub_total_formated = wc_price($sub_total); | |
return $sub_total_formated; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment