woocommerce_coupon_custom_discounts_array

woocommerce_coupon_custom_discounts_array

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.3.3

apply_filters('woocommerce_coupon_custom_discounts_array') is found 1 times:

  • /includes/class-wc-discounts.php line 548
    			$this->discounts[ $coupon->get_code() ][ $item->key ] += $discount;
    		}
    
    		// Allow post-processing for custom coupon types (e.g. calculating discrepancy, etc).
    		$this->discounts[ $coupon->get_code() ] = apply_filters( 'woocommerce_coupon_custom_discounts_array', $this->discounts[ $coupon->get_code() ], $coupon );
    
    		return array_sum( $this->discounts[ $coupon->get_code() ] );
    	}
    
    	/**
    	 * Deal with remaining fractional discounts by splitting it over items