Show Cost As A Donation

Home Forums Calendar Products Events Calendar PRO Show Cost As A Donation

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1002371
    Graham
    Participant

    Hi. I’m fairly new to Events Pro and not an expert at using it. I’ve looked for the answer to this but haven’t found it. When my events are shown, unless there is a definite price, the cost is shown as ‘Free’. How can I show ‘Donation’? I have typed that into the Cost box but it still shows as ‘Free’.
    Can anyone help?
    Thanks
    Graham

    #1002475
    pickleshy
    Participant

    Subscribing to updates about this question πŸ™‚

    #1002586
    Nico
    Member

    Howdy Graham (and pickleshy),

    Welcome to our support forums and thanks for reaching out to us. Hopefully is fairly simple to achieve what you are looking for πŸ™‚

    Just add this snippet to your functions.php file -located at wp-content/themes/your_theme/- :


    add_filter( 'tribe_get_cost', 'donation_cost' );

    function donation_cost ( $cost ) {

    if ($cost == 'Free') {
    $cost = 'Donation';
    }

    return $cost;
    }

    Please try it out and let me know how it goes,
    Best,
    Nico

    #1002790
    Graham
    Participant

    Hi Nico

    Thanks for you message. As I mentioned I’m not an expert at all and couldn’t find exactly where to add your snippet. Please can you explain the process in a bit more detail for me.

    Kind regards

    Graham

    Home

    #1002844
    Nico
    Member

    Hi Graham,

    Thanks for following up on this! For sure, I’ll try to describe this in a more detailed way πŸ™‚

    1- Log into your WordPress site back-end: yoursite.com/wp-admin
    2- Once in there go to ‘Appearance > Editor’ from the left menu.
    3- Click on Theme functions (functions.php) from the Templates list at the right menu.
    4- Before editing the file, copy and save the content to a file in your computer just in case you need to recover the original code.
    5- Scroll down to the end of the file, and after the last line insert the provided code.
    6- Click Update file.

    That’s it! You should see it working after updating the file…

    Please let me know if it does the trick,
    Best,
    Nico

    #1004508
    Graham
    Participant

    That seems to have do the trick.
    Thanks
    Graham

    #1004900
    Nico
    Member

    Hey Graham,

    Glad to hear you could get this working πŸ™‚

    I’ll go ahead and close out this thread, but if you need help with anything else please don’t hesitate to create a new one and we will be happy to assist you.

    Best,
    Nico

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Show Cost As A Donation’ is closed to new replies.