woocommerce_cart_totals_coupon_html

The WooCommerce woocommerce cart totals coupon html hook.

Description

apply_filters( 'woocommerce_cart_totals_coupon_html', (unknown) $coupon_html, (unknown) $coupon, (number) $discount_amount_html ); 

Parameters (3)

0. $coupon_html (unknown)
The coupon html.
1. $coupon (unknown)
The coupon.
2. $discount_amount_html (number)
The discount amount html.

Usage

To run the hook, copy the example below.
  1. $coupon_html = apply_filters( 'woocommerce_cart_totals_coupon_html', $coupon_html, $coupon, $discount_amount_html ); 
  2.  
  3. if ( !empty( $coupon_html ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the woocommerce_cart_totals_coupon_html callback 
  2. function filter_woocommerce_cart_totals_coupon_html( $coupon_html, $coupon, $discount_amount_html ) { 
  3. // make filter magic happen here... 
  4. return $coupon_html
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_cart_totals_coupon_html', 'filter_woocommerce_cart_totals_coupon_html', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_cart_totals_coupon_html', 'filter_woocommerce_cart_totals_coupon_html', 10, 3 ); 

Defined (1)

The filter is defined in the following location(s).

/includes/wc-cart-functions.php  
  1. echo wp_kses( apply_filters( 'woocommerce_cart_totals_coupon_html', $coupon_html, $coupon, $discount_amount_html ), array_replace_recursive( wp_kses_allowed_html( 'post' ), array( 'a' => array( 'data-coupon' => true ) ) ) );