woocommerce_add_to_cart_validation

apply_filters( ‘woocommerce_add_to_cart_validation’, $bool, $product_id, $quantity, $variation_id, $variation, $cart_item_data );

WC built-in filter to add cart of variation product.

Parameters #

$bool
Returns default true
$product_id
(int) Get the product ID
$quantity
(int) Get cart quantity
$variation_id
(int) Get the variation ID
$variation
Get the variation
$cart_item_data
Get cart items data

Return #

(boolean) Returns default true.

File Location #

inludes/ajax_add_to_cart.php

Source Code #

View on Github.com