Module Woocommerce EN

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search

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

Overview

Module name Woocommerce
Editor / Editeur Open-DSI continues the work of Teclib
Download or buy page / Page achat ou téléchargement
Status / Statut / Estado Development / Développement
Prerequisites / Prérequis

Dolibarr min version: 4.0.0+ Woocomerce version 3.x+    Dolibarr max version: {{{maxversion}}}

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

Feature/Plugin

The Woocommerce module must be installed on your Dolibarr instance (htdocs/custom) to work properly. To access Woocommerce Dolibarr is using using default Woocommerce's WebServices (REST API v2). Warning: The module in still in developpement stage and it uses the same core as Module ECommerce NG (Magento) EN.

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

Setup > Other setup:

ECOMMERCENG_DISABLE_LOG_IN_NOTE => 1 (Disable the log in the private note)
ECOMMERCENG_DISABLE_MAGENTO_PRICE_TYPE => 1 (Disable the price type managment for magento)
ECOMMERCENG_BILLING_CONTACT_NAME => 'Choose your Billing contact/address name' (Set name for the billing contact/address)
ECOMMERCENG_SHIPPING_CONTACT_NAME => 'Choose your Shipping contact/address name' (Set name for shipping contact/address)
ECOMMERCENG_SHOW_DEBUG_TOOLS => 0 (Show init/purge/debug tools into site page)
ECOMMERCENG_DISABLED_ERROR_FOR_SOCIETE_ID_0 => 1 (Disable error for the creation of an order when societe id = 0 (Administrator, anonymous, ...))

Usage

To be defined

== The consequences in Dolibarr due to changes in Woocommerce

Actions in Woocommerce Changements in Dolibarr When Note
Create/modify categories in Woocommerce They are changing in Dolibarr into sub-categories of the parent categorie, used for Mageto categories (defined in the module setup) Clicking on "Woocommerce to Dolibarr sync" button
NA
Table llx_ecommerce_category is updated to store a link between dolibarr category id and remote Woocommerce id. Due to the fact that there is no option to search for the the last categories that were modified, over time, this sync might be slow down if you have a high number of categories
Products or Stock created/modified into Woocommerce Created into Dolibarr (and linked to its categories NA).
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 "Woocommerce to Dolibarr sync" button
Available
Table llx_ecommerce_product is updated to store a link between dolibarr product id and remote Woocommerce id

Informations concerned:
  - Product : 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 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
  - 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
Thirdparties and contact/addresses created/modified into Woocommerce Created into Dolibarr Manual click on "Woocommerce to Dolibarr sync" button
Available
Table llx_ecommerce_societe and llx_ecommerce_socpeople is updated to store a link between dolibarr thirdparty id and remote Woocommerce id. To know if a thirdparty already exists, Woocommerce check on the ref. To know if a contact already exists, Woocommerce check on all fields firstname, lastname, address, zip, town (and thirdparty).

Informations concerned:
  - Thirdparties : Name (First name & Last Name), Email, Type client (Fixed at Client/Prospect)
  - 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
  - Contact/addresses - Shipping (If not set, set from billing address): Type (Fixed at Delivery), Name and last name ('Shipping' by default or ECOMMERCENG_SHIPPING_CONTACT_NAME), Address (Address 1 & Address 2), City, Postcode, Country
Orders created/modified into Woocommerce Created into Dolibarr Manual click on "Woocommerce to Dolibarr sync" button
Available
Table llx_ecommerce_commande is updated to store link of dolibarr order id and remote Woocommerce id

Informations concerned:
  Order created by Other than Customer user (Administrator, Anonymous, ...) is not created/modified
  - Order: Ref client (Id order in Woocommerce), Date commande (Created date in Woocommerce), Delivery date (Completed date in Woocommerce), Status (pending => Validated, on-hold & processing => Accepted, cancelled & Failed => Cancelled, Completed & Refunded => Closed), Billed status (pending & processing & on-hold & cancelled & Failed => Not paid, Completed & Refunded => Paid), Private note (Customer note in Woocommerce)
  - Item: 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 into item (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
Shipment created/modified in Woocommerce Creating a shipment in Woocommerce is changing Woocommerce status of the Order from "pending" to "processing". Because it is changing status of order, see case "Order created/modified into Woocommerce". Manual click on "Woocommerce to Dolibarr sync" button
NA
Note: The shipment is not downloaded into Dolibarr, only status of Dolibarr Order will be changed like is the Woocommerce order.
Note: You may choose to manage shipment on Dolibarr or Woocommerce (we recommand to create/update shipments on Dolibarr and not into Woocommerce).
Invoices created/modified into Woocommerce Created into Dolibarr (with correct status but without payments) Manual click on "Woocommerce to Dolibarr sync" button
NA
Table llx_ecommerce_facture is updated to store a link between dolibarr invoice id and remote Woocommerce id.
Note: Payment must still be recorded manually on Dolibarr.


TODO In a future version, the "Woocommerce 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 Woocommerce is done if product is linked to Woocommerce (product was created by a "Woocommerce to Dolibarr sync")
If module stock is enabled and Stock synchronisation direction was set to "dolibarr2ecommerce", then stock is also overwritten on Woocommerce
Real time
Available

Informations concerned:
  - Product (PRODUCT_MODIFY event): Name (Label in Dolibarr), Status (publish (en vente) or pending), Description, UGS (Ref in Dolibarr), Regular price (Price in Dolibarr), Weigth (Kg)
  - Product Variation (PRODUCT_MODIFY event): Description, UGS (Ref in Dolibarr), Regular price (Price in Dolibarr), Weigth (Kg)
  - Stock (STOCK_MOVEMENT event): Stock quantity, In stock
Thirdparties created None. In a future version, creation will be done into Woocommerce if thirdparty has the category of Woocommerce thirdparties (defined into setup) No creation is currently done on MaWoocommerceento. In a future version, sync will be in real time
NA
Thirdparties modified into Dolibarr Update into Woocommerce is done if thirdparty is linked to Woocommerce (thirdparty was created by a "Woocommerce to Dolibarr sync") Real time
Available

Informations concerned:
  - Thirdparties (COMPANY_MODIFY event): Email
Contact/addresses created into Dolibarr None. In a future version, creation will be done into Woocommerce if thirdparty has the category of Woocommerce thirdparties (defined into setup) No creation is currently done on Woocommerce. In a future version, sync will be in real time
NA
Contact/addresses modified into Dolibarr Update into Woocommerce is done if contact/address is linked to Woocommerce (contact/address was created by a "Woocommerce to Dolibarr sync") Real time
Available

Informations concerned:
  - Contact/addresses Billing (CONTACT_MODIFY event): Address 1 (First address line in Dolibarr), Address 2 (Next address lines in Dolibarr), City (Town in Dolibarr), Postcode (Zip in Dolibarr), Country, Phone (Phone pro in Dolibarr)
  - Contact/addresses Shipping (CONTACT_MODIFY event): Address 1 (First address line in Dolibarr), Address 2 (Next address lines in Dolibarr), City (Town in Dolibarr), Postcode (Zip in Dolibarr), Country
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 Woocommerce if order is linked to Woocommerce (order was created by a "Woocommerce to Dolibarr sync") Real time
Available

Informations concerned:
  - Order (ORDER_MODIFY & ORDER_CLOSE & ORDER_CLASSIFY_BILLED events): Status (cancelled => cancelled, validated => pending, accepted & shipment on process => processing, closed => completed)
Shipments created (validated) into Dolibarr Shipment will be created/modified into Woocommerce if source order of shipment was created by a "Woocommerce 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 Woocommerce if source order was coming from Woocommerce No creation/update is currently done on Woocommerce. 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 Woocommerce if source order was coming from Woocommerce No creation/update is currently done on Woocommerce. 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 Woocommerce if product exists also in Woocommerce Real time
Available

Informations concerned:
  - Stock (STOCK_MOVEMENT event): Stock quantity, In stock

Development

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

TroubleShooting

</lang>