woocommerce_add_order_again_cart_item
Использование
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
- -
Где вызывается хук
woocommerce_add_order_again_cart_item
woocommerce/includes/class-wc-cart-session.php 489-504
$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 );