Created
January 11, 2017 10:54
-
-
Save WPprodigy/35d5e570536ead9d9d2caa34ef393d97 to your computer and use it in GitHub Desktop.
Chain a coupon in WooCommerce
This file contains hidden or 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
add_action( 'woocommerce_applied_coupon', 'wc_ninja_chain_a_coupon' ); | |
function wc_ninja_chain_a_coupon( $coupon_code ) { | |
$first_coupon = 'coupon-code-1'; | |
$chained_coupon = 'coupon-code-2'; | |
if ( $first_coupon == $coupon_code ) { | |
WC()->cart->add_discount( $chained_coupon ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment