woocommerce_graphflow_cart_recommended_products_total

The WooCommerce Recommendations by Graphflow woocommerce graphflow cart recommended products total hook.

Description

apply_filters( 'woocommerce_graphflow_cart_recommended_products_total', (unknown) $num_per_prod ); 

Parameters (1)

0. $num_per_prod (unknown)
The num per prod.

Usage

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

Defined (2)

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

/templates/cart/graphflow-recommended-products.php  
  1. $gf_recommendations = $GLOBALS['wc_graphflow']->get_api()->get_user_product_recommendations( $cart_item['product_id'], $gf_user, apply_filters( 'woocommerce_graphflow_cart_recommended_products_total', $num_per_prod ) ); 
  1. $gf_products = array_slice( $gf_products, 0, apply_filters( 'woocommerce_graphflow_cart_recommended_products_total', $gf_num ) );