Hide coupon discount raw if no coupon has been applied on WooCommerce cart page
问题 I add coupons and discounts total savings to my cart page. My code works fine but I have an additional question. This is the code I am currently using: add_action( 'woocommerce_cart_totals_before_shipping', 'show_total_discount_cart_checkout', 9999 ); function show_total_discount_cart_checkout() { global $woocommerce; $discount_total = 0; foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) { $product = $values['data']; if ( $product->is_on_sale() ) { $regular_price = $product->get