Woo tickets

Home Forums Ticket Products Event Tickets Plus Woo tickets

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1104261
    Chris
    Participant

    Hi
    I’m using the events plugin with great success – I have a question about ticket descriptions

    I’ve copied tickets.php to my theme so I can edit it….

    I want to add a default description to each ticket as follows

    1. if someone types a description when adding a ticket, show that
    2. if they leave it blank then show a default message

    ie replace this:
    echo ‘<td class=”tickets_description”>’;
    echo $ticket->description;
    echo ‘</td>’;

    with something like this (in English):

    echo ‘<td class=”tickets_description”>’;
    if DESCRIPTION IS NOT EMPTY {echo $ticket->description}
    else if it is empty then {echo ‘some text’}
    echo ‘</td>’;

    I tried this:
    echo ‘<td class=”tickets_description”>’;
    if (!empty (post_excerpt) {echo $ticket->description;}
    else {echo ‘hello’}
    echo ‘</td>’;

    but the only effect it had was to make each single event page blank (So I changed it back :))

    Is this something anyone can help with at all?

    Ta
    Chris

    #1104543
    Cliff
    Member

    Hi Chris. Thanks for your detailed question.

    Instead of adding post_excerpt in there, you should be able to do this:

    if ( ! empty ( $ticket->description ) ) { echo $ticket->description; }

    Let me know how it goes!

    #1105050
    Chris
    Participant

    Cliff – you’re a legend!

    Worked first time 🙂 🙂

    Cheers dude
    Chris

    #1105073
    Cliff
    Member

    Thanks. I’m feeling like one now! 😉

    Glad to help!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Woo tickets’ is closed to new replies.