wcml_cart_contents

The WooCommerce Multilingual wcml cart contents hook.

Description

apply_filters( 'wcml_cart_contents', (unknown) $new_cart_data, (unknown) $cart_cart_contents, (unknown) $key, (unknown) $new_key ); 

Parameters (4)

0. $new_cart_data (unknown)
The new cart data.
1. $cart_cart_contents (unknown)
The cart cart contents.
2. $key (unknown)
The key.
3. $new_key (unknown)
The new key.

Usage

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

Defined (1)

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

/inc/class-wcml-cart.php  
  1. $new_cart_data = apply_filters( 'wcml_cart_contents', $new_cart_data, $cart->cart_contents, $key, $new_key );