Woo Google Sheets Price Sync
WordPress plugin for WooCommerce that synchronizes product prices with a Google Sheets document once per day.
by Bojan Pavlović · github.com/pavlovic-bojan/integration-woo-google-spreadsheet
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/pavlovic-bojan/integration-woo-google-spreadsheet/archive/refs/heads/main.zipWordPress plugin for WooCommerce that synchronizes product prices with a Google Sheets document once per day.
Description
This plugin allows you to manage WooCommerce product prices directly from a Google Sheets spreadsheet.
Each product (and variation) is represented as one row in the sheet, with columns for product ID, variation ID, name, current shop price, and a new price column that you edit in Google Sheets.
Once per day, the plugin runs a synchronization that:
- Reads the new price column from Google Sheets and applies changes to WooCommerce.
- Updates the shop price column in Google Sheets to reflect the latest price in the webshop.
- Colors rows red for products that are out of stock (when stock is managed in WooCommerce).
- Colors newly added rows green when a product exists in WooCommerce but did not exist in the sheet (for stores that do not manage stock).
Features
- ✅ Daily synchronization of WooCommerce prices with a Google Sheets document
- ✅ One row per product/variation with fixed columns (ID, variation ID, name, shop price, new price, status)
- ✅ Google Sheets → WooCommerce price updates when
new_pricediffers from the current price - ✅ WooCommerce → Google Sheets updates of the
shop_pricecolumn - ✅ Red highlighting of rows for out-of-stock products (when stock is managed)
- ✅ Green highlighting of newly added products when stock is not managed
- ✅ Admin settings page to configure Google API credentials, Spreadsheet ID and sheet/tab name
- ✅ Manual “Run sync now” action from the admin panel
Requirements
- WordPress 5.0 or higher
- WooCommerce 3.0 or higher
- PHP 7.2 or higher
- A Google account with access to Google Sheets and API credentials (OAuth client or service account)
Installation
- Upload the plugin PHP file (e.g.
wm-woo-google-sheet-sync.php) to the/wp-content/plugins/directory. - Activate the plugin through the Plugins menu in WordPress.
- In the WordPress admin menu, go to the new Google Sheet cene page to configure settings.
Configuration
After activation, go to Google Sheet cene in the WordPress admin menu and configure:
-
Google API credentials
Depending on the implementation, you will either:- Paste a service account JSON (recommended for server-to-server sync), or
- Enter Google Client ID/Secret for OAuth and connect your Google account.
-
Spreadsheet ID
The ID of the Google Sheets document (from the URL). -
Sheet name
The name of the worksheet/tab (e.g.Cene) where the plugin will read/write data.
You can also see the timestamp of the last synchronization and trigger a manual sync from this page.
How It Works
-
Initial export / first sync
- The plugin connects to the configured Google Sheets document.
- If the sheet is empty, it can create a header row with column names.
- It exports products and variations from WooCommerce into the sheet, one row per item.
-
Editing prices in Google Sheets
- In Google Sheets, you fill in or change values in the new price column.
-
Daily sync
- Once per day (via WP-Cron), the plugin:
- Reads all rows from the configured sheet.
- For each row, if
new_priceis set and different from the current WooCommerce price, updates the WooCommerce product price. - Updates the
shop_pricecolumn to reflect the actual price stored in WooCommerce. - Applies coloring rules:
- Red for out-of-stock products (when stock is managed).
- Green for newly added rows when a product exists in WooCommerce but not in the sheet (for stores without stock management).
- Once per day (via WP-Cron), the plugin:
-
Manual sync
- From the settings page, you can click “Pokreni sinhronizaciju sada” to run the same sync logic immediately.
Technical Details
- Uses WordPress and WooCommerce APIs for fetching and updating products.
- Uses Google Sheets API for reading and writing spreadsheet data (values and styling).
- Stores configuration in WordPress options with a
wm_gsheet_prefix. - Schedules a daily sync job via WP-Cron on activation, and unschedules it on deactivation.
- Follows WordPress best practices for sanitization, escaping, capabilities, and nonces.
Support
For issues or questions, please contact the plugin author.
Changelog
Version 1.0.0
- Initial version of Woo Google Sheets Price Sync plugin.
- Daily price synchronization from Google Sheets to WooCommerce.
- Row coloring for out-of-stock and newly added products.
- Admin settings page with manual sync action.
License
This plugin is proprietary software. See the LICENSE file for full terms.