woocommerce_coupon_get_apply_quantity, $item->quantity, $item, $coupon, $this

woocommerce_coupon_get_apply_quantity, $item->quantity, $item, $coupon, $this

Appears in:
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.11.0.0

apply_filters('woocommerce_coupon_get_apply_quantity, $item->quantity, $item, $coupon, $this') is found 1 times:

  • /includes/class-wc-discounts.php line 451
    				$apply_quantity = $limit_usage_qty - $applied_count < $item->quantity ? $limit_usage_qty - $applied_count : $item->quantity;
    				$apply_quantity = max( 0, apply_filters( 'woocommerce_coupon_get_apply_quantity', $apply_quantity, $item, $coupon, $this ) );
    				$discount       = min( $amount, $item->price / $item->quantity ) * $apply_quantity;
    			} else {
    				$apply_quantity = apply_filters( 'woocommerce_coupon_get_apply_quantity', $item->quantity, $item, $coupon, $this );
    				$discount       = $amount * $apply_quantity;
    			}
    
    			if ( is_a( $this->object, 'WC_Cart' ) && has_filter( 'woocommerce_coupon_get_discount_amount' ) ) {
    				// Send through the legacy filter, but not as cents.
    				$discount = wc_add_number_precision( apply_filters( 'woocommerce_coupon_get_discount_amount', wc_remove_number_precision( $discount ), wc_remove_number_precision( $price_to_discount ), $item->object, false, $coupon ) );