Home › Forums › Calendar Products › Events Calendar PRO › Show Cost As A Donation
- This topic has 6 replies, 3 voices, and was last updated 8 years, 8 months ago by Nico.
-
AuthorPosts
-
September 5, 2015 at 5:00 am #1002371GrahamParticipant
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
GrahamSeptember 5, 2015 at 7:49 pm #1002475pickleshyParticipantSubscribing to updates about this question π
September 7, 2015 at 5:51 am #1002586NicoMemberHowdy 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,
NicoSeptember 8, 2015 at 1:07 am #1002790GrahamParticipantHi 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
September 8, 2015 at 6:04 am #1002844NicoMemberHi 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,
NicoSeptember 12, 2015 at 5:17 am #1004508GrahamParticipantThat seems to have do the trick.
Thanks
GrahamSeptember 14, 2015 at 9:02 am #1004900NicoMemberHey 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 -
AuthorPosts
- The topic ‘Show Cost As A Donation’ is closed to new replies.