Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WooCommerce - hide the coupon form everywhere, but leave coupons enabled for use with plugins like Smart Coupons and URL Coupons
<?php
// hide coupon form everywhere
function hide_coupon_field( $enabled ) {
if ( is_cart() || is_checkout() ) {
$enabled = false;
}
return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_field' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.