Variable Prices

Home Forums Calendar Products Events Calendar PRO Variable Prices

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #996891
    Charmaine Taylor
    Participant

    Hi,

    Some of my classes have variable prices (e.g. $15 drop-in rate, $99 for unlimited classes, $52 for 4 classes). Currently, only the first price entered in the Event Cost field is displaying, do you know how to change that?

    Thanks,
    Charmaine

    #996894
    George
    Participant

    Hey Charmaine,

    Thanks for reaching out! I’m curious, can you clarify exactly what you mean when you write this:

    Currently, only the first price entered in the Event Cost field is displaying,

    How specifically have you entered your Event Costs to that field? If you can take a screenshot, or copy and paste an example of what you have entered, that would be helpful here.

    The Event Cost field should generally be able to support something like, for example, “$99–150”, though depending on what you’ve added there may be text or other characters getting stripped away by filters, which would require a bit of custom code to disable. We can help with that if need be, but first, let us know precisely how you’re entering your multiple event costs and we can go from there.

    Thank you!
    George

    #996902
    Charmaine Taylor
    Participant

    Hi George,

    I’ve added two links: 1) the area where the information is entered into the control panel and 2) the class description and fee displayed online. Unfortunately, you cannot see the entire price entered as the field is too small.

    Class Description with Price Displayed

    Control Panel - Event Cost Section

    The price entered is: $15 drop-in; $99 for monthly unlimited classes; $52 for 4 classes; $99 for 8 classes; $135 for 11 classes; $240 for $22 classes; $320 for 33 classes

    another class price is:

    $2800; $500 for deposit

    My other site use to display the full price also but now it isn’t anymore. I think the display changed after an automatic update.

    Thanks,
    Charmaine

    #996978
    George
    Participant

    Thanks for sharing, Charmaine!

    Your Cost field values are indeed too long and have too much text in them for our current filters, which try to strip things down to just numeric values. Apologies for the inconvenience from this! This feature change works great for most people and has many uses, but for some users it is a bit of a pain – you are not the first one, so fortunately, I have a code snippet that I’ve written that you can copy and paste right into your theme’s functions.php file to keep those Cost values un-touched:


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

    function tribe_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;
    }

    Let me know if that helps! 🙂

    George

    #1001223
    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 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Variable Prices’ is closed to new replies.