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.
<?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
- WooCommerce: cart and checkout: Free-shipping progress, coupon links, quantity limits and a cleaner checkout.