Check discount code
-
Hi again,
This topic follow a precedent one:
Discount code for multiprice and multiseat events
Like you told me Franky I check your code
http://www.e-dynamics.be/wordpress/?cat=41 and add a function check_coupon() to my function.php… For sure it’s doesn’t work and I miss something ;-). There is my problem, I don’t understand how your code return an information block the user and avoid him to get on the #eme-rsvp-message
add_filter('eme_eval_booking_filter','check_coupon'); function check_coupon($event) { $event_id=$event['event_id']; // Place here your VOUCHER CODE and PERCENT don't forget to declare in my_eme_discount_function() $vouchers = array( 'montgoger2noel', 'montgoger3easter', ); // Recovery of VOUCHER CODE $coupon = ""; $answers = eme_get_answers($booking_id); foreach ($answers as $answer) { if ($answer['field_name'] == "#_FIELD{1}") { $coupon = $answer['answer']; } } foreach ($vouchers as $voucher) { if ($coupon !='' && $coupon<>$voucher) { // bad form entry return array(0=>1,1=>'Bad coupon code'); } } }Thanks to the community to help me 🙂
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Check discount code’ is closed to new replies.