Posted: March 6, 2014 at 4:03 pm
|
EE4:4.8.1reg How to hide how many tickets were sold in EE4? |
Hi, There is no single way to hide how many tickets are sold without editing the ticket selector templates, but you can set the quantity field to be blank and it will move to unlimited spaces remaining: – http://www.screencast.com/t/VMVvKaX6wRz Does that help? |
|
|
Hi Garth, This is great but not enough. I actually do need to change the ticket selector template. Can you please, help me? My client really doesn’t want to show how many tickets were sold on all of their events. In order not to discourage other people from coming to event if the sold tickets number is low. This should be an option in later releases, I hope. But for now, please tell me which file to edit and how? |
No template file editing is necessary in this case. The content that you don’t want displayed can be hidden with some CSS by adding the following to your custom stylesheet: .tckt-slctr-tkt-details-td span:nth-of-type(4), .tckt-slctr-tkt-details-tbl th, .tckt-slctr-tkt-details-tbl td:nth-child(3), .tckt-slctr-tkt-details-tbl td:nth-child(4), .tckt-slctr-tkt-details-tbl td:nth-child(5), .tckt-slctr-tkt-details-tbl td:nth-child(6) { display: none; } |
|
|
Josh, this is AWESOME! thank you! one correction. How can I use CSS to ONLY show TICKETS LEFT, but not TICKETS SOLD. |
You’ll need to modify the second selector above that has the (th) so that instead of hiding all the table headings it hides only the ones you want hidden. Each table heading can be selected using nth-child or nth-of-type. The same is true for the individual table cells (td) which are already being granularly selected using nth-child in the example code, so you remove the selectors to make the table cells you want displayed. |
|
|
This is very good. Thanks. |
|
This option works well, but it blocks my fee. so the space where you can add an additional fee, I added it, but the amount doesn’t show up now. |
|
Hi, Unfortunately the two sections share the same CSS classes, so hiding one will hide the other. This is not ideal and I have requested additional CSS classes, however I cannot advise when these will be added. In the meantime, there isn’t much that can be done, unless you want to change code in a core file (really not recommended). |
|
Hello Dean, Is it possible, using the CSS code to simply hide the cell? So the headers will be there, the row will also be there, so they won’t completely collapse (which is the other issue, the formatting is compromised) but simply hide cell specific contents? |
|
Also, where is the actual template or code in the core file? I won’t modify it, but it may give me some insight. |
Its actually easier to follow from the front end as there are multiple conditionals within the ticket selector however if you would like to take a look. event-espresso-core-reg/modules/ticket_selector/templates/ You will find the template for the ticket selector there. As mentioned it is not recommended to modify core files such as these. |
|
|
Thanks Tony. What do you mean by it’s easier to follow from the front end? |
Using something like chrome dev tools to inspect the elements will be easier than looking through the code. Still not very straight forward, but neither is the code 😉 So if using chrome, right click on the element of of the ticket selector you are interested in, then click Inspect Element, you can view sepecific elements and work out some CSS to target them http://take.ms/8GdGn |
|
|
Excellent. Thank you for the explanation. |
|
Hello Tony, I just spent about 4 hours try to fix this and I can’t. Would you help me out please? I just want to remove the cells of: Would you point me in the correct direction? I don’t fully understand why the code above couldn’t work: What are the nth-child elements exactly and why do they take out so much and not just those specific cells? .tckt-slctr-tkt-details-td span:nth-of-type(4), |
nth-child selectors select the child elements of a specific value (the value within the brackets) If you would like to learn more about them I would recommend reading here as it explains better than I can: http://css-tricks.com/how-nth-child-works/ The reason for more of the table being removed was due to this selector: .tckt-slctr-tkt-details-tbl th, So to remove just the specific values you specified earlier, you can use something like this: .tckt-slctr-tkt-details-tbl th:nth-child(3), .tckt-slctr-tkt-details-tbl th:nth-child(4), .tckt-slctr-tkt-details-tbl th:nth-child(5), .tckt-slctr-tkt-details-tbl th:nth-child(6), .tckt-slctr-tkt-details-tbl td:nth-child(3), .tckt-slctr-tkt-details-tbl td:nth-child(4), .tckt-slctr-tkt-details-tbl td:nth-child(5), .tckt-slctr-tkt-details-tbl td:nth-child(6) { display: none; } Which leaves only Event Date and Event Time. We have a ticket open to address the complexity of this by adding more classes to the ticket selector which will be included within a future version of Event Espresso (the exact version number I am unsure of of) Does that help? |
|
|
Hello Tony, Thank you very much. This is very useful. I just have one question. How can I implement your CSS code without compromising my price modifier(s)? http://www.gildednights.com/events/gilded-nights-masquerade-winter-wrap-up/ please click on show details and see what happens or how it loos. |
|
Hi, As previously mentioned, the two tables are currently tied using the same CSS, so any CSS changes to one table will affect the other. As such the only two options are: 1) Edit the template files – not recommended, it’s pretty complicated in their. If you do still want to, they are here event-espresso-core-reg/modules/ticket_selector/templates/ 2) Wait until we add in more CSS classes etc, then use CSS. I cannot say when or even if that will occur, but I have made a request for it as it will make life easier for everyone. |
|
Hello Dean, this is really frustrating, but since we are on the topic, rather than making it happen from the CSS. Could it be possible to create a function in the future which would give the option of showing these pieces of information at will? |
Hi there, It’s possible, but the solution will likely be some hooks added or allowing alternate templates to load within the ticket selector. |
|
|
Hello Josh, that works. Riffard |
Hello again, There is now a template option available that can be used to hide the tickets sold details and it is available in a current version of Event Espresso 4. It can be found by logging into your WP dashboard (WP-admin) and going to Event Espresso –> Events –> Templates. Then scroll to the end of the page and look for Ticket Selector Template Settings. Then look for the Show Ticket Sale Info option and set it to no and then click on Save to save changes. Thanks — |
|
The support post ‘EE4 how to hide how many tickets were sold or show unlimited tickets’ 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.