Hide event cost if not set in photo view

Home Forums Calendar Products Events Calendar PRO Hide event cost if not set in photo view

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1151271
    jazzinconcert
    Participant

    Hi there,

    i customized the photo view like this to show the event cost in meta:

    <p><b>Eintritt :</b> <?php echo tribe_get_cost(); ?></p>

    I would like to show the event cost only when there is a value/price set in the submission form/wp backend like i have done with an additional field e.g:

    <p> <?php if ($additional_fields ['Kommentar']) echo "<b>Ludwigs Kommentar : </b> ". $additional_fields ['Kommentar'] ?></p>

    Please can you tell me the way to do this ?

    Thanks
    Thomas

    #1151810
    Josh
    Participant

    Hey Thomas,

    Thanks for reaching out to us!

    You can wrap the display of the “tribe_get_cost()” with a conditional there. Something like:

    
    if( tribe_get_cost() ) {
    
    tribe_get_cost();
    
    }
    

    Let me know if this helps.

    Thanks!

    #1151811
    jazzinconcert
    Participant

    Hi Josh,

    thanks for the snippet ! I’ll check it out 🙂

    #1152027
    Josh
    Participant

    Hey,

    No problem. Let me know if it helps.

    Thanks!

    #1161010
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Hide event cost if not set in photo view’ is closed to new replies.