Posted: March 23, 2016 at 4:04 pm
|
I wanted to add a price column to my table – which I was able to do when I added it to espresso-events-table-template.template.php. However, I noticed that the ones with Sold Out on the actual page went from saying “$2,250” to “FREE”. How do I hide the sold out events from my table? Or, can I keep the sold out classes that I have from changing to free? |
Hi Dianna, Did you follow a tutorial to add the price column to the table? If so can you post the link to tutorial used please? If you copy the contents of your espresso-events-table-template.template.php, add it to http://pastebin.com/ and post the url for that paste here we can take a look. I don’t know how you are pulling in the price for the event currently so I’m not sure how to fix it 🙂 |
|
|
This is the tutorial I followed: I added everything step by step in my template file. However, I had to do what ErinK (mentioned in the comments) as I didn’t see the code listed in step 8. Here is what I have: http://pastebin.com/jttzXrTW |
Hi Dianna, So the problem with that template is that it is using a function to call the ‘available’ tickets but doesn’t take into consideration sold out events (the function then return no tickets which in that example is the same as free events) A quick fix for the time being is to swap out line 129 from this:
To this:
Which just checks if the event is sold out and echo’s ‘N/A’ if so, if not use the same as it does now. (You can change ‘N/A’ if you prefer) |
|
|
Thanks so much! Everything looks good. |
Hi Dianna, I just wanted to let you know I provided Lorenzo with some code to fix this, it’s a little different from the above but the end result is the same. He’s now updated the gist to include that code if you would like to update to that version (its not essential but just keeps you up to date with the latest template): |
|
The support post ‘Hide Sold Out Events from Table’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.