Merge pull request #6386 from justinstern/master
Adds a woocommerce_add_to_cart_sold_individually_quantity filter
This commit is contained in:
commit
0512a114ec
|
@ -817,8 +817,9 @@ class WC_Cart {
|
|||
return false;
|
||||
|
||||
// Force quantity to 1 if sold individually
|
||||
if ( $product_data->is_sold_individually() )
|
||||
$quantity = 1;
|
||||
if ( $product_data->is_sold_individually() ) {
|
||||
$quantity = apply_filters( 'woocommerce_add_to_cart_sold_individually_quantity', 1, $quantity, $product_id, $variation_id, $cart_item_data );
|
||||
}
|
||||
|
||||
// Check product is_purchasable
|
||||
if ( ! $product_data->is_purchasable() ) {
|
||||
|
|
Loading…
Reference in New Issue