From 718c2a93e2139e95c0968d04dc727bf2f3a8f2e6 Mon Sep 17 00:00:00 2001 From: Sunil Pawar Date: Thu, 23 Dec 2021 14:04:48 +0530 Subject: [PATCH] Fix JS Error for Free event with multiple participant on registration screen added comment and same check on waiting list --- .../CRM/Event/Form/Registration/Register.tpl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/templates/CRM/Event/Form/Registration/Register.tpl b/templates/CRM/Event/Form/Registration/Register.tpl index 512e94cbd2..7e69599a06 100644 --- a/templates/CRM/Event/Form/Registration/Register.tpl +++ b/templates/CRM/Event/Form/Registration/Register.tpl @@ -159,7 +159,13 @@ {literal} cj("#additional_participants").change(function () { - skipPaymentMethod(); + if (typeof skipPaymentMethod == 'function') { + // For free event there is no involvement of payment processor, hence + // this function is not available. if above condition not present + // then you will receive JS Error in case you change multiple + // registrant option. + skipPaymentMethod(); + } }); {/literal} @@ -225,7 +231,13 @@ cj("#bypass_payment").val(0); } //reset value since user don't want or not eligible for waitlist - skipPaymentMethod(); + if (typeof skipPaymentMethod == 'function') { + // For free event there is no involvement of payment processor, hence + // this function is not available. if above condition not present + // then you will receive JS Error in case register multiple participants + // enabled and require approval. + skipPaymentMethod(); + } } } -- 2.25.1