Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vidishpurohit/4973f69cc21ef34ca4271d26f38dacbf to your computer and use it in GitHub Desktop.
Save vidishpurohit/4973f69cc21ef34ca4271d26f38dacbf to your computer and use it in GitHub Desktop.
add subtotal to edit order admin woocommerce
/*
* This code will add subtotal to edit order admin woocommerce.
* Author: WooExtend
* Date: 13-02-2018
*/
add_action( 'woocommerce_admin_order_totals_after_discount', 'vp_add_sub_total', 10, 1);
function vp_add_sub_total( $order_id ) {
$order = wc_get_order( $order_id );
?><tr>
<td class="label">Subtotal:</td>
<td width="1%"></td>
<td class="total"><?php echo wc_price($order->get_subtotal());?></td>
</tr><?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment