Home › Forums › Calendar Products › Events Calendar PRO › Display Stock on List View
- This topic has 6 replies, 3 voices, and was last updated 9 years, 5 months ago by
Andras.
-
AuthorPosts
-
November 19, 2016 at 3:03 pm #1194993
Serafina
ParticipantHello 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
November 22, 2016 at 5:36 am #1195731Andras
KeymasterGrü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,
AndrasNovember 22, 2016 at 9:49 am #1195995Serafina
ParticipantHello 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
November 22, 2016 at 10:01 am #1196009Serafina
Participanti 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 –>November 22, 2016 at 10:04 am #1196015Serafina
Participantoh 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.
November 23, 2016 at 5:17 am #1196426Andras
KeymasterHi 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,
AndrasPS: 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-calendarPS2: 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!
-
This reply was modified 9 years, 5 months ago by
-
AuthorPosts
- The topic ‘Display Stock on List View’ is closed to new replies.
