Okay
  Public Ticket #2731359
JS Hooks for events
Closed

Comments

  • vishal started the conversation

    Hi,


    I am trying to use JS hooks to change the text of FREE when the event has Zero price.  I am trying to use the below code but nothing seems to happen:

    jQuery(document).ready(function($) {
        window.beforeConfirmedBooking = function () {    
           $('.am-event-free').text(function(i, oldText) {
              return oldText === 'Free' ? 'Donation' : oldText;
          });
        } });

    Is this the correct hook to run after the event list has been loaded?

  • [deleted] replied

    Hi, Vishal!

    I apologize for the delayed response.

    It seems Events don't have that JS hook.

    You can modify this word in the .po file through Loco Translate or Poedit plugin, or use this CSS on the page with Amelia:

    <style>.am-event-free {  visibility: hidden;  position: relative;}.am-event-free:after {    visibility: visible;    top: 0;    left: 0;    content: "Donation";}</style>


    Please let us know if it worked.

    Best Regards.