Display Stock on List View

Home Forums Calendar Products Events Calendar PRO Display Stock on List View

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1194993
    Serafina
    Participant

    Hello together,

    I installed the following code to display available or sold out in List View. Its works!
    But it is very importend to display the stock.

    example: 4 available now its only Display: available

    <!– sold out –>
    <?php if ( tribe_events_has_soldout() ): ?>
    <span class=”tickets-sold-out”>
    – sold out –
    </span>
    <?php elseif ( tribe_events_has_tickets() ): ?>
    <span class=”tickets-in-stock”>
    – available –
    </span>
    <?php endif ?>
    <!– sold out end –>

    special thanks for Help

    Adams

    #1195731
    Andras
    Keymaster

    Grüss dich Serafina / Adams

    Thanks for reaching out with your question! You have a stunning looking website! Congratulations!

    Try using this function:

    tribe_events_count_available_tickets()

    This should get you the number of tickets.

    Let me know how this works out.

    Cheers,
    Andras

    #1195995
    Serafina
    Participant

    Hello András,

    thank you for reply 😉 Please can you help me to put the code in the right place?
    Im a absolut NEWBY in PHP ;(

    Here is my Code:
    <!– sold out –>
    <?php if ( tribe_events_has_soldout() ): ?>
    <span class=”tickets-sold-out”>- Ausgebucht -</span>
    <?php elseif ( tribe_events_has_tickets() ): ?>
    <span class=”tickets-in-stock”>- Plätze verfügbar -</span> <?php endif ?>
    <!– sold out end –>

    Special thanks

    Serafina

    #1196009
    Serafina
    Participant

    i try this, but is not Working:

    <!– Ausverkauft –>
    <?php if ( tribe_events_has_soldout() ): ?>
    <span class=”tickets-sold-out”>- Ausgebucht -</span>
    <?php elseif ( tribe_events_has_tickets() ): ?>
    <span class=”tickets-in-stock”>- <?php tribe_events_count_available_tickets() ?> Plätze verfügbar -</span>
    <?php endif ?>
    <!– Ausverkauft Ende –>

    #1196015
    Serafina
    Participant

    oh i forgot the echo ;),

    <!– Ausverkauft –>
    <?php if ( tribe_events_has_soldout() ): ?>
    <span class=”tickets-sold-out”>- Ausgebucht -</span>
    <?php elseif ( tribe_events_has_tickets() ): ?>
    <span class=”tickets-in-stock”>- <?php echo tribe_events_count_available_tickets() ?> Plätze verfügbar -</span>
    <?php endif ?>
    <!– Ausverkauft Ende –>

    it WORKS perfekt thank you for Help 😉

    • This reply was modified 9 years, 5 months ago by Serafina.
    #1196426
    Andras
    Keymaster

    Hi Serafine,

    Super cool, I’m glad it helped and congrats on figuring that out! Good job!

    I am going to go ahead and close this ticket, but if you need help on this or something else, don’t hesitate to open a new topic.

    Good luck with your project!

    Cheers,
    Andras

    PS: If you like our plugin, and you didn’t yet do so 🙂 we would be happy to receive a review in the wordpress.org repository. Thanks!
    https://wordpress.org/support/view/plugin-reviews/the-events-calendar

    PS2: We’d be also grateful if you would give us feedback on your satisfaction with support. Just click on one of the classy looking emojis below. 🙂 If you can spare a few words, that’s even better. Doublethanks!

     

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Display Stock on List View’ is closed to new replies.