Multiple Ticket Prices with Recurring Events & 3rd Party Ticketing

Home Forums Calendar Products Events Calendar PRO Multiple Ticket Prices with Recurring Events & 3rd Party Ticketing

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1241747
    Ken
    Participant

    Our client is a performing arts centre. They use Ticketfly a third-party ticketing service. Many of their performances have multiple ticket prices. Also, the majority of their productions require us setting up recurring events.

    I know that I can type in a ticket price range into the Price field, but this breaks both advanced filtering and structured data scheme setup (aka Google Rich Snippet data).

    Based on this, what you recommend for displaying a ticket price range? If needed, we would invest in Tickets Plus, but it doesn’t work with recurring events, and it seems overkill given our client is not the one selling the tickets.

    One solution, I guess, would be to do a CSS display: none; on the price on the individual event page (leaving it visible in loop views). We could then add the lowest price in the admin screen, and add two additional fields for lowest and highest prices. That would provide some filtering and schema integrity. That seems like a fairly kludgey solution for amongst other reasons creating issues about where the price range appears. However, we are trying to avoid messing too much with code (as it keeps things easier for the client post-handoff).

    Any thoughts will be appreciated.

    Cheers, Bill Pitcher (Ken is my partner on this project.)

    #1242496
    Barry
    Member

    Hi Bill,

    Keeping your goal of avoiding the use of custom code in mind, the use of custom fields (as provided by Events Calendar PRO) is probably the best way forward here.

    You could additionally hide the default price field using CSS, as you outlined. Alternatively, you could achieve a compromise by doing something like adding custom fields and using them to replace the regular cost field (in relation to single event views only). This would require a small amount of custom code, but not much, and would leave filtering and rich data uncompromised (albeit, you or your client would need to provide a nominal single value).

    Let me know your thoughts!

    #1242585
    Ken
    Participant

    We are not opposed to code changes if needed. We have already changed the default state for the ‘show first recurring event only’ toggle to on. If we would be making a functions.php change, we can just append the code and maintain our current guidance. So, it’s worthwhile knowing what you would suggest and consider. I expect the client would want us to do it. They have been very particular about how the events appear.

    #1243250
    Barry
    Member

    Hi Ken,

    After giving this some further thought, it seems like the best course of action may be to simply continue using the existing cost field and express ranges by providing two space separated values, for instance (you probably already realize this):

    5.95 29.95

    Will result in something like $5.95 – $29.95 displaying on the frontend. Filtering, via Filter Bar’s cost filter, isn’t something we can address in the short term though we do have a bug report filed that aims to address this issue. That essentially leaves the ‘rich data’ (or JSON-LD) issue you referred to.

    There are a few ways we could deal with this, but I wanted to check in with you: would you prefer to see this be modified to include the lowest value, or to include the highest value, for those events with a cost range?

    Thanks!

    #1243322
    Ken
    Participant

    I think it is pretty safe to assume that most organizations would rather the lower price appear. 😉

    Cheers, (still) Bill.

    #1243705
    Barry
    Member

    Thanks for confirming, Bill.

    In that case the following snippet – which you could add to a custom plugin or even to your theme’s functions.php file if you prefer – may help:

    /**
     * Given an array based JSON-LD representation, modifies any event offer costs so that
     * they are single values rather than ranges.
     * 
     * @param array $data
     *
     * @return mixed
     */
    function modify_json_ld_offer_cost( $data ) {
    	if ( ! is_array( $data ) ) {
    		return $data;
    	}
    
    	foreach ( $data as $event ) {
    		if ( ! is_object( $event ) ) {
    			continue;
    		}
    
    		if ( ! isset( $event->offers ) || ! is_object( $event->offers ) ) {
    			continue;
    		}
    
    		if ( ! isset( $event->offers->price ) ) {
    			continue;
    		}
    
    		$price_components = explode( '-', $event->offers->price );
    
    		if ( ! is_array( $price_components ) || count( $price_components ) !== 2 ) {
    			continue;
    		}
    
    		$event->offers->price = trim( $price_components[ 0 ] );
    	}
    
    	return $data;
    }
    
    add_filter( 'tribe_json_ld_event_data', 'modify_json_ld_offer_cost' );

    If there is a cost range, such as ’10 – 100′ in the JSON LD cost field, it will be modified to reflect the lower value (simply ’10’ in my example).

    I hope that helps!

    #1255173
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Multiple Ticket Prices with Recurring Events & 3rd Party Ticketing’ is closed to new replies.