Google Calendar Orders (dfordercalendar)
Install and configure automatic PrestaShop order sync to Google Calendar: Google Cloud credentials, OAuth 2.0 connection, event customization and troubleshooting.
Overview
Google Calendar Orders (dfordercalendar) automatically creates an event in your Google calendar for every order validated on your PrestaShop 8 or 9 store. The event contains the reference, customer, total, payment method, carrier, product list and delivery address. The connection uses OAuth 2.0 with your own Google Cloud credentials: no data passes through a third-party server.
Installation
- In the back office, open Modules then Module Manager.
- Click Upload a module and select the dfordercalendar.zip file.
- Once installed, click Configure.
Requirements: PrestaShop 8.0 to 9.x, PHP 7.4 to 8.3 with the cURL extension enabled (available on virtually all hosting plans).
Creating the Google credentials (Google Cloud Console)
The module connects to the Google Calendar API with OAuth 2.0 credentials you create once, in about ten minutes.
1. Create a project and enable the API
- Open console.cloud.google.com and sign in with the Google account that owns the target calendar.
- Create a project (for example “PrestaShop Store”).
- In the menu, open APIs and Services then Library, search for “Google Calendar API” and click Enable.
2. Configure the consent screen
- Open APIs and Services then OAuth consent screen.
- Choose the External type (or Internal if you are on Google Workspace), fill in the application name and your email, then save.
While the application stays in “Testing” status, Google expires the connection after 7 days. Two solutions: publish the application (Publish app button, no review is required for this kind of usage) or add your own account to the test users list and publish later. For production use, publish the application.
3. Create the OAuth 2.0 credential
- Open APIs and Services then Credentials, click Create credentials then OAuth client ID.
- Application type: Web application.
- In “Authorized redirect URIs”, paste exactly the URL displayed in the Google connection panel of the module configuration (it ends with controller=oauth).
- Confirm: Google displays your Client ID and Client Secret.
The redirect URI must be copied verbatim, https protocol included. This is the number one cause of the redirect_uri_mismatch error.
Connecting the module
- In the module configuration, paste the Client ID and Client Secret, then save.
- Click Connect Google account: Google asks for permission to access your calendars.
- Approve: a message confirms the connection, go back to the configuration.
- In Target calendar, pick the calendar that will receive the orders (every calendar your account can write to is listed, shared calendars included), then save.
The access token refreshes automatically, so the connection is a one-time step. The Disconnect button removes the tokens at any time.
Event configuration
Title template
The event title is freely composed with the following variables:
{reference}: order reference{customer}: customer first and last name{total}: tax-included total formatted in the order currency{payment}: payment method{carrier}: carrier{shop}: shop name
Example: Order {reference} - {customer} ({total})
Event type and content
- Event type: timed at the order date and time (duration adjustable in minutes, shop timezone) or all-day.
- Include product list: adds each line with its quantity to the description.
- Include delivery address: added to the description and to the event location field.
- Include customer email and phone: contact details added to the description.
- Update event on order status change: appends the current status to the title on every state change.
Day-to-day operation
As soon as an order is validated, the event is created in the target calendar. On the back-office order page, a Google Calendar panel shows the direct link to the event, or the synchronization status if something went wrong.
The “Create a test event from the latest order” button lets you verify the whole chain without waiting for a real order.
Failures and retry
A failed Google API call never blocks order validation. The failure is recorded with the exact error message returned by Google and shows up in the Failed synchronizations panel of the configuration. The Retry failed events button recreates every missing event in one click. Errors are also traced in the PrestaShop logs (Advanced Parameters then Logs).
Troubleshooting
redirect_uri_mismatch
The redirect URI declared in Google Cloud Console does not exactly match the one displayed by the module. Copy it again from the configuration, with no missing character or space, and check the https.
access_denied or connection expiring after 7 days
Your OAuth application is in “Testing” status. Publish it from the OAuth consent screen (see above), then reconnect the account.
403 error: Google Calendar API has not been used
The Google Calendar API is not enabled on the project. Go back to the Library, enable it, wait a minute and retry the failed events.
A calendar is missing from the list
Only calendars the connected account can write to are listed. For a shared calendar, ask the owner for the “Make changes to events” permission.
Data and uninstallation
The OAuth tokens and the synchronization log are stored in your shop database. Order data travels only between your server and the Google API, over HTTPS. Uninstalling the module removes the tokens, the configuration and the log table; events already created remain in your Google calendar.