Created
November 24, 2020 13:01
-
-
Save praveencs87/b703bd91e383554905e28b6fad334197 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 | |
// Code Description given in https://webinwordpress.com/uncategorized/how-to-create-and-apply-coupon-code-programmatically-in-woocoomerce/ | |
//use code below to apply the coupon code $coupon_code | |
if (! WC()->cart->add_discount( sanitize_text_field( $coupon_code ))) | |
WC()->show_messages(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment