Skip to content

Instantly share code, notes, and snippets.

@ofernandolopes
Forked from eltondev/functions.php
Last active August 29, 2015 14:27
Show Gist options
  • Save ofernandolopes/5cfc6f09b37dee11341b to your computer and use it in GitHub Desktop.
Save ofernandolopes/5cfc6f09b37dee11341b to your computer and use it in GitHub Desktop.
Hide Cupom Cart / Checkout WooCommerce
<?php
// hide coupon on cart
function hide_coupon_on_cart( $enabled ) {
if ( is_cart() ) {
$enabled = false;
}
return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_on_cart' );
// hide coupon on checkout
function hide_coupon_on_checkout( $enabled ) {
if ( is_checkout() ) {
$enabled = false;
}
return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_on_checkout' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment