Hi,
I am making a custom ticket template and what I want to do is hide certain variables if they are empty. for example I want to hide the “More Information:” Tag from the venue information if the field is empty. I have been trying to work this out. is it possible?
I have tried to use the standard PHP code in the “index.php” file if ($venue_description2 != "")echo"<p>More Information: </p>
<p>[venue_description]</p>"; ?>
I have added $venue_description2 = do_shortcode('[venue_description]'); at the beginning of the file.
This topic was modified 10 years, 11 months ago by Guy Jackson.
The ticket shortcodes (and email shortcodes) are not regular WP shortcodes. We do a search and replace for them after the template is loaded. What I would do is change the template to look like this:
[venue_phone]</p>
[venue_description]</p>
and then in plugins/espresso-ticketing/functions.php, line 368, change it to be:
Thanks for your fast reply, It works perfectly. I have another related question. It probably sounds stupid but its probably because it is past midnight here. How would I implement this to do the same thing with the “Ticket Instructions:” or “Ticket Type:”
Thanks again.
That should do it, but Ticket Type will always be set (or should be!) so I think this change is moot.
Viewing 3 reply threads
The support post ‘Custom Ticket Hiding Variables if empty’ 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.