Created
February 22, 2016 13:07
-
-
Save mikejolley/e73f9d061aaebd25ccdc to your computer and use it in GitHub Desktop.
WooCommerce - Remove subtotal row.
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
add_filter( 'woocommerce_get_order_item_totals', 'adjust_woocommerce_get_order_item_totals' ); | |
function adjust_woocommerce_get_order_item_totals( $totals ) { | |
unset($totals['cart_subtotal'] ); | |
return $totals; | |
} |
@DanBeezy, It still shows in mobile, how to hide it in mobile also.
To remove Subtotal row (in mobile also) add this code to style.css
.cart-subtotal { display: none !important; }
This is the answer for removing the subtotal from the cart and checkout pages
https://stackoverflow.com/questions/53277895/remove-subtotal-line-from-cart-and-checkout-pages-in-woocommerce
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did u try to hook to woocommerce_cart_item_subtotal ?
something like this:
function cart_subtotal_func_unset( $total ) {
unset($totals['cart_subtotal']);
return $totals;
}
add_filter('woocommerce_cart_item_subtotal', 'cart_subtotal_func_unset', 10, 2);