Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamsathyaseelan/208037c6d64018656baca30077432d6b to your computer and use it in GitHub Desktop.
Save iamsathyaseelan/208037c6d64018656baca30077432d6b to your computer and use it in GitHub Desktop.
allowing the next order coupons for particular order emails only
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