Support

Home Forums Events Calendar Add-on Price in calendar tooltip

Price in calendar tooltip

Posted: February 17, 2015 at 11:07 am


Brett McCumber

February 17, 2015 at 11:07 am

I would like to display price in the tooltip. After searching the forum I founf the following code that I pasted in espresso-calendar.php

$tooltipPrice = ee_show_meta($event_meta, 'event_price');
$events[ $cntr ]['tooltip'] .= '<p>Price: ' . $tooltipPrice . '</p>';

Didn’t work for me. Did I miss a step somewhere?

Screenshot


Dean

February 18, 2015 at 1:51 am

Hi,

If you are not seeing the word Price in your tooltip then it might be the location of where you are adding the code. I added it around line 733 and it worked fine.

If it is just the price, then that is because the code itself does not pull in an actual price. That code uses the custom meta fields in the event, so the person has added a field called event_price and then manually added the price as its value. This would have to be done for each event. Example http://take.ms/WkiDR

You could make the code more advanced and have it pull the data from the database but it would be more work and would likely slow down the calendar load (it will make a request for every event showing).

An example way to get price details is this: https://gist.github.com/sethshoultes/f05ae8b0c2f549a94d67 (please note it will not copy and paste into the calendar, you would need to just use this as an example).


Brett McCumber

February 18, 2015 at 11:36 am

Thank you so much for your help. This makes more sense now.

The support post ‘Price in calendar tooltip’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso