This snippet enables you to enhance customer satisfaction by automatically applying discounts at checkout.
add_action('woocommerce_before_cart', 'apply_discount_code');
function apply_discount_code() {
if (WC()->cart->get_subtotal() > 100) {
WC()->cart->apply_coupon('SAVE10'); // Auto-apply coupon
}
}