woocommerce_ajax_add_order_item_validation
Использование
add_filter( 'woocommerce_ajax_add_order_item_validation', 'wp_kama_woocommerce_ajax_add_order_item_validation_filter', 10, 4 ); /** * Function for `woocommerce_ajax_add_order_item_validation` filter-hook. * * @param $validation_error * @param $product * @param $order * @param $qty * * @return */ function wp_kama_woocommerce_ajax_add_order_item_validation_filter( $validation_error, $product, $order, $qty ){ // filter... return $validation_error; }
- $validation_error
- -
- $product
- -
- $order
- -
- $qty
- -
Где вызывается хук
woocommerce_ajax_add_order_item_validation
woocommerce/includes/class-wc-ajax.php 1066
$validation_error = apply_filters( 'woocommerce_ajax_add_order_item_validation', $validation_error, $product, $order, $qty );