Multiple Prices

Home Forums Calendar Products Events Calendar PRO Multiple Prices

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1017193
    Linda
    Participant

    Hi,

    I used to be able to add multiple prices to the event cost but since recently upgrading this is no longer possible.

    Previously in the cost field I would write for example:

    £5.00 / £8.00 / £10.00 or Adults £10.00 / Child £5.00

    This would work and show in both the event listing and on the event itself but now if I try this is will only show the first number.

    How do I show multiple prices?

    Thanks in advance for your help.

    #1017329
    George
    Participant

    Hey Linda,

    Our cost field now only accepts numeric values, so your long strings here won’t work with the plugin by default now. Unfortunately, the only way around this is custom code; I wrote up some custom code here for you that should help though, try pasting this in your theme’s functions.php file and then see if things improve!


    add_filter( 'tribe_get_cost', 'cost_show_full_meta_field', 10, 2 );

    function cost_show_full_meta_field( $cost, $post_id ) {
    $full_cost = tribe_get_event_meta( $post_id, '_EventCost', false );

    if ( isset( $full_cost[0] ) ) {
    return sanitize_text_field( $full_cost[0] );
    }

    return $cost;
    }

    Cheers!
    George

    #1022814
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Multiple Prices’ is closed to new replies.