woocommerce_coupon_custom_discounts_array filter-hook . WC 1.0
Allow post-processing for custom coupon types (e.g. calculating discrepancy, etc).
Usage
add_filter( 'woocommerce_coupon_custom_discounts_array', 'filter_function_name_5797', 10, 2 ); function filter_function_name_5797( $discounts[ $coupon_code() ], $coupon ){ // filter... return $discounts[ $coupon_code() ]; }
- $discounts[ $coupon_code() ]
- -
- $coupon
- -
Where the hook is called
woocommerce_coupon_custom_discounts_array
woocommerce/includes/class-wc-discounts.php 533
$this->discounts[ $coupon->get_code() ] = apply_filters( 'woocommerce_coupon_custom_discounts_array', $this->discounts[ $coupon->get_code() ], $coupon );