woocommerce_protected_product_add_to_cart

The WooCommerce woocommerce protected product add to cart function.

Description

woocommerce_protected_product_add_to_cart( $passed, $product_id ); 

Parameters (2)

0. $passed
The passed.
1. $product_id
The product id.

Usage

  1. if ( !function_exists( 'woocommerce_protected_product_add_to_cart' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-deprecated-functions.php'; 
  3.  
  4. // The passed. 
  5. $passed = null; 
  6.  
  7. // The product id. 
  8. $product_id = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = woocommerce_protected_product_add_to_cart($passed, $product_id); 
  12.  

Defined (1)

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

/includes/wc-deprecated-functions.php  
  1. function woocommerce_protected_product_add_to_cart( $passed, $product_id ) { 
  2. return wc_protected_product_add_to_cart( $passed, $product_id );