• Resolved rmsgreig

    (@rmsgreig)


    Hello,
    I am struggling to find the file where I can edit the reservation box, all I would like to do is remove the quotations from the ticket description, is this possible?
    Many Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author loushou

    (@loushou)

    Hey @rmsgreig,

    Unfortunately there is not an easy way to remove those quotes. The quotes are added to the ticket name in the Javascript. That addition takes place in two locations, one for the admin, and one for the frontend. Those locations are as follows, in version 2.8.7:

    admin:
    opentickets-community-edition/assets/js//admin/order/ticket-selection.js line 103

    frontend:
    opentickets-community-edition/assets/js//features/event-area/ui.js line 53

    In the short term, you could edit those two lines, and remove the quotes. That should get you what you need; however, keep in mind that any time the plugin is updated, you will need to manually maintain this change.

    There is one other option, if you have the Javascript chops to pull it off. You could write a small Javascript that looks at that container over and over again until it is filled with something that has quotes around it. Then use the Javascript to remove the quotes. The addition of the quotes only happens once in Community Edition, so it would only need to happen once. It is a hack, but so is the only other available solution currently. The difference is that this one would not require ongoing maintenance.

    I will see if we can add a better method of handling this in a future version, but as of now, these are your only real options.

    loushou

    Plugin Author loushou

    (@loushou)

    Something like this (add it to your theme functions.php file):

    function lou_remove_quotes() {
      ?>  
    <script type="text/javascript">
      ( function() {
        var to;
        to = setInterval( function() {
          // test jQuery first
          if ( 'function' !== typeof jQuery )
            return;
    
          // test for the element
          if ( ! jQuery( '[rel="ttname"]' ).length )
            return;
    
          // if the contents of the element does not have quotes, bail
          var contents = jQuery( '[rel="ttname"]' ).html();
          console.log( 'checking', contents );
          if ( '"' != contents.charAt( 0 ) )
            return;
    
          // otherwise, remove the quotes and stop checking
          contents = contents.replace( /(^"|"$)/g, '' );
          jQuery( '[rel="ttname"]' ).html( contents );
          clearTimeout( to );
        }, 50 );
      } )();
    </script>
      <?php
    }
    add_action( 'wp_head', 'lou_remove_quotes' );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove Quotations from ttname’ is closed to new replies.