Difference between revisions of "Module Woocommerce EN"

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
(Rewrite of the page)
Line 2: Line 2:
 
[[Category:Woocommerce]]
 
[[Category:Woocommerce]]
 
[[Category:E-commerce]]
 
[[Category:E-commerce]]
{{TemplateDocDev}}
+
<div style="text-align:center; float:right; font-size:80%; background: #eef; border: 1px solid #ccf; margin-bottom: 0px; margin-left: 2px; margin-right: 2px; padding: 1px; height: 92px">
{{TemplateDocUser}}
+
[[Documentation Développeur|Retour index<br>Documentation développeur]]<br>
<keywords content="Woocommerce, Dolibarr, synchro, synch, interface" />
+
[[File:File_Doc_dev.png|link=Documentation Développeur]]</div>
 +
 
 +
<div style="text-align:center; float:right; font-size:80%; background: #eef; border: 1px solid #ccf; margin-bottom: 0px; margin-left: 2px; margin-right: 2px; padding: 1px; height: 92px; min-width: 100px;">
 +
[[User documentation|Return to user<br>documentation index]]<br>
 +
[[File:File_Doc_user.png|link=User documentation]]
 +
</div>
 +
 
 +
<keywords content="Woocommerce, Dolibarr, synchro, synch, interface"/>
 
= Overview =
 
= Overview =
{{TemplateModuleInfo
+
{| border="0" width="100%" cellpadding="0" cellspacing="0" class="dolbox"
|modulename=Woocommerce
+
|-
|editor=Open-DSI continues the work of Teclib
+
|valign="top" style="max-width: 200px" | Module Name ||WooSync
|web site=https://www.open-dsi.fr
+
|-
|onlineshop={{http://www.dolistore.com/fr/modules/851-Woosync.html|keyword=Woocomerce}}
+
|| Editor / Editeur ||[https://www.open-dsi.fr Open-DSI]
{{http://www.open-dsi.fr/produit/souscription-annuelle-woosync/}}
+
|-
|status=development
+
|| Download or buy page / Page achat ou téléchargement||
|prerequisites=
+
* [https://www.dolistore.com/fr/modules/851-Woosync.html dolistore]<br>
|minversion=4.0.0+
+
* [https://www.open-dsi.fr/produit/souscription-annuelle-woosync/ boutique open-dsi]
Woocomerce version 3.x+
+
|-
|note=
+
|| Status / Statut / Estado ||Stable
}}
+
|-
 +
|| Prerequisites / Prérequis||
 +
* Dolibarr min version 4.x
 +
* Woocomerce min version 3.x
 +
|-
 +
|| Last update date / Date mise à jour fiche / Fecha última actualización || {{REVISIONYEAR}}-{{REVISIONMONTH}}-{{REVISIONDAY}}
 +
|-
 +
| valign="top"| Note / Nota || WooSync is a fork of [https://www.dolistore.com/fr/modules/729-ECommerceNG---Module-Synchro-Magento.html EcommerceNG] developed by TecLib
 +
|}
  
 
= Feature/Plugin =
 
= Feature/Plugin =
 +
WooSync synchronizes data between WooCommerce and Dolibarr : thirdparties and contacts, products, orders... automatically from Dolibarr to WooCommerce and manually from WooCommerce to Dolibarr.
  
The Woocommerce module has to be installed on your Dolibarr instance (rep. htdocs/custom) to work properly. To access Woocommerce, Dolibarr uses by default
+
= Development =
the Woocommerce's WebServices (REST API v2).
+
The development of this module is not included into the standard GIT repository of Dolibarr; but inside a dedicated repository, managed by Open-DSI.
 +
* GIT Repository: https://github.com/OPEN-DSI/ecommerceng
  
 
= Installation =
 
= Installation =
== Woocommerce ==
+
WooSync module has to be installed in your Dolibarr directory <code>htdocs/custom</code> to work properly. To connect to Woocommerce app, Dolibarr uses by default Woocommerce's WebServices (REST API v2).
To be defined
 
  
 
== Dolibarr module ==
 
== Dolibarr module ==
{{InstallModuleEn}}
+
* Download the archive file of module (.zip file)
 
+
* Unzip the folder into the <code>htdocs/custom</code> directory of your Dolibarr.
= Setup =
+
* Module is then visible into list of available modules (<span style="font-variant: small-caps;">Home > Setup > Modules/applications</span>) and can be activated.
{{ActivationModuleEn}}
 
  
 
== Setup on Woocomerce side ==
 
== Setup on Woocomerce side ==
To be defined
+
* The option <span style="font-variant: small-caps;">Enable guest checkout</span> had better be disabled;<br>
 +
* The <span style="font-variant: small-caps;">New User Default Role</span> has to be set on "Client";<br>
 +
* WooSync has been tested without any other application than WP Oauth server and WP Mail SMTP by WPForms.<br>
  
 
== Setup on Dolibarr side ==
 
== Setup on Dolibarr side ==
 +
From <span style="font-variant: small-caps;">Home > Setup > Other</span>, hidden rules can be enabled :
 +
* <code>ECOMMERCENG_DISABLE_LOG_IN_NOTE</code> at <code>1</code> to disable the log in the private note of orders from WooCommerce in Dolibarr;<br>
 +
* <code>ECOMMERCENG_SHOW_DEBUG_TOOLS</code> at <code>1</code> to show init/purge/debug tools into site page;<br>
 +
* <code>ECOMMERCENG_DISABLED_ERROR_FOR_SOCIETE_ID_0</code> at <code>1</code> to disable the error at the creation of an order when societe id = 0 (administrator, anonymous, ...);<br>
 +
* <code>ECOMMERCENG_SHOW_DEBUG_TOOLS</code> at <code>1</code> to display debug options;<br>
 +
* <code>ECOMMERCE_WOOCOMMERCE_DEFAULT_TVA</code> at <code>1</code> to set default TVA rate to use;<br>
 +
* <code>ECOMMERCENG_ENABLED_SYNCHRONIZE_IMAGES_PRODUCT_BUTTON</code> at <code>1</code> to display the button to force picture synchronization on <span style="font-variant: small-caps;">lnked files</span> tab of product card;<br>
 +
* <code>ECOMMERCENG_WOOCOMMERCE_DISABLED_SYNCHRO_IMAGE</code> at <code>1</code> to prevent picture synchronization;<br>
 +
* <code>ECOMMERCENG_SHIPPING_NOT_DISPLAY_IF_NULL</code> at <code>1</code> not to display free shipping fees on Dolibar orders.
  
Setup > Other setup:<br><br>
+
=Items Synchronization between Dolibarr and WooCommerce=
ECOMMERCENG_DISABLE_LOG_IN_NOTE => 1 (Disable the log in the private note)<br>
+
The <span style="color:#9B5C8F;">'''WooCommerce &rArr; Dolibarr'''</span> synchronization is made by a '''manual operation''' : It requires the user to click on "Woocommerce to Dolibarr sync" button.
ECOMMERCENG_DISABLE_MAGENTO_PRICE_TYPE => 1 (Disable the price type managment for magento)<br>
 
ECOMMERCENG_BILLING_CONTACT_NAME => 'Choose your Billing contact/address name' (Set name for the billing contact/address)<br>
 
ECOMMERCENG_SHIPPING_CONTACT_NAME => 'Choose your Shipping contact/address name' (Set name for shipping contact/address)<br>
 
ECOMMERCENG_SHOW_DEBUG_TOOLS => 0 (Show init/purge/debug tools into site page)<br>
 
ECOMMERCENG_DISABLED_ERROR_FOR_SOCIETE_ID_0 => 1 (Disable error for the creation of an order when societe id = 0 (Administrator, anonymous, ...))
 
  
= Usage=
+
The <span style="color:#3C70A0;">'''Dolibarr &rArr; WooCommerce'''</span> synchronization is made '''in real time'''. No manual operation is required.
To be defined
 
  
== Syncronize Woocommerce with Dolibarr ==
+
{| class="wikitable"  
{|class="wikitable sortable"
+
!Items||Synchronization||Action||Comment
 
|-
 
|-
!Actions in Woocommerce !!Adjustments in Dolibarr !! When !! Note
+
|rowspan="2"|'''Categories'''
 
+
(thirdparties & products/services)
 +
|style="color:#3C70A0;"|'''Dolibarr &rArr; WooCommerce'''
 +
|style="color:#3C70A0;"|None
 +
|style="color:#3C70A0;"|''In a future version, categories created in Dolibarr will be synchronized in WooCommerce''
 
|-
 
|-
|Categories established/modified  in Woocommerce || They are changing in Dolibarr into sub-categories of the parent category, used for Mageto categories (defined in the module setup) || It requires the user to click on "Woocommerce to Dolibarr sync" button || <div style="color: #600">NA</div>Table llx_ecommerce_category is updated to remember the link between dolibarr categorie id and remote Woocommerce id.  
+
|style="color:#9B5C8F;"|'''WooCommerce &rArr; Dolibarr'''
Due to the fact that there is no option to search the last categories, modified over time, this sync  might be slow down by the high number of categories
+
|style="color:#9B5C8F;"|They are synchronized as sub-categories of the parent category declared in Dolibarr (WooCommerce module settings)
 
+
|style="color:#9B5C8F;"|Table <code>llx_ecommerce_category</code> is updated to save the link between Dolibarr category id and remote WooCommerce id.
 +
'''Warning >''' Due to the fact that there is no option to search the last modified categories, their synchronization might be slown down by the high number of categories.
 
|-
 
|-
| Products created/modified products/stock in Woocommerce || They are set up in Dolibarr (and linked to its categories <span style="color: #600">NA</span>).<br>If the module supply is enabled and '''Supply synchronisation direction''' was set to "ecommerce2dolibarr", it will be initialised/updated in the warehouse (defined in the eCommerce dolibarr module setup) || It requires the user to click on "Woocommerce to Dolibarr sync" button || <div style="color: #060">Available</div>Table llx_ecommerce_product is updated to remember the link between dolibarr product id and remote Woocommerce id<br><br>Informations concerned:<br>&nbsp;&nbsp;- Product : Product type (Product or Service(=Virtual in Woocommerce)), Ref (UGS in Woocommerce, Activated 'Elephant' code generator in module preferences if UGS is probably empty), Label (Name in Woocommerce), Description, Weigth (Kg), Price, envente (Purchasable in Woocommerce), Product finished type (Fixed at Manufactured), Min price (Price in Woocommerce), Url (Permalink in Woocommerce), Stock quantity<br>&nbsp;&nbsp;- Product Variation : Product type (Product or Service(=Virtual in Woocommerce)), Ref (UGS in Woocommerce, Activated 'Elephant' code generator in module preferences if UGS is maybe empty), Label (Name & liste (attribute name: attribute option) in Woocommerce), Description, Weigth (Kg), Price, envente (Purchasable in Woocommerce), Product finished type (Fixed at Manufactured), Min price (Price in Woocommerce), Url (Permalink in Woocommerce), Stock quantity
+
|rowspan="2"|'''Thirdparties & contacts'''
 +
|style="color:#3C70A0;"|'''Dolibarr &rArr; WooCommerce'''
 +
|style="color:#3C70A0;"|None
 +
|style="color:#3C70A0;"|<!-- ''In a future version, thirdparties & contacts created in Dolibarr will be synchronized in WooCommerce'' -->
 
|-
 
|-
| Thirdparties and contacts/addresses created/modified into Woocommerce || They are also created in Dolibarr || It requires the user to click on "Woocommerce to Dolibarr sync" button || <div style="color: #060">Available</div>Table llx_ecommerce_societe and llx_ecommerce_socpeople is updated to remember the link between dolibarr thirdparty id and remote Woocommerce id. To determine if a thirdparty already exists, Woocommerce checks the ref. To determine if a contact already exists, Woocommerce checks all fields: firstname, last name, address, zip, town (and thirdparty).<br><br>Informations concerned:<br>&nbsp;&nbsp;- Thirdparties : Name (First name & Last Name), Email, Type client (Fixed at Client/Prospect)<br>&nbsp;&nbsp;- Contact/addresses - Billing: Type (Fixed at Invoice), Name and last name ('Billing' by default or ECOMMERCENG_BILLING_CONTACT_NAME), Email, Address (Address 1 & Address 2), City, Postcode, Country, Phone<br>&nbsp;&nbsp;- Contact/addresses - Shipping (If they are not set up, it could be done from the billing address): Type (Fixed at Delivery), Name and last name ('Shipping' by default or ECOMMERCENG_SHIPPING_CONTACT_NAME), Address (Address 1 & Address 2), City, ZIP, Country
+
|style="color:#9B5C8F;"|'''WooCommerce &rArr; Dolibarr'''
 
+
|style="color:#9B5C8F;"|Thirdparties are created in Dolibarr as customers in the category declared in the module setting page. Shipping and billing addresses are created as contacts. WooSync checks email adresses before creating a new thirdparty.
|-
+
|style="color:#9B5C8F;"|'''Synchronized data''' :
| Orders created/modified  in Woocommerce || They are also created in Dolibarr || It requires the user to click on "Woocommerce to Dolibarr sync" button || <div style="color: #060">Available</div>Table llx_ecommerce_order is updated to remember the link of dolibarr order id and remote Woocommerce id<br><br>Informations concerned:<br>&nbsp;&nbsp; The orders created by another person than Customer user (Administrator, Anonymous, ...) are not created/modified<br>&nbsp;&nbsp;- Order: Ref client (Id order in Woocommerce),Purchase order date (Created date in Woocommerce), Delivery date (Completed date in Woocommerce), Status (pending => Validated, on-hold & processing => Accepted, cancelled & Failed => Cancelled, Completed & Refunded => Closed), Payment status (pending & processing & on-hold & cancelled & Failed => Not paid, Completed & Refunded => Paid), Private note (Customer's notes in Woocommerce)<br>&nbsp;&nbsp;- Product: Description (Name in Woocommerce), Product type (Fixed at Simple), Price, Quantity, VAT rate (Calculated with total and total tax closed to VAT rate in Dolibarr)<br>&nbsp;&nbsp;- Shipping line of the product (Displayed by default or ECOMMERCENG_SHIPPING_NOT_DISPLAY_IF_NULL): Description ('Shipping - ' & Shipping method title in Woocommerce if present), Price (Total shipping in Woocommerce), VAT rate (Calculated with shipping total and shipping tax closed to VAT rate in Dolibarr)<br>&nbsp;&nbsp;- Order address: Billing Contact/addresses in Thirdparties<br>&nbsp;&nbsp;- Invoice address: Billing Contact/addresses in Thirdparties<br>&nbsp;&nbsp;- Shipping address: Shipping Contact/addresses in Thirdparties
+
* Company Name (if filled in, thirdparty name. If not, thirdparty is created as a contact)
 
+
* Lastname
|-
+
* firstname
| Shipment created/modified in Woocommerce || By creating a shipment in Woocommerce the statut of the order is changing from "pending" to "processing". Considering the modified status of the order, see the cas above "Order created/modified in Woocommerce". || It requires the user to click on "Woocommerce to Dolibarr sync" button ||<div style="color: #600">NA</div>''Note:'' The shipment is not downloaded onto Dolibarr, only the status of Dolibarr Order is changing according to the Woocommerce order.<br>''Note:'' You may choose to manage shipment in Dolibarr or in Woocommerce (we recommand to create/update the shipments on Dolibarr rather than on Woocommerce).
+
* Adress
 
+
* ZIP
 +
* Town
 
|-
 
|-
|Invoices created/modified in Woocommerce || They are also created in Dolibarr (with correct status but without payments) || It requires the user to click on "Woocommerce to Dolibarr sync" button || <div style="color: #600">NA</div>Table llx_ecommerce_the bill is updated to host a link between dolibarr invoice id and remote Woocommerce id.<br>''Note:'' The payment must still be registered manually on Dolibarr.
+
|rowspan="2"|'''Products / Services'''
|}
+
|style="color:#3C70A0;"|'''Dolibarr &rArr; WooCommerce'''
TODO In a future version of the module,the "Woocommerce to Dolibarr sync" button could be replaced with a scheduled job/script to launch it automaticaly every hour.
+
|style="color:#3C70A0;"|Products are synchronized in real time if they are linked to the ecommerce category declared in the module setup.
 +
Pictures are synchronized in real time. Several rules can be enabled (See above : "Setup on Dolibarr side").
 +
|style="color:#3C70A0;"|'''Synchronized data''' :
 +
* Product (event <code>PRODUCT_MODIFY</code>)
 +
** Réf.  &rArr; UGS;
 +
** Label &rArr; Name;
 +
** Status (published (for sale) or pending);
 +
** Description &rArr; empty;
 +
** Description boutique &rArr; Description;
 +
** Description courte boutique &rArr; Short description;
 +
** Price  &rArr; Régular price;
 +
** Weigth (Kg)
 +
** Stock quantity;
 +
** In stock
 +
* Product Variant
 +
We recommand to create variant in WooCommerce.
 +
<!-- (event <code>PRODUCT_MODIFY</code>)
 +
** Réf. &rArr; UGS;
 +
** Price  &rArr; Régular price;
 +
** Weigth (Kg)
 +
* Stock (event <code>STOCK_MOVEMENT</code>) -->
 +
|-
 +
|style="color:#9B5C8F;"|'''WooCommerce &rArr; Dolibarr'''
 +
|style="color:#9B5C8F;"|They are set up in Dolibarr and linked to the category declared in the module setup.  
 +
If the module Suppliers is enabled and Stock synchronization direction is set on <span style="font-variant: small-caps;">Ecommerce to Dolibarr</span>, products will be initialised/updated in the warehouse defined in the WooSync module setup in Dolibarr.
  
== Synchronize Dolibarr with Woocomerce ==
+
Variants have to be created in WooCommerce. They will be synchronized as product/services in Dolibarr.
 
 
The synchronization  is happening in real time.
 
 
 
{|class="wikitable sortable"
 
|-
 
!Actions in Dolibarr !! Adjustments in Woocomerce !! When !! Note
 
|-
 
| Categories created into Dolibarr || Currently there is no update in Woocomerce. In a future version of the module, it will be possible if the category belongs to the parent category of Woocomerce, defined in the module setup || There is no set up /update currently done  in Woocomerce. In a updated version, the sync will happen in real time || <div style="color: #600">NA</div>
 
|-
 
| Categories modified in Dolibarr || No update is currently done in Woocomerce. In a future version of the module, Woocomerce will be updated if the category is linked to Woocomerce (category was setted up  by a "Woocomerce to Dolibarr sync") || There is no set up /update currently done in Woocomerce. In a future version of the module, the sync will happen in real time || <div style="color: #600">NA</div>
 
|-
 
| Products created in Dolibarr || None. In a future version of the module, the the products will be set up in Woocomerce if the category belongs to the  the nested categories of Woocommerce|| No prodoctut category is set up in Woocomerce. In a future version of the module, the sync will happen in real time ||<div style="color: #060">TODO</div>
 
|-
 
| Products or Stock modified in Dolibarr || The update in Woocommerce is done if the product is linked to Woocommerce (product was created by a "Woocommerce to Dolibarr sync")<br>If the module stock is enabled and '''Stock synchronisation direction''' was set up to "dolibarr2ecommerce", then the stock is also overwritten on Woocommerce|| In real time || <div style="color: #060">Available</div><br>Informations concerned:<br>&nbsp;&nbsp;- Product (PRODUCT_MODIFY event): Name (Label in Dolibarr), Status (published (for sale) or pending), Description, UGS (Ref in Dolibarr), Regular price (Price in Dolibarr), Weigth (Kg)<br>&nbsp;&nbsp;- Product Variation (PRODUCT_MODIFY event): Description, UGS (Ref in Dolibarr), Regular price (Price in Dolibarr), Weigth (Kg)<br>&nbsp;&nbsp;- Stock (STOCK_MOVEMENT event): Stock quantity, In stock
 
  
 +
|style="color:#9B5C8F;"|'''Synchronized data''' :
 +
* Product type &rArr; Product or Service if set as "virtual"
 +
* UGS &rArr; Ref.
 +
'''Note >''' It requires the activation of 'Elephant' code generator in Dolibarr module Products/services
 +
* Name &rArr; Label
 +
* Description &rArr; empty
 +
* Statut pour le site "boutique_wordpress" &rArr; Status
 +
* Description &rArr; Description boutique
 +
* Short description &rArr; Description courte boutique
 +
* Tag/category &rArr; Category
 +
* Weigth (Kg) &rArr; Weight
 +
* Price &rArr; Price
 +
* En vente &rArr; Purchasable
 +
* Product finished type &rArr; Fixed at Manufactured
 +
* Min price &rArr; Price
 +
* Url &rArr; Permalink
 +
* Stock quantity &rArr; Stock quantity
  
 +
<br>
 +
'''Product Variation :'''
 +
* Product type &rArr; Service if set as "virtual"
 +
* UGS &rArr; Ref.
 +
* Name &rArr; Label
 +
* Description &rArr; empty
 +
* Weigth (Kg) &rArr;
 +
* Price &rArr;
 +
* Purchasable &rArr; to sell
 +
* Product finished type &rArr; Fixed at Manufactured
 +
* Price &rArr; Price
 +
* Permalink &rArr; URL
 +
* Stock quantity &rArr; Stock quantity
 +
Other fields are retrieved from the parents products.
 +
<br>
 +
Table <code>llx_ecommerce_product</code> is updated to remember the link between dolibarr product id and remote Woocommerce id<br>
 
|-
 
|-
| Thirdparties created || None. In a future version of the module, this will be created in Woocommerce if it belongs to the category of Woocommerce thirdparties (defined in setup) || There is no set up currently done in Woocommerce. In a future version of the module, the sync will happen in real time || <div style="color: #600">NA</div>
+
|rowspan="2"|'''Orders'''
 +
|style="color:#3C70A0;"|'''Dolibarr &rArr; WooCommerce'''
 +
|style="color:#3C70A0;"|Orders created in Dolibarr are '''NOT''' synchronized.
 +
Only modified status in Dolibarr will be updated on orders synchronized from WooCommerce (a link has to be present)
 +
|style="color:#3C70A0;"|Status synchronization (events <code>ORDER_MODIFY</code>, <code>ORDER_CLOSE</code> and <code>ORDER_CLASSIFY_BILLED</code>) :
 +
* Cancelled &rArr; cancelled;
 +
* Validated &rArr; pending;
 +
* Accepted & shipment on process &rArr; processing;
 +
* Closed &rArr; completed.
 
|-
 
|-
| Thirdparties modified into Dolibarr || The update in Woocommerce is done if the thirdparty belonged to Woocommerce (thirdparty was set up by a "Woocommerce to Dolibarr sync") || In real time || <div style="color: #060">Available</div><br>Informations concerned:<br>&nbsp;&nbsp;- Thirdparties (COMPANY_MODIFY event): Email
+
|style="color:#9B5C8F;"|'''WooCommerce &rArr; Dolibarr'''
 +
|style="color:#9B5C8F;"|They are also created in Dolibarr
 +
|style="color:#9B5C8F;"|'''Note >''' The orders created by another person than Customer user (Administrator, Anonymous, ...) are not created/modified
 +
'''Synchronized data''' :
 +
* Ref client &rArr; Id order in Woocommerce
 +
* Purchase order date &rArr; Created date in Woocommerce
 +
* Delivery date &rArr; Completed date in Woocommerce
 +
* Status
 +
** Pending  &rArr;  Validated,
 +
** On-hold & processing  &rArr;  Accepted,
 +
** Cancelled & Failed  &rArr;  Cancelled,
 +
** Completed & Refunded  &rArr;  Closed;
 +
* Payment status
 +
** Pending & processing & on-hold & cancelled & Failed  &rArr;  Not paid
 +
**Completed & Refunded  &rArr;  Paid
 +
* Private note &rArr; Customer's notes in Woocommerce
 +
* Product &rArr; Description (Name in Woocommerce);
 +
* Product type &rArr; Fixed at Simple
 +
* Price &rArr;
 +
* Quantity &rArr;
 +
* VAT rate (Calculated with total and total tax closed to VAT rate in Dolibarr) &rArr;  
 +
* Shipping line of the product (Displayed by default or ECOMMERCENG_SHIPPING_NOT_DISPLAY_IF_NULL)
 +
* Description &rArr; Shipping - ' & Shipping method title in Woocommerce if present
 +
* Price &rArr; Total shipping in Woocommerce
 +
* VAT rate (Calculated with shipping total and shipping tax closed to VAT rate in Dolibarr)||
 +
* Order address &rArr; Billing Contact/addresses in Thirdparties
 +
* Invoice address &rArr; Billing Contact/addresses in Thirdparties
 +
* Shipping address &rArr; Shipping Contact/addresses in Thirdparties
 +
Table <code>llx_ecommerce_order</code> is updated to remember the link of dolibarr order id and remote Woocommerce id
 
|-
 
|-
| Contacts/addresses created in Dolibarr || None. In a future version od the module, they will be created in Woocommerce if the thirdparty was set up as a category of Woocommerce thirdparties (defined into setup) || There is no set up currently done  in Woocommerce. In a future version of the module, the sync will happen in real time || <div style="color: #600">NA</div>
+
|rowspan="2"|'''Shipment'''
 +
|style="color:#3C70A0;"|'''Dolibarr &rArr; WooCommerce'''
 +
|style="color:#3C70A0;"|Shipments are created from orders in Dolibarr.
 +
|style="color:#3C70A0;"|Orders status are updated and synchronized in real time in WooCommerce (see above).
 
|-
 
|-
| Contacts/addresses modified in Dolibarr || The update into Woocommerce is done if the contact/address is linked to Woocommerce (contact/address was created by a "Woocommerce to Dolibarr sync") || In real time || <div style="color: #060">Available</div><br>Informations concerned:<br>&nbsp;&nbsp;- Contacts/addresses Billing (CONTACT_MODIFY event): Address 1 (First address row in Dolibarr), Address 2 (Next address row in Dolibarr), City (Town in Dolibarr), Postcode (Zip in Dolibarr), Country, Phone (Phone pro in Dolibarr)<br>&nbsp;&nbsp;- Contact/addresses Shipping (CONTACT_MODIFY event): Address 1 (First address row in Dolibarr), Address 2 (Next address row in Dolibarr), City (Town in Dolibarr), Postcode (Zip in Dolibarr), Country
+
|style="color:#9B5C8F;"|'''WooCommerce &rArr; Dolibarr'''
 +
|style="color:#9B5C8F;"|None
 +
|style="color:#9B5C8F;"|None
 
|-
 
|-
| Orders created (validated) in Dolibarr || None || || Orders are created directly in the backoffice, it's not necessary to appear in the ecommerce. See next cas below.
+
|rowspan="2"|'''Invoices'''
 +
|style="color:#3C70A0;"|'''Dolibarr &rArr; WooCommerce'''
 +
|style="color:#3C70A0;"|Invoices are created from shipments in Dolibarr.
 +
|
 
|-
 
|-
| Orders modified in Dolibarr || The Order will be updated in Woocommerce if it is  linked to Woocommerce (the order was created by a "Woocommerce to Dolibarr sync") || In real time || <div style="color: #060">Available</div><br>Informations concerned:<br>&nbsp;&nbsp;- Order (ORDER_MODIFY & ORDER_CLOSE & ORDER_CLASSIFY_BILLED events): Status (cancelled => cancelled, validated => pending, accepted & shipment on process => processing, closed => completed)
+
|style="color:#9B5C8F;"|'''WooCommerce &rArr; Dolibarr'''
 +
|style="color:#9B5C8F;"|None
 +
|style="color:#9B5C8F;"|None
 
|-
 
|-
| Shipments created (validated) in Dolibarr || Shipment will be created/modified in Woocommerce if the source order of shipment was created by a "Woocommerce to Dolibarr sync" || In real time || <div style="color: #600">NA</div>
 
|-
 
| Shipments modified (closed) in Dolibarr || The task is unavailable because there is no procedure in  Magento. ||  || <div style="color: #600">NA</div>
 
 
|-
 
| Invoices created (validated) in Dolibarr || None. In a future version of the module, the invoice will be created/modified in Woocommerce if the source order is rooted in  Woocommerce || There is no set up /update currently done in  Woocommerce. In a future version of the module, the sync will be happen in real time || <div style="color: #060">TODO</div>
 
|-
 
| Invoices modified in Dolibarr (When the  status of the bill updates into "paid", due to the payment) || None. In a future version of the module, the invoice will be created/modified into Woocommerce if the source order is rooted in Woocommerce || There is no set up /update currently done  in Woocommerce. In a future version of the module, the sync will happen in real time || <div style="color: #600">NA</div>
 
|-
 
| Stock of products  modified in Dolibarr (for any reason: the shipment is  processed, the order or invoice is validated, depending on the settings that were done in Dollibar in regards to change in the stock. The stock or inventory could be changed also manually)|| Stock is updated on Woocommerce if the product exists also in Woocommerce || In real time || <div style="color: #060">Available</div><br>Informations concerned:<br>&nbsp;&nbsp;- Stock (STOCK_MOVEMENT event): Stock quantity, In stock
 
 
|}
 
|}
 
= Development =
 
The development of this module is not included into the standard GIT repository of Dolibarr; but inside a dedicated repository, managed by Open-DSI.
 
* GIT Repository: https://github.com/OPEN-DSI/ecommerceng
 
 
= TroubleShooting =
 
 
To be defined...
 

Revision as of 20:15, 1 March 2018

Retour index
Documentation développeur

File Doc dev.png

Return to user
documentation index

File Doc user.png

<keywords content="Woocommerce, Dolibarr, synchro, synch, interface"/>

Overview

Module Name WooSync
Editor / Editeur Open-DSI
Download or buy page / Page achat ou téléchargement
Status / Statut / Estado Stable
Prerequisites / Prérequis
  • Dolibarr min version 4.x
  • Woocomerce min version 3.x
Last update date / Date mise à jour fiche / Fecha última actualización 2018-03-1
Note / Nota WooSync is a fork of EcommerceNG developed by TecLib

Feature/Plugin

WooSync synchronizes data between WooCommerce and Dolibarr : thirdparties and contacts, products, orders... automatically from Dolibarr to WooCommerce and manually from WooCommerce to Dolibarr.

Development

The development of this module is not included into the standard GIT repository of Dolibarr; but inside a dedicated repository, managed by Open-DSI.

Installation

WooSync module has to be installed in your Dolibarr directory htdocs/custom to work properly. To connect to Woocommerce app, Dolibarr uses by default Woocommerce's WebServices (REST API v2).

Dolibarr module

  • Download the archive file of module (.zip file)
  • Unzip the folder into the htdocs/custom directory of your Dolibarr.
  • Module is then visible into list of available modules (Home > Setup > Modules/applications) and can be activated.

Setup on Woocomerce side

  • The option Enable guest checkout had better be disabled;
  • The New User Default Role has to be set on "Client";
  • WooSync has been tested without any other application than WP Oauth server and WP Mail SMTP by WPForms.

Setup on Dolibarr side

From Home > Setup > Other, hidden rules can be enabled :

  • ECOMMERCENG_DISABLE_LOG_IN_NOTE at 1 to disable the log in the private note of orders from WooCommerce in Dolibarr;
  • ECOMMERCENG_SHOW_DEBUG_TOOLS at 1 to show init/purge/debug tools into site page;
  • ECOMMERCENG_DISABLED_ERROR_FOR_SOCIETE_ID_0 at 1 to disable the error at the creation of an order when societe id = 0 (administrator, anonymous, ...);
  • ECOMMERCENG_SHOW_DEBUG_TOOLS at 1 to display debug options;
  • ECOMMERCE_WOOCOMMERCE_DEFAULT_TVA at 1 to set default TVA rate to use;
  • ECOMMERCENG_ENABLED_SYNCHRONIZE_IMAGES_PRODUCT_BUTTON at 1 to display the button to force picture synchronization on lnked files tab of product card;
  • ECOMMERCENG_WOOCOMMERCE_DISABLED_SYNCHRO_IMAGE at 1 to prevent picture synchronization;
  • ECOMMERCENG_SHIPPING_NOT_DISPLAY_IF_NULL at 1 not to display free shipping fees on Dolibar orders.

Items Synchronization between Dolibarr and WooCommerce

The WooCommerce ⇒ Dolibarr synchronization is made by a manual operation : It requires the user to click on "Woocommerce to Dolibarr sync" button.

The Dolibarr ⇒ WooCommerce synchronization is made in real time. No manual operation is required.

Items Synchronization Action Comment
Categories

(thirdparties & products/services)

Dolibarr ⇒ WooCommerce None In a future version, categories created in Dolibarr will be synchronized in WooCommerce
WooCommerce ⇒ Dolibarr They are synchronized as sub-categories of the parent category declared in Dolibarr (WooCommerce module settings) Table llx_ecommerce_category is updated to save the link between Dolibarr category id and remote WooCommerce id.

Warning > Due to the fact that there is no option to search the last modified categories, their synchronization might be slown down by the high number of categories.

Thirdparties & contacts Dolibarr ⇒ WooCommerce None
WooCommerce ⇒ Dolibarr Thirdparties are created in Dolibarr as customers in the category declared in the module setting page. Shipping and billing addresses are created as contacts. WooSync checks email adresses before creating a new thirdparty. Synchronized data :
  • Company Name (if filled in, thirdparty name. If not, thirdparty is created as a contact)
  • Lastname
  • firstname
  • Adress
  • ZIP
  • Town
Products / Services Dolibarr ⇒ WooCommerce Products are synchronized in real time if they are linked to the ecommerce category declared in the module setup.

Pictures are synchronized in real time. Several rules can be enabled (See above : "Setup on Dolibarr side").

Synchronized data :
  • Product (event PRODUCT_MODIFY)
    • Réf. ⇒ UGS;
    • Label ⇒ Name;
    • Status (published (for sale) or pending);
    • Description ⇒ empty;
    • Description boutique ⇒ Description;
    • Description courte boutique ⇒ Short description;
    • Price ⇒ Régular price;
    • Weigth (Kg)
    • Stock quantity;
    • In stock
  • Product Variant

We recommand to create variant in WooCommerce.

WooCommerce ⇒ Dolibarr They are set up in Dolibarr and linked to the category declared in the module setup.

If the module Suppliers is enabled and Stock synchronization direction is set on Ecommerce to Dolibarr, products will be initialised/updated in the warehouse defined in the WooSync module setup in Dolibarr.

Variants have to be created in WooCommerce. They will be synchronized as product/services in Dolibarr.

Synchronized data :
  • Product type ⇒ Product or Service if set as "virtual"
  • UGS ⇒ Ref.

Note > It requires the activation of 'Elephant' code generator in Dolibarr module Products/services

  • Name ⇒ Label
  • Description ⇒ empty
  • Statut pour le site "boutique_wordpress" ⇒ Status
  • Description ⇒ Description boutique
  • Short description ⇒ Description courte boutique
  • Tag/category ⇒ Category
  • Weigth (Kg) ⇒ Weight
  • Price ⇒ Price
  • En vente ⇒ Purchasable
  • Product finished type ⇒ Fixed at Manufactured
  • Min price ⇒ Price
  • Url ⇒ Permalink
  • Stock quantity ⇒ Stock quantity


Product Variation :

  • Product type ⇒ Service if set as "virtual"
  • UGS ⇒ Ref.
  • Name ⇒ Label
  • Description ⇒ empty
  • Weigth (Kg) ⇒
  • Price ⇒
  • Purchasable ⇒ to sell
  • Product finished type ⇒ Fixed at Manufactured
  • Price ⇒ Price
  • Permalink ⇒ URL
  • Stock quantity ⇒ Stock quantity

Other fields are retrieved from the parents products.
Table llx_ecommerce_product is updated to remember the link between dolibarr product id and remote Woocommerce id

Orders Dolibarr ⇒ WooCommerce Orders created in Dolibarr are NOT synchronized.

Only modified status in Dolibarr will be updated on orders synchronized from WooCommerce (a link has to be present)

Status synchronization (events ORDER_MODIFY, ORDER_CLOSE and ORDER_CLASSIFY_BILLED) :
  • Cancelled ⇒ cancelled;
  • Validated ⇒ pending;
  • Accepted & shipment on process ⇒ processing;
  • Closed ⇒ completed.
WooCommerce ⇒ Dolibarr They are also created in Dolibarr Note > The orders created by another person than Customer user (Administrator, Anonymous, ...) are not created/modified

Synchronized data :

  • Ref client ⇒ Id order in Woocommerce
  • Purchase order date ⇒ Created date in Woocommerce
  • Delivery date ⇒ Completed date in Woocommerce
  • Status
    • Pending ⇒ Validated,
    • On-hold & processing ⇒ Accepted,
    • Cancelled & Failed ⇒ Cancelled,
    • Completed & Refunded ⇒ Closed;
  • Payment status
    • Pending & processing & on-hold & cancelled & Failed ⇒ Not paid
    • Completed & Refunded ⇒ Paid
  • Private note ⇒ Customer's notes in Woocommerce
  • Product ⇒ Description (Name in Woocommerce);
  • Product type ⇒ Fixed at Simple
  • Price ⇒
  • Quantity ⇒
  • VAT rate (Calculated with total and total tax closed to VAT rate in Dolibarr) ⇒
  • Shipping line of the product (Displayed by default or ECOMMERCENG_SHIPPING_NOT_DISPLAY_IF_NULL)
  • Description ⇒ Shipping - ' & Shipping method title in Woocommerce if present
  • Price ⇒ Total shipping in Woocommerce
  • VAT rate (Calculated with shipping total and shipping tax closed to VAT rate in Dolibarr)||
  • Order address ⇒ Billing Contact/addresses in Thirdparties
  • Invoice address ⇒ Billing Contact/addresses in Thirdparties
  • Shipping address ⇒ Shipping Contact/addresses in Thirdparties

Table llx_ecommerce_order is updated to remember the link of dolibarr order id and remote Woocommerce id

Shipment Dolibarr ⇒ WooCommerce Shipments are created from orders in Dolibarr. Orders status are updated and synchronized in real time in WooCommerce (see above).
WooCommerce ⇒ Dolibarr None None
Invoices Dolibarr ⇒ WooCommerce Invoices are created from shipments in Dolibarr.
WooCommerce ⇒ Dolibarr None None