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

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

add_filter( 'woocommerce_add_to_cart_product_id', 'wp_kama_woocommerce_add_to_cart_product_id_filter' );
function wp_kama_woocommerce_add_to_cart_product_id_filter( $item_product_id ){
	// filter...

	return $item_product_id;
}
$item_product_id
-

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

WC_Cart_Session::populate_cart_from_order()
woocommerce_add_to_cart_product_id
WC_Form_Handler::add_to_cart_action()
woocommerce_add_to_cart_product_id
WC_AJAX::add_to_cart()
woocommerce_add_to_cart_product_id
woocommerce/includes/class-wc-cart-session.php 354
$product_id     = (int) apply_filters( 'woocommerce_add_to_cart_product_id', $item->get_product_id() );
woocommerce/includes/class-wc-form-handler.php 779
$product_id        = apply_filters( 'woocommerce_add_to_cart_product_id', absint( wp_unslash( $_REQUEST['add-to-cart'] ) ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
woocommerce/includes/class-wc-ajax.php 403
$product_id        = apply_filters( 'woocommerce_add_to_cart_product_id', absint( $_POST['product_id'] ) );

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

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