woocommerce_add_order_again_cart_item хук-фильтрWC 1.0

Add to cart directly.

Использование

add_filter( 'woocommerce_add_order_again_cart_item', 'wp_kama_woocommerce_add_order_again_cart_item_filter', 10, 2 );

/**
 * Function for `woocommerce_add_order_again_cart_item` filter-hook.
 * 
 * @param  $array_merge 
 * @param  $cart_id     
 *
 * @return 
 */
function wp_kama_woocommerce_add_order_again_cart_item_filter( $array_merge, $cart_id ){

	// filter...
	return $array_merge;
}
$array_merge
-
$cart_id
-

Где вызывается хук

WC_Cart_Session::populate_cart_from_order()
woocommerce_add_order_again_cart_item
woocommerce/includes/class-wc-cart-session.php 404-419
$cart[ $cart_id ] = apply_filters(
	'woocommerce_add_order_again_cart_item',
	array_merge(
		$cart_item_data,
		array(
			'key'          => $cart_id,
			'product_id'   => $product_id,
			'variation_id' => $variation_id,
			'variation'    => $variations,
			'quantity'     => $quantity,
			'data'         => $product_data,
			'data_hash'    => wc_get_cart_item_data_hash( $product_data ),
		)
	),
	$cart_id
);

Где используется хук в WooCommerce

Использование не найдено.