Support

Home Forums Event Espresso Premium Add "Add to calendar" icon to confirmation page

Add "Add to calendar" icon to confirmation page

Posted: April 4, 2015 at 12:42 am

Viewing 3 reply threads


Leisha

April 4, 2015 at 12:42 am

How do I add the “Add to calendar” button to the event registration thank you page? We plan to remove from event listing / detail page and only show here as it seems to make more sense that way. I tried searching in here for an example but the other posts mentioned files I can’t find in EE4.


Lorenzo Orlando Caum

  • Support Staff

April 7, 2015 at 11:09 am

Hi Jase,

This isn’t available at this time as some of the templates that are used on the thank you page can’t be relocated. We have an enhancement request for that and we do have an enhancement ticket to make it available as a shortcode so it can be used in the registration details emails that are sent out after a successful registration.

The enhancement for the ical shortcode will likely be available first and I’ll update this support post once it has been added to the core plugin.


Lorenzo


Leisha

April 13, 2015 at 1:46 am

Do you see any problems with this code? If I put it in my functions.php file it does work:

/////////////////////////////
//make it a button
function return_button(){return ‘button’;}
add_filter( ‘FHEE__EED_Ical__generate_add_to_iCal_button__iCal_type’, ‘return_button’ );

function add_ical($tk) {

$reg = $tk->get_first_related( ‘Registration’ );

EE_Registry::instance()->load_helper(‘Event_View’);

$datetimes = EEH_Event_View::get_all_date_obj( $reg->get(‘EVT_ID’), true, FALSE, 1 );

foreach($datetimes as $datetime)
{
$html = apply_filters( ‘FHEE__espresso_list_of_event_dates__datetime_html’, ”, $datetime );
echo $html;
//move the button etc.
echo ‘<script>jQuery(“a.ee-ical-btn”).addClass(“big-text”).css(“margin-left”,”15px”).removeClass(“ee-ical-btn small”).append(“‘. __( ‘Add to iCal Calendar’, ‘event_espresso’ ) .'”).insertAfter( jQuery(“a.indented-text”) );</script>’;
break;
}
}
//add ical thing after thanks page content
add_action( ‘AHEE__thank_you_page_overview_template__content’,’add_ical’);


Dean

April 13, 2015 at 3:54 am

Hi,

I don’t see anything structurally wrong with the code. If it displays the ical, with the correct date, then I would run with it until the devs provide a core solution.

Viewing 3 reply threads

The support post ‘Add "Add to calendar" icon to confirmation page’ 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