Created
March 9, 2023 07:46
-
-
Save webtoffee-git/8322941bec249df005ce1abcfab447cf to your computer and use it in GitHub Desktop.
To hide applied coupon from the cart and checkout pages
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 | |
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