• Resolved musicanovaaz

    (@musicanovaaz)


    Entering “$20 General Admission – $15 Seniors/Students” (without quotes) in the event price field used to display the whole string, now only “$20” shows up on the event page. What’s up with that? It worked fine for events in May.

    How do I let the audience know about multiple price points if this feature is no longer available?

    https://wordpress.org/plugins/the-events-calendar/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Here’s how I fixed it! Apparently they’re looking into renovating that area of the plugin next update.

    https://wordpress.org/support/topic/311-no-longer-allows-text-in-the-event-cost-area?replies=1#post-7215217

    Thread Starter musicanovaaz

    (@musicanovaaz)

    Thanks.

    Brook

    (@brook-tribe)

    We would definitely be interested in adding some more customizability to the event prices, but we need a set field which only contains the integer as well or else the database can’t parse the input. And it needs to be able to parse it for feature like the Filter Bar which lets you filter out events based on the selected price range. I doubt you will see that exact field ever accept text again, the fact that it could was a bit of a bug.

    It sounds like you’re not using Filter Bar though. In your case you might be interested in using an Additional Field to specify the cost, and then showing that instead of the cost value in the List template. Then you could just leave the event cost field, which expects an integer, blank. Would that work?

    Cheers!
    – Brook

    Thread Starter musicanovaaz

    (@musicanovaaz)

    I’ll give that a try, though I believe there are many like me who have multiple price points for a given event. (I was just about to try the modification to tribe_get_cost() suggested above but haven’t yet had the time.)

    I suggest you incorporate multiple price points — e.g., price (integer) plus price description (string) — for each event so you can do price range filtering. That may show some price points for an event but not all. In my case, it might show “Students and Seniors” for US$15, but not “General Admission” for US$20.

    no that would be a halfbaked solution because we have events that are free as well AND we’ve substantially edited the templates already to be able to display a ‘doors open’ and ‘start concert’ value WITHOUT having that all cluttered up under ‘Other’ because that’s not where it’s supposed to be.

    Anyway, please change the price field back to a string, as you cannot just go and change a field that accepted a string before into an int field, that’s just a sloppy solution and it leaves me with an angry, PAYING client. We’re talking the Pro version of your plugin here, so please have a fix ready asap.

    Normally i’m all patient and cool with free and open source software, but not now. please fix this, as it’s breaking sites.

    I am not overriding functions as there was an obvious security hole there, please come up with a proper solution.

    I cannot leave my price field empty,
    I cannot have the price field show up under ‘Other’
    I need the price field in my template
    I need it as a string.

    don’t change stuff like this.

    Hi @jmstudio,

    Sorry to hear about your frustration 🙁

    If you -or your client- have a Pro license, please post to our premium forums where we can give you a faster and more detailed reply.

    I think the solution Brook states above is the best way to amend this behavior. Did you give that a try?

    Best,
    Nico

    Hey @musicanovaaz,

    Thanks for your suggestion! Do you mind posting it to our user voice page? There the community share / upvote / comment feature requests.

    Thanks,
    Nico

    Sounds like there are good points on both sides of this, so hopefully things will get worked out eventually. But for the mean-time, I’m not really a big fan of the two fixes suggested above since they involve a lot of overriding of templates and/or core event calendar functions. Luckily there’s a filter available in the tribe_get_cost function, so I elected to use that instead:

    //Display full event cost string if meta field contains non-currency characters
    add_filter('tribe_get_cost', 'my_full_text_cost_fix', 10, 2);
    function my_full_text_cost_fix($cost, $post_id){
    	if(tribe_is_list_view() || tribe_is_month() || tribe_is_week() || tribe_is_day() || is_single()){
    		$strRealCostValue = tribe_get_event_meta( $post_id, '_EventCost', true );
    		//Check if cost meta value is a currency string
    		$blnIsCurrencyString = preg_match('/^[0-9]+(?:\.[0-9]{2}){0,1}$/', $strRealCostValue);
    		//If cost contains non-currency characters, return the full string instead of the formatted value
    		if(!$blnIsCurrencyString){
    			$cost = $strRealCostValue;
    		}
    	}
    	return $cost;
    }

    Adding this code to functions.php will display the full cost string if it’s not formatted as currency (i.e. “10.50”).

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Text string for multiple prices not working’ is closed to new replies.