Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'wcfm_orders_additional_info_column_label', function( $column_label ) {
- if (current_user_can('administrator')) {
- return 'Tax';
- }
- return $column_label;
- });
- add_filter( 'wcfm_orders_additonal_data_hidden', function ($is_allowed) {
- if (current_user_can('administrator')) {
- return false;
- }
- return true;
- });
- add_filter( 'wcfm_orders_additonal_data', function( $column_data, $order_id ) {
- if (current_user_can('administrator')) {
- $order = wc_get_order( $order_id );
- if ( $order->get_total_refunded() > 0 ) {
- $column_data_html = '<del>' . strip_tags( wc_price( $order->get_total_tax(), array( 'currency' => $order->get_currency() ) ) ) . '</del> <ins>' . wc_price( $order->get_total_tax() - $order->get_total_tax_refunded(), array( 'currency' => $order->get_currency() ) ) . '</ins>';
- } else {
- $column_data_html = wc_price( $order->get_total_tax(), array( 'currency' => $order->get_currency() ) );
- }
- }
- return $column_data_html;
- }, 50, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement