Created
March 4, 2020 13:13
-
-
Save iamsathyaseelan/208037c6d64018656baca30077432d6b to your computer and use it in GitHub Desktop.
allowing the next order coupons for particular order emails only
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_filter('rnoc_before_displaying_next_order_coupon','rnoc_before_displaying_next_order_coupon',10,2); | |
function rnoc_before_displaying_next_order_coupon($message,$order){ | |
if (method_exists($order, 'get_status')) { | |
$order_status = $order->get_status(); | |
$order_status = strtolower($order_status); | |
if($order_status == "processing"){ | |
return $message; | |
}else{ | |
return ''; | |
} | |
} | |
return $message; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment