Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Created March 9, 2023 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webtoffee-git/8322941bec249df005ce1abcfab447cf to your computer and use it in GitHub Desktop.
Save webtoffee-git/8322941bec249df005ce1abcfab447cf to your computer and use it in GitHub Desktop.
To hide applied coupon from the cart and checkout pages
<?php // do not copy this line
add_action('wp_footer', 'wt_sc_remove_coupon_code_from_cart_checkout_totals_table');
function wt_sc_remove_coupon_code_from_cart_checkout_totals_table()
{
if(is_cart() || is_checkout())
{
if( class_exists( 'WooCommerce' ))
{
?>
<style>
.cart_totals .shop_table .cart-discount{ display: none; }
#order_review .shop_table .cart-discount{ display: none; }
</style>
<?php
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment