get_product

The WooCommerce get product function.

Description

get_product( (constant) $the_product = false, (array) $args = array() ); 

Parameters (2)

0. $the_product — Optional. (constant) => false
The product.
1. $args — Optional. (array) => array()
The args.

Usage

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

Defined (1)

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

/includes/wc-deprecated-functions.php  
  1. function get_product( $the_product = false, $args = array() ) { 
  2. wc_deprecated_function( __FUNCTION__, '3.0', 'wc_get_product' ); 
  3. return wc_get_product( $the_product, $args );