Discount Sale
  • Days
  • Hrs
  • Mins
  • Secs
30% Off

Use coupon code 'MDS30' Limited Offer!!

Star

Home > Docs > Smart Coupons for WooCommerce > Hide Coupon Field in WooCommerce Checkout & Cart Pages

Hide Coupon Field in WooCommerce Checkout & Cart Pages

Last updated on February 10, 2025

This article shows a shortcut to hide coupon field in WooCommerce Checkout & Cart pages.

  1. Navigate to the Theme file editor.
  2. Access the function.php file.
  3. Copy the code snippet given below.
  4. Paste the code into the function.php file.
  5. Save changes.

Step 1: Access the WordPress theme file editor

From the WordPress Dashboard, navigate to Appearance > Theme Editor to open the WordPress Theme Editor screen.

Step 2: Open functions.php file

You can see the list of files in your active theme folder on the Theme Editor screen. Please scroll down the list and click on the Theme Functions (functions.php) file to open it in the text editor screen.

Step 3: Copy the PHP code

Depending on which page you want to disable the coupon code field, copy either of the two PHP code snippets below.

PHP Code to Hide Coupon Field in WooCommerce Cart

PHP Code to Hide Coupon Field in WooCommerce Checkout

Step 4: Add the PHP code to functions.php

In the WordPress Theme Editor screen, scroll down to the bottom of the functions.php file and paste the code at the end to hide coupon field in WooCommerce Checkout & Cart pages.

Step 5: Update code

Click on the Update file button to save the code.