Process Flow: Product Sync (Zoho to WooCommerce)
This document outlines how product data is managed in Zoho CRM and synchronized with the WooCommerce store. This is the foundational process for the entire e-commerce operation.
Trigger: A manual sync from the “EDGE Sync Dashboard” or a scheduled background task (cron job).
graph LR A[Zoho CRM] -- "1. Fetch All Product Data" --> B(EDGE Store Plugin) B -- "2. Decode SKU & Hydrate Data" --> C{WooCommerce Product} C -- "3. Create or Update" --> D[WooCommerce Database] B -- "4. Set Prices based on Pricelist/Role" --> D B -- "5. Set Visibility based on Pricelist/Role" --> D
The Zoho SKU System: The Brains of the Operation
The entire system is built around a structured SKU (Stock Keeping Unit) system within Zoho. Each SKU is a code that contains vital information about the product.
SKU Structure Example: 1234-1-2-1-0-1-0
| Position | Length | Description | Example Value | Meaning |
|---|---|---|---|---|
| 1-4 | 4 | Title Code | 1234 | Relates to the main product title |
| 5 | 1 | CourseBook | 1 | Yes (1) or No (0) |
| 6 | 1 | Textbook/eBook | 2 | Textbook (1), eBook (2), Both (4) |
| 7 | 1 | Study Guide | 1 | Print (1) or Digital (2) |
| 8 | 1 | Workbook | 0 | Print (1) or Digital (2) |
| 9 | 1 | Edition / Print Coupon | 1 | STD (1), PRO (2), LTI (3) / Coupon ID |
| 10 | 1 | USB | 0 | Yes (1) or No (0) |
This SKU system is the single source of truth for a product’s attributes.
Step-by-Step Sync Breakdown
- Fetch Data: The EDGE Store plugin makes an API call to Zoho CRM to retrieve all “sellable” products. This includes product details, pricing information, and their association with different pricelists.
- Process Products: The plugin iterates through each product from Zoho.
- Decode SKU: For each product, the plugin’s
ZohoHelperreads the SKU and decodes it to determine its attributes:- Is it a print or digital product?
- What does it include (e.g., a textbook, a study guide)?
- What is the edition?
- Create/Update in WooCommerce:
- If a product with that SKU doesn’t exist in WooCommerce, a new product is created.
- If it already exists, the existing product is updated with the latest information from Zoho.
- Set Attributes: The decoded SKU information is used to set the product’s attributes in WooCommerce (e.g., “Format: Print”, “Includes: Textbook”).
- Set Pricing & Visibility: The plugin checks which Zoho Pricelist the product belongs to. It then uses this information to set the product’s price and visibility rules for the corresponding user role in WordPress. For example, a product on the “Lecturer Pricelist” will only be visible and have its special price for users with the “Lecturer” role.
- Grouped Products: The system also handles grouped products. Individual SKUs (like a print book and an eBook) are automatically grouped under a main product title based on their Title Code.