Skip to content

Instantly share code, notes, and snippets.

@finalwebsites
Created October 20, 2023 14:14
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 finalwebsites/c61ab3b55905b826446e27b17817bf92 to your computer and use it in GitHub Desktop.
Save finalwebsites/c61ab3b55905b826446e27b17817bf92 to your computer and use it in GitHub Desktop.
Disable the coupon form on the checkout page from WooCommerce
<?php
// place this code inside the functions.php file from your child code.
function fw_disable_coupon_field_on_checkout( $enabled ) {
if ( is_checkout() ) {
$enabled = false;
}
return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'fw_disable_coupon_field_on_checkout' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment