Support

Home Forums Event Espresso Premium Show & hide details toggle on ESPRESSO_TICKET_SELECTOR shortcode no longer works

Show & hide details toggle on ESPRESSO_TICKET_SELECTOR shortcode no longer works

Posted: September 12, 2017 at 8:54 am


Tad Heigel

September 12, 2017 at 8:54 am

As stated, the ESPRESSO_TICKET_SELECTOR shortcode’s toggle used to show and hide ticket details no longer works. I thought this was due to customizations I had made to CSS and filters and actions, but even If I completely remove all my CSS and remove all my custom EE filter and actions… the toggle still doesn’t work. Please help. The parent website is http://www.kvausa.com, but I have migrated all code to a staging server for you to dive into if need be at http://kva.staging.wpengine.com. Please let me know if you would like WordPress or SFTP logins.


Josh

  • Support Staff

September 12, 2017 at 9:20 am

Hi there,

I checked the source of the page and I do not see any of Event Espresso’s scripts (JavaScript) getting loaded on that page. If you start with a new page and add a ticket selector shortcode to it does the toggle work there?


Tad Heigel

September 12, 2017 at 10:45 am

I added a new page and added the shortcode to it and it does work. Why would the javascript all of a sudden cease to load on this inner archive page? It’s worked great since June of 2016.

Here is a screenshot of how the shortcode is input into the single-training.php template.


Josh

  • Support Staff

September 12, 2017 at 11:46 am

Oh it’s quite likely because the shortcode is being called directly from a page template. You’ll likely need to add a shortcode to the post content directly or manually enqueue those assets in your template code.


Tad Heigel

September 12, 2017 at 12:00 pm

Ok. I am still not clear on why this stopped working though now? Could you please tell me which specific files and handles I’ll need to enqueue? Preferably you would include the whole function with handle, file path, dependencies etc… that would be very helpful!! I’ll save this into my functions.php file and will write an IF statement that only loads these files on the single-training.php template pages.


Josh

  • Support Staff

September 12, 2017 at 12:49 pm

It was likely a happy accident that it worked before, possibly the page in question at one time had the ticket selector in its saved page content. This is because Event Espresso checks the page’s content (it doesn’t check the PHP code in a page template though) for the shortcode, then loads in the appropriate scripts and stylesheets. This avoids loading the assets on every page request on the front end of the website.

You can simply add the following to your template before the call to
get_header() to force loading in the required assets and EE will take care of registering and enqueueing them:

add_filter( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' );


Tad Heigel

September 12, 2017 at 3:23 pm

Thanks Josh. That did the trick.

The support post ‘Show & hide details toggle on ESPRESSO_TICKET_SELECTOR shortcode no longer works’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso