All events shown as free

Home Forums Ticket Products Event Tickets Plus All events shown as free

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1219708
    Damien
    Participant

    Hello
    We are using Events Tickets Plus without an e-commerce platform such as Woocommerce. We don’t need to take payment for the events but needed the extra control of using Event Tickets Plus.

    The problem is that once the tickets addon is installed it hides the cost field for all events so they all show up as Free events.
    We nearly got around this by adding the following code to our functions file:

    add_filter( 'tribe_events_admin_show_cost_field', '__return_true', 100 );

    This now allows us to add the cost of the event. However on the front end of the site the events still show as free but now have the cost next the Free statement. eg. ‘Free – £25’.

    I can’t see how to get rid of the Free from here when a price has been added.

    Any ideas? It seems the tickets plus only works if you want to accept payment online.

    Many thanks
    D

    #1219874
    Geoff B.
    Member

    Good evening Damien and welcome back!

    Thank you for reaching out to us.
    I would love to help you with this topic.

    To get the cost field back, we actually have an extension: https://theeventscalendar.com/extensions/display-the-event-cost-field-when-ticket-plugins-are-installed/

    As for the Free mention, this usually stems from using RSVP tickets.
    You can remove the “free” mention by adding the following snippet to your theme’s functions.php file: https://gist.github.com/GeoffEW/b440feef873af841d023c0bf0839e93f

    Let me know how that goes.

    Best regards,
    Geoff B.

    #1220146
    Damien
    Participant

    Thanks for the response Geoff.
    I had already tried that snippet, which I found in the forums somewhere.

    Unfortunately that seems to remove the whole cost field from the front end altogether. It removes the ‘Free’ but also removes any mention of the cost.

    What we would like is for it to show ‘Free’ when it is a free event but also show the cost when it is not free. Currently if there is a cost for the event it shows up as ‘Free – £84’! So it shows the cost but it still says Free next to it.

    You can see what I mean here.

    Is this possible?

    Thanks

    D

    #1220789
    Geoff B.
    Member

    Good evening Damien,

    I am pretty sure you can achieve what you are looking for with my colleague Andras’ snippet: https://theeventscalendar.com/support/forums/topic/show-a-price-in-rsvp-mode/#post-1174666

    Let me know if that helps.

    Have a great day!

    Geoff B.

    #1220828
    Damien
    Participant

    Thanks Geoff
    The snippet looks like it should work but unfortunately it just seems to remove the entire cost field from the front end as per the previous snippet.
    Any ideas why?

    Thanks

    D

    #1221381
    Geoff B.
    Member

    Good evening Damien,

    I am sorry this did not work as intended!

    I am just noticing that your Event Tickets Plus does not seem to be up to date.
    Not that this is necessarily related, but it’s better to have matching version of Event Tickets and Event Tickets Plus.

    Secondly, could you send me screenshots of the Edit Event and Edit Ticket(s) screens for a sample event on your website.

    Finally, could you please send me a copy of the latest version of your WordPress theme / child theme via a link to a .zip file link (stored Dropbox or Google Drive) so that I can run some tests on my end ? I recommend a private reply for that purpose.

    Please ensure you are using the latest files as found on your actual website.
    This way I will get access to any updates or customizations you might have made.

    Hang in there as we investigate this together.

    Best regards,

    Geoff B.

    #1222861
    Damien
    Participant

    Hi Geoff
    I’ve finally got this figured out!
    Firstly because this is on a multisite using a child theme. I had to place the snippet in the functions file in the child theme, rather than the main theme functions. I don’t know why this should matter.
    Secondly I managed to get it to keep the ‘Free’ block by amending the snippet slightly to this:

    <?php
    /*
     * The Events Calendar - Remove 'Free - ' from price
     * Add to your child theme's functions.php file
    */
    
    add_filter ( 'tribe_get_cost', 'tribe_not_show_free', 10, 3 );
    
    function tribe_not_show_free ( $cost, $post_id, $with_currency_symbol ) {
    	
    	if ( $cost != 0 || $cost != 'Free' ) {
    		$cost = str_replace('Free', '', $cost);
    		$cost = str_replace(' - ', '', $cost);
    	}
    	return $cost;
    }
    
    ?>

    Hopefully this is of use to someone else out there trying to achieve the same thing.

    Thanks for all your help.

    D

    #1223194
    Geoff B.
    Member

    Good evening Damien,

    Well done!

    And most of all, thank you for sharing this solution for all to use.

    You are right, whenever you can, using the child theme’s functions.php is the way to go.

    You are welcome back in our support forums any time 🙂

    For now, I am going to close this thread.

    Have a great week!

    Geoff B.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘All events shown as free’ is closed to new replies.