woocommerce_add_order_item

The WooCommerce woocommerce add order item function.

Description

woocommerce_add_order_item( $order_id, $item ); 

Parameters (2)

0. $order_id
The order id.
1. $item
The item.

Usage

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

Defined (1)

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

/includes/wc-deprecated-functions.php  
  1. function woocommerce_add_order_item( $order_id, $item ) { 
  2. wc_deprecated_function( __FUNCTION__, '3.0', 'wc_add_order_item' ); 
  3. return wc_add_order_item( $order_id, $item );