Difference between revisions of "Module Woocommerce EN"

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
(Change Magento in Woocommerce)
Line 10: Line 10:
 
|editor=Teclib
 
|editor=Teclib
 
|web=[http://www.teclib.com www.teclib.com]
 
|web=[http://www.teclib.com www.teclib.com]
|webbuy={{LinkToPluginDownloadDoliStore|keyword=magento}}
+
|webbuy={{LinkToPluginDownloadDoliStore|keyword=Woocomerce}}
 
|status=development
 
|status=development
 
|prerequisites=
 
|prerequisites=
 
|minversion=3.9.0+
 
|minversion=3.9.0+
Magento version 1.9+
+
Woocomerce version 2.7+
 
|note=
 
|note=
 
}}
 
}}
Line 23: Line 23:
 
Access to Woocommerce is done by dolibarr using default Woocommerce's WebServices.
 
Access to Woocommerce is done by dolibarr using default Woocommerce's WebServices.
  
WARNING : Actually this module is under developpement and use the same core as Module Magento
+
WARNING : Actually this module is under developpement and use the same core as Module Woocomerce
  
 
= Installation =
 
= Installation =
Line 48: Line 48:
 
!Action into Woocomerce !! Effect into Dolibarr !! When !! Note
 
!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 "Magento 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 magento id. Due to a lack of search on last modified time on Magento API, this sync may be slow if you have a high number of categories
+
|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
 
|-
 
|-
| Products or Stock created/modified into Magento || 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 "Magento 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 magento id
+
| 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
 
|-
 
|-
| Thirdparties and contact/addresses created/modified into Magento || Created into Dolibarr || Manual click on "Magento 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 magento id. To know if a thirdparty already exists, Magento check on the ref. To know if a contact already exists, Magento check on all fields firstname, lastname, address, zip, town (and thirdparty).
+
| 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).
 
|-
 
|-
| Orders created/modified into Magento || Created into Dolibarr || Manual click on "Magento 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 magento id
+
| 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
 
|-
 
|-
| Shipment created/modified in Magento || Creating a shipment in Magento is changing Magento status of the Order from "pending" to "processing". Because it is changing status of order, see case "Order created/modified into Magento". || Manual click on "Magento 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 Magento order.<br>''Note:'' You may choose to manage shipment on Dolibarr or Magento (we recommand to create/update shipments on Dolibarr and not into Magento).
+
| 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).
 
|-
 
|-
| Invoices created/modified into Magento || Created into Dolibarr (with correct status but without payments) || Manual click on "Magento 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 magento id.<br>''Note:'' Payment must still be recorded manually on Dolibarr.
+
| 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.
 
|}
 
|}
  
  
TODO In a future version, the "Magento to Dolibarr sync" button could be replaced with a scheduled job/script to launch it automaticaly every hour for example.
+
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.
  
== Synchronize from Dolibarr to Magento ==
+
== Synchronize from Dolibarr to Woocomerce ==
  
 
Synchronizing is done in real time.
 
Synchronizing is done in real time.
Line 70: Line 70:
 
{|class="wikitable sortable"
 
{|class="wikitable sortable"
 
|-
 
|-
!Action into Dolibarr !! Effect into Magento !! When !! Note
+
!Action into Dolibarr !! Effect into Woocomerce !! When !! Note
 
|-
 
|-
| Categories created into Dolibarr || No update is currently done on Magento. In a future version, creation will be done into Magento if category is inside the parent category for Magento, defined into module setup || No creation/update is currently done on Magento. In a future version, sync will be in real time || <div style="color: #600">NA</div>
+
| 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>
 
|-
 
|-
| Categories modified into Dolibarr || No update is currently done on Magento. In a future version, update will be done into Magento if category is linked to Magento (category was created by a "Magento to Dolibarr sync") || No creation/update is currently done on Magento. In a future version, sync will be in real time || <div style="color: #600">NA</div>
+
| 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>
 
|-
 
|-
| Products created into Dolibarr || None. In a future, creation will be done into Magento if product has a category inside tree of Magento categories || No creation is currently done on Magento. In a future version, sync will be in real time ||<div style="color: #060">TODO</div>
+
| 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>
 
|-
 
|-
| Products or Stock modified into Dolibarr || Update into Magento is done if product is linked to Magento (product was created by a "Magento to Dolibarr sync")<br>If module stock is enabled and '''Stock synchronisation direction''' was set to "dolibarr2ecommerce", then stock is also overwritten on Magento|| Real time || <div style="color: #060">TODO</div>
+
| 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>
 
|-
 
|-
| Thirdparties created || None. In a future version, creation will be done into Magento if thirdparty has the category of Magento thirdparties (defined into setup) || No creation is currently done on Magento. In a future version, sync will be in real time || <div style="color: #600">NA</div>
+
| 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>
 
|-
 
|-
| Thirdparties modified into Dolibarr || Update into Magento is done if thirdparty is linked to Magento (thirdparty was created by a "Magento to Dolibarr sync") || Real time || <div style="color: #600">NA</div>
+
| 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 Magento if thirdparty has the category of Magento thirdparties (defined into setup) || No creation is currently done on Magento. In a future version, sync will be in 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 Magento is done if contact/address is linked to Magento (contact/address was created by a "Magento to Dolibarr sync") || 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 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 Magento if order is linked to Magento (order was created by a "Magento to Dolibarr sync") || No update is currently done on Magento. In a future version, sync will be in real time || <div style="color: #060">TODO</div>
+
| 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 Magento if source order of shipment was created by a "Magento to Dolibarr sync" || Real time || <div style="color: #600">NA</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>
 
| 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 Magento if source order was coming from Magento || No creation/update is currently done on Magento. In a future version, sync will be in real time || <div style="color: #060">TODO</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 Magento if source order was coming from Magento || No creation/update is currently done on Magento. In a future version, sync will be in real time || <div style="color: #600">NA</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 Magento if product exists also in Magento || Real time ||  <div style="color: #060">TODO</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>
 
|}
 
|}
  
Line 108: Line 108:
  
 
= TroubleShooting =
 
= TroubleShooting =
Due to a problem in Magento, if you have a large number of product categories, you may experience low performance when counting data to synchronize and making a synchronize.
+
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:
 
This is how you can fix this:
  
On magento side, edit the file '''app/code/core/Mage/Catalog/Model/Category/Api.php''' to add the line visible into comment
+
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">
 
<source lang="php">

Revision as of 15:41, 6 March 2017

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

Informations

Module name Woocommerce
Editor / Editeur Teclib - www.teclib.com
Download or buy page / Page achat ou téléchargement External module - www.dolistore.com
Status / Statut / Estado Development / Développement
Prerequisites / Prérequis

Dolibarr min version: See on Dolistore    Dolibarr max version: See on Dolistore

Last update date / Date mise à jour fiche / Fecha última actualización 2017-03-6
Note / Nota

Features

Integrates a Woocommerce - Dolibarr synchronyzation. It is a module to be installed in Dolibarr. Access to Woocommerce is done by dolibarr using default Woocommerce's WebServices.

WARNING : Actually this module is under developpement and use the same core as Module Woocomerce

Installation

Woocommerce

To be defined

Dolibarr module

From the application

  • Download the archive file of module (.zip file)
  • Go on menu Home -> Setup -> Modules -> Deploy external module and submit the file.
  • Module is then visible into list of available modules (Home -> Setup -> Modules) and can be activated.

Manually

  • Download the archive file of module (.zip file)
  • Put the file into the root directory of Dolibarr.
  • Uncompress the archive file, for example with command
unzip modulefile.zip
  • Module is then visible into list of available modules (Home -> Setup -> Modules) and can be activated.

Setup

To use this module, you must first enable it using an administrator account, via the menu option "Home - Setup - Modules".

Choose the tab where the module is listed. Then click on "Activate".

The module is now activated.

If a cog icon appears Cog circle.svg on module thumb or at end of the line of the module, click on it to access the setup page specific to the module.

Setup on Woocomerce side

To be defined

Setup on Dolibarr side

Usage

To be defined

Synchronize from Woocommerce to Dolibarr

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
NA
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
Products or Stock created/modified into Woocomerce Created into Dolibarr and linked to its categories.
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
TODO
Table llx_ecommerce_product is updated to store a link between dolibarr product id and remote Woocomerce id
Thirdparties and contact/addresses created/modified into Woocomerce Created into Dolibarr Manual click on "Woocomerce to Dolibarr sync" button
TODO
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).
Orders created/modified into Woocomerce Created into Dolibarr Manual click on "Woocomerce to Dolibarr sync" button
TODO
Table llx_ecommerce_commande is updated to store link of dolibarr order id and remote Woocomerce id
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
NA
Note: The shipment is not downloaded into Dolibarr, only status of Dolibarr Order will be changed like is the Woocomerce order.
Note: You may choose to manage shipment on Dolibarr or Woocomerce (we recommand to create/update shipments on Dolibarr and not into Woocomerce).
Invoices created/modified into Woocomerce Created into Dolibarr (with correct status but without payments) Manual click on "Woocomerce to Dolibarr sync" button
NA
Table llx_ecommerce_facture is updated to store a link between dolibarr invoice id and remote Woocomerce id.
Note: Payment must still be recorded manually on 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.

Synchronize from Dolibarr to Woocomerce

Synchronizing is done in real time.

Action into Dolibarr Effect into Woocomerce When Note
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
NA
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
NA
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
TODO
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")
If module stock is enabled and Stock synchronisation direction was set to "dolibarr2ecommerce", then stock is also overwritten on Woocomerce
Real time
TODO
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
NA
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
NA
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
NA
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
NA
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
TODO
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
NA
Shipments modified (closed) into Dolibarr This step does not exists on Mangento, so nothing is done
NA
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
TODO
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
NA
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
TODO

Development

Development of this module is not included into standard GIT repository of Dolibarr but inside a dedicated repository managed by TecLib.


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>