<gtm4wp_wpfilter_eec_product_array>

The Google Tag Manager for WordPress gtm4wp wpfilter eec product array hook.

Description

apply_filters( '<gtm4wp_wpfilter_eec_product_array>', (unknown) $temp_productdata, (string) $productdetail ); 

Parameters (2)

0. $temp_productdata (unknown)
The temp productdata.
1. $productdetail (string) => "productdetail"
The productdetail.

Usage

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

Defined (8)

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

/integration/woocommerce.php  
  1. $eec_product_array = apply_filters( GTM4WP_WPFILTER_EEC_PRODUCT_ARRAY, $_temp_productdata, "productdetail" ); 
  1. $eec_product_array = apply_filters( GTM4WP_WPFILTER_EEC_PRODUCT_ARRAY, $_temp_productdata, "purchase" ); 
  1. $eec_product_array = apply_filters( GTM4WP_WPFILTER_EEC_PRODUCT_ARRAY, $_temp_productdata, "checkout" ); 
  1. $eec_product_array = apply_filters( GTM4WP_WPFILTER_EEC_PRODUCT_ARRAY, $_temp_productdata, "addtocartsingle" ); 
  1. $eec_product_array = apply_filters( GTM4WP_WPFILTER_EEC_PRODUCT_ARRAY, $_temp_productdata, "addtocartproductlist" ); 
  1. $eec_product_array = apply_filters( GTM4WP_WPFILTER_EEC_PRODUCT_ARRAY, $_temp_productdata, "cart" ); 
  1. $eec_product_array = apply_filters( GTM4WP_WPFILTER_EEC_PRODUCT_ARRAY, $_temp_productdata, "widgetproduct" ); 
  1. $eec_product_array = apply_filters( GTM4WP_WPFILTER_EEC_PRODUCT_ARRAY, $_temp_productdata, "productlist" );