Home › Forums › Ticket Products › Event Tickets Plus › Hide number of tickets remaining
- This topic has 18 replies, 4 voices, and was last updated 6 years, 9 months ago by Cath.
-
AuthorPosts
-
June 26, 2017 at 6:09 am #1306045CathParticipant
Hi I had the number of tickets remaining hidden but Since the recent update they are being displayed again. I have searched the forum and found others with the same issue. The advice given was to add
.tribe-tickets-remaining {
display: none !important;
}
as CSS but this is not working. It also does not work to hide the number remaining in the woo commerce settings.I was previously using the code snippet below and this is what stopped working with the recent update. Can you help please? It is essential I have the number of tickets remaining hidden.
/* From https://gist.github.com/cliffordp/94f37421a00db6f7a96368aa23a8d8bb
* For https://theeventscalendar.com/support/forums/topic/number-of-tickets-available/
*
* The Events Calendar + Event Tickets Plus + WooCommerce:
Hide remaining quantity unless it is less than 4 (to create a sense of urgency)
*
* NOTE: Would need .each loop logic to work properly for more than just the first WooCommerce ticket if more than 1 WooCommerce ticket is available per event!
*/
function cliff_etplus_woo_conditional_hide_qty_remaining() {
wp_enqueue_script( ‘jquery’ );
?>
<script type=”text/javascript”>
jQuery(document).ready( function () {
var qty_remaining = jQuery( ‘body.single-tribe_events .woocommerce .tribe-tickets-remaining > span.available-stock’ ).first().text(); // would need to loop instead of use .first() to work for more than 1 WooCommerce ticket per Event
qty_remaining = parseInt( qty_remaining, 10 );
if ( ! isNaN( qty_remaining ) && 2 < qty_remaining ) {
jQuery( ‘body.single-tribe_events .woocommerce .tribe-tickets-remaining’ ).hide();
}
});
</script>
<?php
}
add_action( ‘wp_head’, ‘cliff_etplus_woo_conditional_hide_qty_remaining’ );June 27, 2017 at 2:28 pm #1309714CathParticipantHaving looked at this again I think I do still have the tickets remaining successfully hidden on the event page- but it is now showing on the list view which I need to get rid of.
I need to hide the ‘tickets remaining’ on the list/map views and also hide the ‘Buy now’ button that has appeared recently and the cost display in the list/ map views.
I would be grateful if you can tell me how to hide these new labels – buy now, cost and tickets remaining that have appeared. Thank you
June 28, 2017 at 9:59 am #1310300CliffMemberHi, Cath.
Could you please provide a link to view the List View on your site so I can see what you’re seeing? I am not seeing the remaining quantity on my List View, only the ticket price: https://cl.ly/1z0b0r3g1b3I
June 28, 2017 at 12:57 pm #1310578CathParticipantThis reply is private.
June 28, 2017 at 7:49 pm #1310998CliffMemberThis reply is private.
June 29, 2017 at 1:49 am #1311432CathParticipantHi Cliff,
Thanks- this has not worked for the list of events that appears below the map when the calendar is in map view.
Presumably that would only hide the ‘tickets remaining’? I need the cost hidden also and need to change the text of the Buy now button or it makes a complete nonsense of my site!June 29, 2017 at 12:31 pm #1312484CliffMemberCath, providing site-specific CSS fixes isn’t part of our Scope of Support / Terms, but we do try to help where we can from time-to-time.
In my testing, the CSS I provided worked fine, but if it doesn’t for you then you’ll need to figure it out or ask a developer.
Or maybe you’ll need to clear your site’s cache to get the rules you added to go into effect.
June 29, 2017 at 2:52 pm #1312798CathParticipantHi Cliff
It works for the list view but not in the list of events that appears below the map in map view.
Yes- I have cleared the cache.
In Woo commerce I also have it set to never show inventory remaining but that seems to be overridden.PS The ‘Buy now’ and tickets remaining are something that have appeared recently. I think a lot of people will have difficulty with this as the scope of The Events Calendar is much broader than just selling ‘tickets’ – it seems to be really limiting. Will there be any future plans to give control over these in settings to switch on/off? It is a little frustrating to have an unwanted new ‘feature ‘ forced upon us which we seemingly can’t get rid of.
June 29, 2017 at 7:25 pm #1313240CliffMemberCath, thanks for bringing my attention to this setting in WooCommerce.
I’ve filed a feature request for all of Event Tickets Plus’ front-end displays (e.g. Buy Now Button and Event Single views) to respect this WooCommerce setting for WooCommerce-type tickets.
I can’t guarantee if or when it’ll be implemented, but I imagine others would like this feature too.
Thanks for suggesting it!
June 30, 2017 at 1:06 am #1313778paulcrawfordParticipantHi Cath
I had the same issue and this worked for me…
See https://theeventscalendar.com/support/forums/topic/hide-number-of-tickets-available-3/#post-1312032June 30, 2017 at 2:28 pm #1314758CathParticipantHi Paul, Thank you so much for your reply. I was using the same php that has stopped working with the latest update. Your fix works for me in list view but not in the map view. Have you successfully hidden the tickets remaining in the map view? And did you also remove the old fix? I am not sure whether I am doing something wrong – or whether it is because the problem page is set as the store page – or whatever. It is driving me mental…… and making me so cross – I cannot see why any event organiser would want these stupid new features.
June 30, 2017 at 2:37 pm #1314762CathParticipantThanks Cliff. I still do not have this sorted. The other suggestions hide the tickets remaining except for the map view. I have a lot of events spread all over the UK and really need the map view so that customers can find their nearest event. What can I do?
Also is there a simple way to change the text of the ‘buy now’ button?June 30, 2017 at 9:19 pm #1314860CliffMemberThanks for that help, Paul.
Cath, if you switch to a WordPress default theme like Twenty Fifteen, Twenty Sixteen, Twenty Seventeen, etc., does the PHP or CSS affect both List and Map views?
July 1, 2017 at 2:12 am #1314887paulcrawfordParticipantHi Cath
I use the CSS to hide the elements I didn’t want.
Agree, it seems strange that the option to show or hide those elements are not in the settings.
I don’t use the map view so can’t help you there I am afraid…July 1, 2017 at 4:37 pm #1315094CliffMemberThanks for letting us know, Paul.
You could request this as a new feature (or maybe search to see if the idea was already posted by someone else) at our plugins’ UserVoice page.
This allows others who are interested in that feature to easily voice their support. We frequently review suggestions there to find out which ones are popular, then we implement as many of them as we can.
If you post it / find it, feel free to link to it from here in case anyone comes across this forum thread in the future.
-
AuthorPosts
- The topic ‘Hide number of tickets remaining’ is closed to new replies.