Change event prices automatically based on days until event

Home Forums Calendar Products Events Calendar PRO Change event prices automatically based on days until event

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #122487
    realbig
    Participant

    Hey there. I have a site on which all events are similar and follow a predefined pricing model. Basically, for all events there will be a set price and that price will be discounted by a percentage based on how far away the event is in the future.

    Specifically the events will all be $20 off if the event is more than 60 days out, $13 off if it is less than 60 but more than 15 days away, standard price if it is less than two weeks away and 110% on the day of the event. This formula for pricing will be the same for all events.

    Is there a way for me to make this pricing automatic where all we have to do is enter the full price and it will adjust based on the days left until the event? Is there a filter I can use or some function I can replace or something? I’m fairly capable with WordPress and PHP.

    Thanks for any advice.

    #122980
    Barry
    Member

    Hi!

    The tribe_get_cost filter might be useful to you here (it’s called at the end of the tribe_get_cost() function) and callbacks can accept the post ID of the relevant event in addition to the formatted cost string – so you could use this to retrieve the event start date and make an adjustment from there.

    You could even update the cost field in the database at the same time, if you wished to do so.

    Does that help?

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Change event prices automatically based on days until event’ is closed to new replies.