1. Home
  2. Booking & Appointment Plugin for WooCommerce – NEW
  3. Integrations
  4. Exporting Product Level bookings to Google Calendar

Exporting Product Level bookings to Google Calendar

Some Booking & Appointment Plugin for WooCommerce plugin users often wish to send WooCommerce Bookings to different Google Calendars for each Bookable product. For this, you set up Google Calendar Sync from the Product Level.

It allows you to automatically export the bookings for a WooCommerce product to Google Calendar in real time. This makes it convenient for the users to keep records of each product’s bookings in different calendars.

A. What is Google Calendar Sync?

Google Calendar Sync is an integration process that allows you to synchronize your calendars to any device like mobiletabletlaptop, etc.

By setting Google Calendar Sync, your events will be added to the Google Calendar.

You can also set up alerts for incoming messages and upcoming events. This helps in easier and faster access to all important booking dates.

B. Setting Up Google Calendar Sync At Product Level

You can find the Google Calendar Sync tab under the Booking & Appointment meta box.

Go to Integrations > Google Calendar as shown below:

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

Here’s what the Google Calendar dropdown will look like:

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

Go to the Google Developers Console to set up a project. Log in to your Google account and create a new project by clicking on the top left side panel “Select a project” dropdown.

Click on the Create Project icon.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

As you click on Create Project button a popup will be displayed asking for the Project Name.

Enter a Project Name of your preference. (e.g. Product Level Booking).

As you enter the name, the Project ID will be displayed automatically below the Project Name.

Click on the Create button after entering the details.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

Once the project is created, go to the Library tab on the left-hand menu.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

Search for Calendar API. Select it.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

Click on Enable. Go to Credentials > Create credentials button.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

On clicking the Create credentials button, you will get different ways to create credentials.

You can go with an OAuth client ID or a Service account. 

A. Integration via OAuth Sync

Click on OAuth Client ID in the drop-down.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

You need to select the Application type as Web Application. Give it a name.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

 

Proceed forward by adding the Authorised redirect URIs and clicking the Create button.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

You will find the Authorized Redirect URI by going to the Edit Product Page of your product.

Go to the Booking meta box > Integrations > Google Calendar.

Select OAuth Sync under Integration Mode. Scroll down to find the Redirect URI. Copy and paste the link.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

This will generate the OAuth Client and a popup will be displayed with your Client ID and Client Secret. Copy them and store them in a safe place.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

Go back to the Edit Product Page > Booking meta box > Integrations > Google Calendar.

Fill in the Client ID and Client Secret fields. Click on Save Settings. 

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

Click the Connect to Google Calendar button.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

It will ask you to connect your Google account. Select it.

 

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

Allow the integration to take place.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

Once the integration is successful, you will see the following messages on the Edit product page:

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

Select the Calendar where the new bookings will be added.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

You can even enable automated mapping for events that will get imported.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

For instance, you have integrated the product ‘Enrich Salon and Spa’ with Google Calendar at the product level.

A customer places a booking for this salon. The booking date is 4th April 2024.

This booking can be seen by going to Booking & Appointment > Booking > View Booking as shown below:

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

This same event will get imported to your Google Calendar and will appear like this:

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

 

The booking event will show all the details such as Site Address, Booking ID, Booking Date, Booking Time, Name of the customer, and product name. 

B. Integration via Service Account

To create a service account, click the Create Credentials > Service Account Key.

Service account key

Add details such as the service account name and click the Create and Continue button.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

Move ahead and add a role. Select the dropdown.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

Go to Projects > Owner. Select that as your role.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

Click the Continue button.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

Grant users access by adding their email addresses. Once done, click the Done button.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

Go to the Service Accounts tab > Keys > Add Key.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

Set the Key Type to P12 and click on Create.

Exporting Product Level bookings to Google Calendar - Tyche Softwares Documentation

A file with extension .p12 will be downloaded and a pop-up will be displayed stating that the file has been saved on your device.

send WooCommerce Bookings to different Google Calendars- popup window with the filename

Please keep this file saved as this file needs to be uploaded to wp-content/plugins/woocommerce-booking/includes/gcal/key/ using the FTP client program.

This file is required as you will grant access to your Google Calendar account even if you are not online. So this file serves as a proof of your consent to access your Google calendar account.

Note: This file cannot be uploaded in any other way. If you do not have FTP access, ask the website admin to do it for you.

Copy the Key File Name (excluding the .p12 extension).

send WooCommerce Bookings to different Google Calendars- Copy the Key File Name excluding the .p12 extension

Then paste it into Booking > Google Calendar Sync Settings > Key File Name while creating the product.

Product Level Export – Automated - Tyche Softwares Documentation

 

To get the service account email address, go to Create Credentials > Manage Service Accounts. Here you will find details of Service accounts for your project as shown below.

send WooCommerce Bookings to different Google Calendars- Service account ID

Copy the Service Account ID and save it in Booking > Google Calendar Sync Settings > Service Account Email Address field.

Product Level Export – Automated - Tyche Softwares Documentation

Open your Google Calendar by clicking this link: https://www.google.com/calendar/render.

Go to My Calendars > Create New Calendar.

Please try not to use the Primary Calendar.

Give the Calendar a name of your preference (e.g. Bookings & Appointments Details) and ensure that the Calendar Timezone matches the WordPress Timezone on your site.

send WooCommerce Bookings to different Google Calendars- Create New Calendar

 

There will be a Share with specific people option below Timezone. You need to enter the email address entered in the Service Account Email Address field.

Set the “Permission Settings” to Make changes to events‘ and click Add Person. This will ensure that the application can create new events.

Lastly, click on Create Calendar.

send WooCommerce Bookings to different Google Calendars- Share with specific people

Once the calendar is created, copy the Calendar ID from the Calendar Settings. Paste it by going to your Product’s Edit page > Booking & Appointment metabox > Google Calendar > Calendar to be used.

Product Level Export – Automated - Tyche Softwares Documentation

Since all the 3 fields have been filled, Publish your product. Then click the Test Connection link to test the connection.

If your connection is successful a message will be displayed below:

send WooCommerce Bookings to different Google Calendars- Test Connection Successful

Note: If you get an error message, double-check your settings.

As the connection is successful it should add a current dated event in your calendar as shown below:

send WooCommerce Bookings to different Google Calendars- Test Event

 

Once the settings are done, the plugin will export the bookings to the calendar as soon as an order is placed.

send WooCommerce Bookings to different Google Calendars- Exported Booking

 

The event will contain the bookings and client details based on the merge tags inserted in Booking > Settings > Google Calendar Sync > General Settings.

send WooCommerce Bookings to different Google Calendars- Booking Details

In conclusion, exporting bookings automatically to Google Calendar at a product level helps the user keep records of each product booking in different calendars. It also ensures easier and faster access to all your bookings on suitable devices in different calendars.

The Booking & Appointment Plugin for WooCommerce also provides manual sync of the bookings to any other calendar using ICS files. By using ICS files we can manually export our bookings to external calendars.

Was this article helpful to you? Yes No

How can we help?