Add custom javascript to registration page

  • Mark McCulligh
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 11 months ago #80775 by Mark McCulligh
Add custom javascript to registration page was created by Mark McCulligh
I am wondering what is the best way to add custom javascript to the registration page. I want to add some custom business logic that if the correct information is entered I will apply a discount to the plan. My plan is to use the coupon_code input box for this.

Example: If the state/province select(dropdown) is equal to XX add coupon code XXX to the coupon code field then call the calculateSubscriptionFee method to apply it.

Therefore, just wondering that is the best way to add custom javascript to the registration form. Don't really wan to just modify the paymentmethods.js file as I know this will break future upgrades, etc...

Thanks,
Mark.

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #80805 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Add custom javascript to registration page
Hi Mark

Not sure what's the best way, to be honest. However, I think you can add the code you want to components/com_osmembership/view/register/tmpl/default.php (that's where the subscription form code located)

Using a template override, it will prevent you from having to worry about it while upgrading to future releases of the extension

Regards,

Tuan

Please Log in or Create an account to join the conversation.