Merge pull request #6386 from justinstern/master

Adds a woocommerce_add_to_cart_sold_individually_quantity filter
This commit is contained in:
Mike Jolley 2014-10-02 14:05:41 +01:00
commit 0512a114ec
1 changed files with 3 additions and 2 deletions

View File

@ -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() ) {