Get Script from https://github.com/radus28/wooti This script is done for vtiger : Woocommerce Inegration of
- Products
- Orders
- Customers
Both ways. Woo Customers can be synced bi-directionally into vtiger contacts
-
Install Wordpress and WooCommerce
-
Use vtiger 7.1
-
Get API keys as per How to Get Woocommerc API Key
-
A folder should be added in CRM root named 'woo28' and extract the given zip into that folder.
-
Files are described below
-
in/
Add Webhooks from WooCommerce to the files here.
In WP Admin panel,- WooCommerce->Settings->API->Webhooks->Add Webhook
- order.php
To sync orders from WooCommerce into vtiger SalesOrder
Create a webhook that should trigger to this file when Orders are placed in WooCommerce.
- Give Delivery URL to 'http://yourVTigerCRM.com/woo28/in/order.php'
- Set Topic as Order Updated
- customer.php
To sync customers from WooCommerce into vtiger contacts
Create Two webhooks that should trigger to this file when Customer are Created and Updated in WooCommerce.
- Give Delivery URL to 'http://yourVTigerCRM.com/woo28/in/customer.php' > 1. Set first webhook Topic as Customer Created > 2. Set second webhook Topic as Customer Updated
-
out/
- products.php - This is the custom function file run through vtiger workflow to sync Products to wooCommerce
- customer.php - This is the custom function file run through vtiger workflow to sync Customers to wooCommerce
-
woo/
- Move into this folder and run
composer install
- client.php
-
Set your woocommerce URL and api keys here
//Consumer Key of your WooCommerce API $cKey = 'ck_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; //Consumer Secret of your WooCommerce API $cSecret = 'cs_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; //URL of your WooCommerce Site $wooUrl = 'http://www.yourWooCommerceSite.com';
-
- Move into this folder and run
-
vt/
- ws_auth.php
-
Set your VTiger CRM URL, username and accessKey
// You may use any user $username = 'xxxxxx'; // Obtain from CRM > My Preference > Access Key (Use admin user to get all privileges $accessKey = 'xxxxxxxxxxxxxxxx'; //Your VTiger CRM URL $vtigerUrl = 'http://www.yourVTigerCRMSite.com';
-
- ws_auth.php
-
addfield.php
- Run this file from browser to add woo_id to SO and Products
-
registercf.php
- Run this from browser to register custom function under Products in CRM.
- A custom function will be listed under Product workflow
- Add a work-flow using above custom function to send products (condition : active = yes)
-
-
To upload images to
Woo
, use URLs of vtiger product images. Example http://example2.com/storage/2021/January/week2/564_listening_room.jpg. To achieve this, you should have the CRM's storage folder public.