Hi. How can we help?

Event Tickets - Add google calendar button on product page

If you want to show the google calendar button on product page where your customers can add the event on their google calendars.

Add the following code on functions.php

if( class_exists( 'YITH_Tickets' ) ) {
if (!function_exists('yith_wcevt_add_google_calendar_button_on_product_page')) {
function yith_wcevt_add_google_calendar_button_on_product_page()
global $product;

if ('ticket-event' == $product->get_type()) {

$url_google_calendar = yith_wcevti_get_google_calendar_link($product->get_id());

<a href="<?php
echo $url_google_calendar; ?>" class="button wc-forward"
target="_blank"><?php echo __('Export to Google Calendar', 'yith-event-tickets-for-woocommerce') ?></a>


add_action('woocommerce_after_add_to_cart_form', 'yith_wcevt_add_google_calendar_button_on_product_page');
Was this article helpful?
0 out of 0 found this helpful

Back to Help Center >