Home › Forums › Ticket Products › Event Tickets Plus › Sold out or available tickets in eventlist
- This topic has 15 replies, 2 voices, and was last updated 12 years, 10 months ago by
Barry.
-
AuthorPosts
-
June 20, 2013 at 9:49 pm #51824
mamalm
ParticipantLooking to put sold out in the event list and calendar, not just in the single event page
I use wootickets for event sales and event cal pro
June 21, 2013 at 6:47 am #51843Barry
MemberHi Mamalm,
You would need to do a little customization here, so if you haven’t already done so please read up on our Themer’s Guide and this tutorial on safely overriding templates as they will give you the background knowledge you need to do this.
You then need a means of accessing ticket information from those new locations. This function returns an array of ticket objects for the current post (or you can specify a specific post ID for the relevant event).
You could then iterate through that array – here is an example that retrieves and displays the price to give you an example of the basic process – except you would be interested here in information about stock levels so you would probably prefer to use $ticket->get_stock_quantity() (as opposed to $ticket->get_price_html() ).
Whether you want to expose the actual stock level or display an out-of-stock message (and or a combination of those, if for instance you have multiple tickets per event) is something I’ll leave to you 🙂
June 21, 2013 at 6:48 am #51844Barry
Member(To clarify, that first function I referenced should go in your theme’s functions.php file or another suitable location.)
June 21, 2013 at 2:41 pm #51919mamalm
ParticipantPlease dumb this down a bit Barry, and yes I have read
Themer’s Guide and this tutorial on safely overriding templates
many times and I really dont follow you at all….
This is NOT a function of your events calendar pro?
When purchasing both event calendar Pro and wootickets last week I assumed this would be a easy taskJune 21, 2013 at 3:30 pm #51937Barry
MemberSorry Mamalm, but no this is not a function of Events Calendar PRO. To do what you want to do requires an amount of customization work.
Let’s take it one step at a time though – have you added this function to your theme’s functions.php file?
June 21, 2013 at 3:41 pm #51943mamalm
Participantabsolutly, the functions php has been added
June 21, 2013 at 4:09 pm #51954Barry
MemberGreat! Please also add this function in the same place.
Next, we need to override the list view template (as per the instructions in the themer’s guide) – so you should have a copy in the following location:
wp-content/themes/{YOUR_THEME}/events/list.php
June 21, 2013 at 4:21 pm #51956mamalm
ParticipantI’m with you
June 21, 2013 at 4:24 pm #51958mamalm
ParticipantThis was the part that I didnt follow you
June 23, 2013 at 7:19 am #51999Barry
MemberSo you’re having trouble with the template override process?
You should first go to your theme’s directory and create a new sub-directory called events – then please copy the following file:
wp-content/plugins/the-events-calendar/views/list.php
And place a copy of that file in your new events sub-directory. Does that make more sense?
June 23, 2013 at 9:36 am #52003mamalm
ParticipantTemplate override I have no problem with just the next part of you directions……. Listing sold out on the event cal list an event cal….
June 23, 2013 at 3:11 pm #52013Barry
MemberOK, so now you need to use those newly added functions from within your list.php template – here’s an example of one way in which you could do this, based on the default list.php template.
The relevant piece of code can be found on lines 41-55 – you may need to tweak this slightly so that the wording fits your particular style and business model, or to add any other embellishments that you might need 🙂
In principle the same chunk of code (lines 41-55) can be added to other templates, such as table.php with no or some very minor changes.
Does that help?
June 24, 2013 at 4:09 pm #52125mamalm
ParticipantThis reply is private.
June 25, 2013 at 5:45 am #52146Barry
MemberHi Mamalm,
Remember that we edited the list.php template – not gridview.php or table.php – so your month view would be unaffected by that change.
I can’t actually see the problem in any case, so perhaps you’ve resolved it already?
June 25, 2013 at 9:50 am #52173mamalm
ParticipantHey Barry, I made the changes to the cal, but a bug shows up when viewing the link I gave you with the firefox browser on a mac only, strange bug in the event cal….
-
AuthorPosts
- The topic ‘Sold out or available tickets in eventlist’ is closed to new replies.
