woocommerce_add_to_cart_product_id filter-hookWC 1.0

Usage

add_filter( 'woocommerce_add_to_cart_product_id', 'wp_kama_woocommerce_add_to_cart_product_id_filter' );

/**
 * Function for `woocommerce_add_to_cart_product_id` filter-hook.
 * 
 * @param  $item_product_id 
 *
 * @return 
 */
function wp_kama_woocommerce_add_to_cart_product_id_filter( $item_product_id ){

	// filter...
	return $item_product_id;
}
$item_product_id
-

Where the hook is called

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'] ) );

Where the hook is used in WooCommerce

Usage not found.