woocommerce_store_api_validate_cart_item хук-событиеWC 1.0

Fire action to validate add to cart. Functions hooking into this should throw an \Exception to prevent add to cart from occurring.


add_action( 'woocommerce_store_api_validate_cart_item', 'wp_kama_woocommerce_store_api_validate_cart_item_action', 10, 2 );

 * Function for `woocommerce_store_api_validate_cart_item` action-hook.
 * @param \WC_Product $product   Product object being added to the cart.
 * @param array       $cart_item Cart item array.
 * @return void
function wp_kama_woocommerce_store_api_validate_cart_item_action( $product, $cart_item ){

	// action...
Product object being added to the cart.
Cart item array.

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

woocommerce/packages/woocommerce-blocks/src/StoreApi/Utilities/CartController.php 633
do_action( 'woocommerce_store_api_validate_cart_item', $product, $cart_item );

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

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