Difference between revisions of "Module Woocommerce EN"

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
(Change Magento in Woocommerce)
m
Tag: 2017 source edit
 
(35 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
[[Category:Woocommerce]]
 
[[Category:Woocommerce]]
 
[[Category:E-commerce]]
 
[[Category:E-commerce]]
{{TemplateDocDev}}
 
 
{{TemplateDocUser}}
 
{{TemplateDocUser}}
<keywords content="Woocommerce, Dolibarr, synchro, synch, interface" />
+
{{TemplateModEN}}
= Informations =
 
{{TemplateModuleInfo
 
|modulename=Woocommerce
 
|editor=Teclib
 
|web=[http://www.teclib.com www.teclib.com]
 
|webbuy={{LinkToPluginDownloadDoliStore|keyword=Woocomerce}}
 
|status=development
 
|prerequisites=
 
|minversion=3.9.0+
 
Woocomerce version 2.7+
 
|note=
 
}}
 
  
= Features =
+
<seo metak="Woocommerce, Dolibarr, synchro, synch, interface"/>
 +
= Overview =
 +
{| border="0" width="100%" cellpadding="0" cellspacing="0" class="dolbox"
 +
|-
 +
|valign="top" style="max-width: 200px" | Module Name ||WooSync
 +
|-
 +
|| Editor / Editeur ||[https://www.open-dsi.fr Open-DSI]
 +
|-
 +
|| Download or buy page / Page achat ou téléchargement||
 +
* [https://www.dolistore.com/fr/modules/851-Woosync.html dolistore]<br>
 +
* [https://www.open-dsi.fr/produit/souscription-annuelle-woosync/ boutique open-dsi]
 +
|-
 +
|| 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
 +
|}
  
Integrates a Woocommerce - Dolibarr synchronyzation. It is a module to be installed in Dolibarr.
+
= Feature/Plugin =
Access to Woocommerce is done by dolibarr using default Woocommerce's WebServices.
+
WooSync synchronizes data between WooCommerce and Dolibarr : thirdparties and contacts, products, orders... automatically from Dolibarr to WooCommerce and manually from WooCommerce to Dolibarr.
  
WARNING : Actually this module is under developpement and use the same core as Module Woocomerce
+
= 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
  
 
= 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 ==
= Usage=
+
From <span style="font-variant: small-caps;">Home > Setup > Other</span>, hidden rules can be enabled :
To be defined
+
* <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.
 +
 
 +
=Items Synchronization between Dolibarr and WooCommerce=
 +
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.
  
== Synchronize from Woocommerce to Dolibarr ==
+
The <span style="color:#3C70A0;">'''Dolibarr &rArr; WooCommerce'''</span> synchronization is made '''in real time'''. No manual operation is required.
  
{|class="wikitable sortable"
+
{| class="wikitable"  
|-
+
!Items||Synchronization||Action||Comment
!Action into Woocomerce !! Effect into Dolibarr !! When !! Note
 
 
|-
 
|-
|Categories created/modified into Woocomerce || Created into Dolibarr as sub-categories of the parent category used for Mangeto categories (defined into module setup) || Manual click on "Woocomerce to Dolibarr sync" button || <div style="color: #600">NA</div>Table llx_ecommerce_category is updated to store a link between dolibarr category id and remote Woocomerce id. Due to a lack of search on last modified time on Woocomerce API, this sync may be slow if you have a high number of categories
+
|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''
 
|-
 
|-
| Products or Stock created/modified into Woocomerce || Created into Dolibarr and linked to its categories.<br>If module stock is enabled and '''Stock synchronisation direction''' was set to "ecommerce2dolibarr", stock is also initialised/updated into warehouse defined into eCommerce dolibarr module setup || Manual click on "Woocomerce to Dolibarr sync" button || <div style="color: #060">TODO</div>Table llx_ecommerce_product is updated to store a link between dolibarr product id and remote Woocomerce id
+
|style="color:#9B5C8F;"|'''WooCommerce &rArr; Dolibarr'''
 +
|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.
 
|-
 
|-
| Thirdparties and contact/addresses created/modified into Woocomerce || Created into Dolibarr || Manual click on "Woocomerce to Dolibarr sync" button || <div style="color: #060">TODO</div>Table llx_ecommerce_societe and llx_ecommerce_socpeople is updated to store a link between dolibarr thirdparty id and remote Woocomerce id. To know if a thirdparty already exists, Woocomerce check on the ref. To know if a contact already exists, Woocomerce check on all fields firstname, lastname, address, zip, town (and thirdparty).
+
|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'' -->
 
|-
 
|-
| Orders created/modified into Woocomerce || Created into Dolibarr || Manual click on "Woocomerce to Dolibarr sync" button || <div style="color: #060">TODO</div>Table llx_ecommerce_commande is updated to store link of dolibarr order id and remote Woocomerce id
+
|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''' :
 +
* Company Name (if filled in, thirdparty name. If not, thirdparty is created as a contact)
 +
* Lastname
 +
* firstname
 +
* Adress
 +
* ZIP
 +
* Town
 
|-
 
|-
| Shipment created/modified in Woocomerce || Creating a shipment in Woocomerce is changing Woocomerce status of the Order from "pending" to "processing". Because it is changing status of order, see case "Order created/modified into Woocomerce". || Manual click on "Woocomerce to Dolibarr sync" button ||<div style="color: #600">NA</div>''Note:'' The shipment is not downloaded into Dolibarr, only status of Dolibarr Order will be changed like is the Woocomerce order.<br>''Note:'' You may choose to manage shipment on Dolibarr or Woocomerce (we recommand to create/update shipments on Dolibarr and not into Woocomerce).
+
|rowspan="2"|'''Products / Services'''
|-
+
|style="color:#3C70A0;"|'''Dolibarr &rArr; WooCommerce'''
| Invoices created/modified into Woocomerce || Created into Dolibarr (with correct status but without payments) || Manual click on "Woocomerce to Dolibarr sync" button || <div style="color: #600">NA</div>Table llx_ecommerce_facture is updated to store a link between dolibarr invoice id and remote Woocomerce id.<br>''Note:'' Payment must still be recorded manually on Dolibarr.
+
|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.
  
 +
Variants have to be created in WooCommerce. They will be synchronized as product/services in Dolibarr.
  
TODO In a future version, the "Woocomerce to Dolibarr sync" button could be replaced with a scheduled job/script to launch it automaticaly every hour for example.
+
|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
  
== Synchronize from Dolibarr to Woocomerce ==
+
<br>
 
+
'''Product Variation :'''
Synchronizing is done in real time.
+
* Product type &rArr; Service if set as "virtual"
 
+
* UGS &rArr; Ref.
{|class="wikitable sortable"
+
* 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>
 
|-
 
|-
!Action into Dolibarr !! Effect into Woocomerce !! When !! Note
+
|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.
 
|-
 
|-
| Categories created into Dolibarr || No update is currently done on Woocomerce. In a future version, creation will be done into Woocomerce if category is inside the parent category for Woocomerce, defined into module setup || No creation/update is currently done on Woocomerce. In a future version, sync will be in real time || <div style="color: #600">NA</div>
+
|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
 
|-
 
|-
| Categories modified into Dolibarr || No update is currently done on Woocomerce. In a future version, update will be done into Woocomerce if category is linked to Woocomerce (category was created by a "Woocomerce to Dolibarr sync") || No creation/update is currently done on Woocomerce. In a future version, sync will be 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).
 
|-
 
|-
| Products created into Dolibarr || None. In a future, creation will be done into Woocomerce if product has a category inside tree of Woocomerce categories || No creation is currently done on Woocomerce. In a future version, sync will be in real time ||<div style="color: #060">TODO</div>
+
|style="color:#9B5C8F;"|'''WooCommerce &rArr; Dolibarr'''
 +
|style="color:#9B5C8F;"|None
 +
|style="color:#9B5C8F;"|None
 
|-
 
|-
| Products or Stock modified into Dolibarr || Update into Woocomerce is done if product is linked to Woocomerce (product was created by a "Woocomerce to Dolibarr sync")<br>If module stock is enabled and '''Stock synchronisation direction''' was set to "dolibarr2ecommerce", then stock is also overwritten on Woocomerce|| Real time || <div style="color: #060">TODO</div>
+
|rowspan="2"|'''Invoices'''
 +
|style="color:#3C70A0;"|'''Dolibarr &rArr; WooCommerce'''
 +
|style="color:#3C70A0;"|Invoices are created from shipments in Dolibarr.
 +
|
 
|-
 
|-
| Thirdparties created || None. In a future version, creation will be done into Woocomerce if thirdparty has the category of Woocomerce thirdparties (defined into setup) || No creation is currently done on MaWoocomerceento. In a future version, sync will be in real time || <div style="color: #600">NA</div>
+
|style="color:#9B5C8F;"|'''WooCommerce &rArr; Dolibarr'''
 +
|style="color:#9B5C8F;"|None
 +
|style="color:#9B5C8F;"|None
 
|-
 
|-
| Thirdparties modified into Dolibarr || Update into Woocomerce is done if thirdparty is linked to Woocomerce (thirdparty was created by a "Woocomerce to Dolibarr sync") || Real time || <div style="color: #600">NA</div>
 
|-
 
| Contact/addresses created into Dolibarr || None. In a future version, creation will be done into Woocomerce if thirdparty has the category of Woocomerce thirdparties (defined into setup) || No creation is currently done on Woocomerce. In a future version, sync will be in real time || <div style="color: #600">NA</div>
 
|-
 
| Contact/addresses modified into Dolibarr || Update into Woocomerce is done if contact/address is linked to Woocomerce (contact/address was created by a "Woocomerce to Dolibarr sync") || Real time || <div style="color: #600">NA</div>
 
|-
 
| Orders created (validated) into Dolibarr || None ||  || Orders created directly into backoffice does not need to appear into ecommerce. See next line for Orders modified.
 
|-
 
| Orders modified into Dolibarr || Order will be updated into Woocomerce if order is linked to Woocomerce (order was created by a "Woocomerce to Dolibarr sync") || No update is currently done on Woocomerce. In a future version, sync will be in real time || <div style="color: #060">TODO</div>
 
|-
 
| Shipments created (validated) into Dolibarr || Shipment will be created/modified into Woocomerce if source order of shipment was created by a "Woocomerce to Dolibarr sync" || Real time || <div style="color: #600">NA</div>
 
|-
 
| Shipments modified (closed) into Dolibarr || This step does not exists on Mangento, so nothing is done ||  || <div style="color: #600">NA</div>
 
|-
 
| Invoice created (validated) into Dolibarr || None. In a future, invoice will be created/modified into Woocomerce if source order was coming from Woocomerce || No creation/update is currently done on Woocomerce. In a future version, sync will be in real time || <div style="color: #060">TODO</div>
 
|-
 
| Invoice modified into Dolibarr (for exemple when status change to paid because of a payment entered) || None. In a future, invoice will be created/modified into Woocomerce if source order was coming from Woocomerce || No creation/update is currently done on Woocomerce. In a future version, sync will be in real time || <div style="color: #600">NA</div>
 
|-
 
| Stock of a product modified into Dolibarr (whatever is reason: shipment processed, order or invoice validated, depending on your Dolibarr setup of the stock change rule, manuel change of stock or inventory)|| Stock is updated on Woocomerce if product exists also in Woocomerce || Real time ||  <div style="color: #060">TODO</div>
 
 
|}
 
|}
 
= Development =
 
{{TemplateModTeclibEn}}
 
 
 
= TroubleShooting =
 
Due to a problem in Woocomerce, if you have a large number of product categories, you may experience low performance when counting data to synchronize and making a synchronize.
 
This is how you can fix this:
 
 
On Woocomerce side, edit the file '''app/code/core/Mage/Catalog/Model/Category/Api.php''' to add the line visible into comment
 
 
<source lang="php">
 
 
    ...
 
 
    /**
 
    * Convert node to array
 
    *
 
    * @param Varien_Data_Tree_Node $node
 
    * @return array
 
    */
 
    protected function _nodeToArray(Varien_Data_Tree_Node $node)
 
    {
 
        // Only basic category data
 
        $result = array();
 
        $result['category_id'] = $node->getId();
 
        $result['parent_id']  = $node->getParentId();
 
        $result['name']        = $node->getName();
 
        $result['is_active']  = $node->getIsActive();
 
        $result['position']    = $node->getPosition();
 
        $result['level']      = $node->getLevel();
 
 
/* LDR Add here this new line to add the missing property returned by web service */
 
$result['updated_at']  = $node->getUpdatedAt();
 
 
        $result['children']    = array();
 
 
        foreach ($node->getChildren() as $child) {
 
            $result['children'][] = $this->_nodeToArray($child);
 
        }
 
 
        return $result;
 
    }
 
 
    ...
 
 
</lang>
 

Latest revision as of 16:21, 3 January 2024

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 2024-01-3
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