Home › Forums › Ticket Products › Event Tickets Plus › Force – Out Of Stock
- This topic has 4 replies, 3 voices, and was last updated 10 years, 2 months ago by
Support Droid.
-
AuthorPosts
-
February 19, 2016 at 1:59 am #1077881
Lady Berry
ParticipantHi,
Is it possible to force an event/ticket to appear out of stock. I may need to cancel the event before any tickets are sold but instead of the event disappearing id like them to say “Out Of Stock”
Thanks
BenFebruary 19, 2016 at 8:04 am #1078102Brian
MemberHello,
As for this we do not have any features to do this.
You could cancel the tickets and then just add Out of Stock in the event title or content.
There could be a more customized solution you could code into the template maybe following our themer’s guide:
https://theeventscalendar.com/knowledgebase/themers-guide/
We try to help answer questions to get people started on customizations, but for the most part we are only able to support the features as they are.
Let me know if you have any follow up questions.
Thanks
February 19, 2016 at 3:32 pm #1078592Lady Berry
ParticipantNo worries,
I have coded my own OUT OF STOCK – had just wondered if I was reinventing the wheel 🙂
Do you know which template is used for the list view?
is it:
/wp-content/plugins/the-events-calendar/src/views/list.phpMY CODE:
<?php
/* ALLOW ACCESS TO THE TICKET ON THIS PAGE */
$woo_tickets = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance();
$tickets = $woo_tickets->get_tickets( get_the_ID() );if ( ! empty( $tickets ) ) {
foreach ( $tickets as $ticket ) {
/* SET VALUE OF THE TICKET STOCK MESSAGE */
$thisvalue = tribe_tickets_get_ticket_stock_message($ticket);
/* SET VALUE FOR EVENT URL */
$thisurl = esc_url( tribe_get_event_link() );
/* IF STOCK MESSAGE CONTAINS SOLD ALL 0 (OR FORCED THE STOCK TO 0) */
if (strpos($thisvalue, ‘Sold all 0’) !== false) {
/* SHOW SOLD OUT */
echo ‘<span style=”font-size:1.3em;”>SOLD OUT!</span>’;
}else{
/* SHOW BUY NOW */
echo “BUY NOW!</br> $thisvalue”;
}}
}
?>February 21, 2016 at 1:33 pm #1079473Brian
MemberYes that is the start of the list view template:
/wp-content/plugins/the-events-calendar/src/views/list.php
The rest are in this directory:
plugins/the-events-calendar/src/views/list
March 7, 2016 at 8:35 am #1085858Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Force – Out Of Stock’ is closed to new replies.
