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.8.1

apply_filters('woocommerce_coupon_custom_discounts_array') is found 1 times:

  • /includes/class-wc-discounts.php line 549
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
            $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