WordPress at Your Fingertips
filter is not described

woocommerce_add_to_cart_sold_individually_quantity filter-hook . WC 1.0

Force quantity to 1 if sold individually and check for existing item in cart.

Usage

add_filter( 'woocommerce_add_to_cart_sold_individually_quantity', 'filter_function_name_3222', 10, 5 );
function filter_function_name_3222( $1, $quantity, $product_id, $variation_id, $cart_item_data ){
	// filter...

	return $1;
}
$1
-
$quantity
-
$product_id
-
$variation_id
-
$cart_item_data
-

Where the hook is called

WC_Cart::add_to_cart()
woocommerce_add_to_cart_sold_individually_quantity
CartController::filter_request_data()
woocommerce_add_to_cart_sold_individually_quantity
woocommerce/includes/class-wc-cart.php 1148
$quantity      = apply_filters( 'woocommerce_add_to_cart_sold_individually_quantity', 1, $quantity, $product_id, $variation_id, $cart_item_data );
woocommerce/packages/woocommerce-blocks/src/StoreApi/Utilities/CartController.php 992
$request['quantity'] = apply_filters( 'woocommerce_add_to_cart_sold_individually_quantity', 1, $request['quantity'], $product_id, $variation_id, $request['cart_item_data'] );

Where in WP core the hook is used WooCommerce

Usage not found.