Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

Hide the coupon field on the cart page

The cart page no longer shows the coupon box; customers enter coupons at checkout. Fewer people leave to hunt for codes.

  • Type PHP
  • Runs Everywhere (runs as WordPress loads)
  • Needs WooCommerce
  • Category WooCommerce
  • Tested with WordPress 7.1, WooCommerce 11.1
PHP
<?php

add_filter(
	'woocommerce_coupons_enabled',
	static fn( $enabled ) => is_cart() ? false : $enabled
);

Good to know

For the classic cart and checkout (the [woocommerce_cart] and [woocommerce_checkout] shortcodes). The block cart and checkout don’t use these hooks.

In these packs

Move your snippets over this afternoon.

Importing changes nothing until you switch over, and your old shortcodes keep working.