Documentation
Installation instructions
You can install extension using Extension Installer or manually. In the latter case unpack and upload all folders from "upload" directory to the root of your store. If there's install.xml file in the package, rename it to extension_name.ocmod.xml, replacing "extension_name" with extension's name (or any other name), and upload it to "system" folder. When upgrading from previous version simply rewrite all existing files. Refresh modifications cache from Extensions -> Modifications page (not needed if install.xml file is not included in the package).
Note for OpenCart 3 users
If you see "The directory is not allowed to be written to" error message, download OpenCart 3.0 Extension Installer Fix from this page and install it. Then install the main extension.
Note for OpenCart 2.0.X users
Sometimes OCMod inserts modification in multiple files, which are separated by "|" character in XML-file. On earlier OpenCart 2 versions a comma was used instead. To quickly fix this, open XML file (usually, install.xml) and replace all occurrences of "|" character with "," for "path" attribute in every applicable <file> element. Search for "<file path=" to quickly find and highlight all elements.
If after installation you have "Permission denied" issue when accessing Modules, Shipping, Payments, Order Totals (or any other) section of Extensions menu, remove "module", "shipping", "payment", "total" (or any other) folder from "admin/controller/extension" directory. Same for "admin/language/en-gb/extension" directory. For example ("module" should be removed from both paths):
admin/controller/extension/module
admin/language/en-gb/extension/module
Permissions
In some cases it is required to manually set permissions for installed extension. To do this go to System -> User Groups, find your group and select access/modify permissions for desired extension. You can find extension in permissions list by folder/filename pair (for example, marketing/acoupon).
Extension Setup
Go to System -> Users -> User Groups and give a desired group permissions to access and modify "module/gcontacts". Then visit Extensions -> Modules page and setup Google Contacts Export according to your needs.
Setup Google Application
First of all you need to register Google Account, if you don't have the one yet. After that go to Google API Console, click the dropdown menu on the top left and create a new project.
On project's Dashboard click Enable APIs and Services link at the top, find People API in Social section and enable it.
Click OAuth Consent Screen link in the left menu. On the next page enter App Name, select User Support Email, add Authorized Domain, enter email under Developer Contact Information and click Save & Continue button. On the next page click Add Scopes, find People API, select ".../auth/contacts" scope, save and click Save & Continue button. On the next page click Add Users and enter your Google Account email. Click Save & Continue button one last time.
Click Credentials link in the left menu, then Create Credentials button at the top and select "OAuth Client ID". On the next page select Web Application as Application Type and copy Redirect URI from extension's settings to Authorized Redirect URIs field, hit Enter to add it and click Create button. Copy Client ID and Client Secret to extension settings and save them.
Click Login link in message on top of the settings and authorize application (ignore "application not verified warning" and click Continue). Save settings again. If you did everything right, you'll see a list of your Google Contacts groups. Select any Google group you want and setup other options according to your liking. It is highly recommended to create a separate group for syncing purposes (Customers, for example) and select it.
Options
Each option has a short hint, which explains the basics. Below are more detailed explanations:
- Action Link - Link to run the script manually or use in cron command.
- Cron Secret - Secret key for action link to increase security.
- Redirect URI - Your Google application's Authorized Redirect URI, which you have to enter in Google Client ID settings.
- Client ID - Your Google application Client ID. Can be found on project's Credentials page in Google Developer's Console.
- Client Secret - Your application's Client Secret. Can be found on project's Credentials page in Google Developer's Console.
- Google Groups - Google Contacts groups to sync with. List of groups is taken automatically from your Google account.
- Data to Sync - Customer data you want to sync with Google Contacts. You must select at least one item or no syncing will occur.
- Include Disabled - Sync disabled customers as well.
- Only Approved - Only approved customers will be synced.
- Send Report - Full job report will be sent to admin store email after every run.
- Debug - Add Google response contents to report. This is useful, if you're having issues with syncing and want to understand why.
- Stores - Customers will be limited to selected stores.
- Customer Groups - Customers will be limited to selected groups.
- Status - Disables or enables extension.
How to Use
When you done with setup, it is highly recommended to enable Debug option and do a test run. Click the Action Link in extension settings and wait for job to complete. You'll see a report right on screen. In case of any errors or doubts check the error log for more info.
To setup automatic syncing, you need co create a cron job, which runs given URL, using Action Link from extension settings. If you don't know, how to setup cron job, contact your hosting provider on the matter. Setup may vary from one server to another.
NOTE: Sometimes it requires several script runs to sync all your customers due to error responses from Google. If you have large number of customers, it will also take some time to sync them all due to API request limitations (90 requests per minute). Be patient and wait until all your customers synced.