I was trying to add one more callback function to wordpress ajax action
woocommerce_apply_coupon
this wp_ajax action is defined in woocommerce plugin,I want to add my own callback function on this action from my plugin file .
what i have tried -
add_action( 'wp_ajax_nopriv_woocommerce_apply_coupon','darn',999);
add_action( 'wp_ajax_woocommerce_apply_coupon', 'darn',999);
function darn(){
print_r($_REQUEST);
exit;
}
Doing this in my functions.php is not even showing any error, like i cant see any effect of this code.
want to know if this is even possible to achieve . Thankyou.