Created
February 20, 2020 13:05
-
-
Save dokker/228cdff81c9eae53348986c9dc06ece9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function couponDiscount($cart) | |
{ | |
$discount = 100; //test value | |
if ($discount > 0) { | |
// TODO: fix tax exclusion | |
$cart->add_fee(__("Custom discount"), -$discount); | |
} | |
} | |
add_action('woocommerce_cart_calculate_fees', [$this, 'couponDiscount'], 10, 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment