wcml_filter_cart_item_data

The WooCommerce Multilingual wcml filter cart item data hook.

Description

apply_filters( 'wcml_filter_cart_item_data', (unknown) $cart_contents ); 

Parameters (1)

0. $cart_contents (unknown)
The cart contents.

Usage

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

Defined (1)

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

/inc/class-wcml-cart.php  
  1. return apply_filters( 'wcml_filter_cart_item_data', $cart_contents );