woocommerce_ajax_order_item

The WooCommerce woocommerce ajax order item hook.

Description

apply_filters( 'woocommerce_ajax_order_item', (unknown) $order_get_item_item_id, (unknown) $item_id ); 

Parameters (2)

0. $order_get_item_item_id (unknown)
The order get item item id.
1. $item_id (unknown)
The item id.

Usage

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

Defined (1)

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

/includes/class-wc-ajax.php  
  1. $item = apply_filters( 'woocommerce_ajax_order_item', $order->get_item( $item_id ), $item_id );