Last active
April 20, 2017 18:52
-
-
Save mtruitt/031b6f63da05fb0c2e753533848d6321 to your computer and use it in GitHub Desktop.
Hide Coupon Field
This file contains hidden or 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 | |
| // Hide coupon field | |
| function hide_coupon_field( $enabled ) { | |
| if ( is_cart() ) { | |
| $enabled = false; | |
| } | |
| return $enabled; | |
| } | |
| add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_field' ); | |
| // hide coupon field on checkout page | |
| function hide_coupon_field_on_checkout( $enabled ) { | |
| if ( is_checkout() ) { | |
| $enabled = false; | |
| } | |
| return $enabled; | |
| } | |
| add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_field_on_checkout' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment