PrestaDoliSync : PrestaShop connector for Dolibarr

PrestaDoliSync, the e-commerce connector between Dolibarr & Prestashop.

PrestaDoliSync seamlessly connects Prestashop with Dolibarr, syncing products, orders, customers, and stock. It automates order imports and bulk updates for prices and stock, ensuring efficient management for businesses of all sizes.

Compatibility

Prestashop V7.4 to V9.x & Dolibarr V18.0 to V22.x

Automate the entry of your PrestaShop orders into Dolibarr!

Order import

  • Import the orders from different Prestashop sites, including multisite.
  • Importing an order also imports the customer and the associated addresses.
  • You retain control: import automatically based on Prestashop status or manually with bulk actions.
  • Change the status of a Prestashop order from Dolibarr

Managing a large product catalog while retaining control in the ERP

This is the philosophy of the PrestaDoliSync module.

Import products from Prestashop to Dolibarr

Attribute management

For Prestashop products with attributes, the Dolibarr interface offers fast, ergonomic entry of part numbers, prices and weight of attributes directly in Dolibarr.

This overcomes the ergonomic shortcomings of Prestashop product file attribute management.

Tools to help you with attributes :

  • Instant, live modification of part numbers, prices and weights for Prestashop attributes.
  • Automatic calculation of price and weight impacts for attributes based on actual values entered (actual prices and actual weights).

Build for large product catalogs

The PrestaDoliSync module stands out for its performance in efficiently managing large product catalogs.  

Thanks to its bulk and automatic update system, it allows you to quickly synchronize your Prestashop store's prices and stock with data from Dolibarr.

Each update is based on a file automatically generated by Dolibarr, ensuring optimal integrity and fluidity of the process.

To give an idea of its performance: on standard configurations, the module can process up to 13,000 references in less than a minute on the Prestashop side (time measured on THERSANE servers). This speed naturally depends on your server's resources, but it demonstrates how PrestaDoliSync is designed to meet the needs of businesses with large catalogs.

Why aren't product prices and stocks updated online?

The decision not to update prices and stocks in real time from Dolibarr is based on technical and strategic reasons to guarantee good performance:

Server load management :

The PrestaDoliSync module can be used to connect one Dolibarr instance to dozens or even hundreds of e-commerce sites. An instant update for each stock or price modification on the Dolibarr side would generate a huge number of API calls. This could overload not only the Dolibarr server, but also the Prestashop servers of the connected stores, especially during massive updates.

Temporary error prevention:

By delaying updates to defined time slots, any input errors on the Dolibarr side (e.g. incorrect stock or price entries) do not have an immediate impact on all e-commerce sites. This gives you time to correct errors before they propagate, thus guaranteeing the consistency of synchronized data.

Intelligent load balancing:

Delayed synchronization distributes the load of updates between the various connected e-commerce sites. In this way, each Prestashop server can process updates at its own pace, while avoiding excessive load on the Dolibarr server, which is particularly critical for companies with large catalogs.

In short, this scheduled synchronization system guarantees both optimum performance and greater data reliability, while avoiding the inconvenience of errors or load peaks.

Creation and updating of products on Prestashop from Dolibarr

Creating products on Prestashop from Dolibarr is currently not supported. Only updates to stock, price, and weight are possible in this direction.

This choice is based on a functional reality: product management and their variations differ significantly between Dolibarr, Prestashop, and even between different connected Prestashop stores. (For example, one Prestashop store may manage products with variations while another store manages the same products without variations).
These differences make it complex to harmonize attributes and characteristics between systems or sites. The goal is not to overload Dolibarr with unnecessary synchronization data, so this limitation naturally applies.

Attempting to unify these logics would force compromises that could harm data integrity or the specifics of each platform. Therefore, we opted for a more consistent approach: let each software manage products in its own way while focusing on the essentials, namely reliable and fast synchronization of key information such as stock, price, and weight.

This choice is also based on feedback from solutions tested before the creation of PrestaDoliSync, which led to undesirable automatic synchronizations that indiscriminately erased hours of hard work. A software should be an ally that makes our work easier, not an obstacle that complicates it.

From experience, if you plan to create products in bulk on Prestashop, it is better to opt for imports via CSV files, which, when carefully managed, allow you to control associated data, such as categories, tags, features, or attributes...

Download the module: PrestaDoliSync

The module is available on Dolistore (the official sales platform for Dolibarr) and  Prestashop Add-On (the official sales platform for Prestashop)

Download module on Prestashop-AddOns

The module is available on the prestashop AddOns product page.

By purchasing the module on Prestashop-Add-on, you will receive a ZIP file containing both the PrestaShop and Dolibarr modules. The Dolibarr module is available for download from the module configuration page in PrestaShop.

Download module on Dolistore

The module is available on the Dolistore product page.

By purchasing the module on Dolistore, you will receive a ZIP file containing the Dolibarr module. The PrestaShop module is available for download in module setup.

Stay informed about Updates

Don't miss out on any enhancements or new features for your modules.

Subscribe to our newsletter and receive the latest news, update information and tips for optimizing your tools directly in your mailbox.

Remember to install the Prestashop version of the module on your Prestashop.

The PrestaDoliSync module consists of two modules with the same name: one for Dolibarr and one for Prestashop.

The PrestaShop module allows prices and stock levels to be updated, and automatically triggers orders on the PrestaShop side whenever the status is changed

⚠ Important Reminder: Before installing or updating any module, we strongly recommend testing it in a staging environment first. This helps prevent potential disruptions to your live store.

Module Install : Dolibarr

Note: If you purchased the PrestaDoliSync module on PrestaShop Add-on, you must first install the module on PrestaShop to obtain the Dolibarr module (available for download in the options).

Installation via ZIP file and graphical interface

  1. If the module is provided as a ZIP file ready for deployment (named module_xxx-version.zip, for example, when downloaded from a marketplace like Dolistore), follow these steps:
    • Go to the menu Home > Configuration > Modules > Deploy an external module.
    • Upload the ZIP file of the module from your computer.
  2. Important note: If an error message indicates that there is no "custom" directory, ensure that your Dolibarr installation is properly configured and that the directory is accessible.
  3. You should now see the module you just uploaded in the list. Click "Activate" to start using the module.
  4. If the module requires it, configure it and assign rights to your user groups and/or users.

Module Install : Prestashop

Note: If you purchased the PrestaDoliSync module on Dolistore, you must first install the module on Dolibarr to obtain the PrestaShop module (available for download in the options).

Installation via ZIP file and graphical interface

  1. Log into your PrestaShop Admin Panel
    Open your browser and go to your PrestaShop admin page.

  2. Navigate to the "Modules" Section
    In the left-hand menu, go to Modules and select Module Manager.

  3. Upload the Module
    At the top-right of the Module Manager page, click on the Upload a Module button (usually next to the search bar).
    A pop-up will appear. Click on the Select File button and locate the prestasync.zip file on your computer.
    Once selected, click Next to begin the upload process.

  4. Install the Module
    After the file is uploaded, PrestaShop will automatically display the module information.
    Click Install to proceed with the installation of the module.

  5. Configure the Module
    After installation, you may need to configure the module. You can typically do this by going to the Configure button next to the module in the Module Manager.

That's it! The module should now be installed and active on your PrestaShop store. Make sure to follow any additional configuration instructions that come with the module.

Prestashop module configuration : PrestaDoliSync

Configuration of WebServices

Enabling PrestaShop WebServices is necessary for Dolibarr to communicate with your online store. It ensures data synchronization, such as orders and customers, avoiding manual updates. With secure API keys, it guarantees a reliable and efficient exchange, optimizing business management.

1. Enabling PrestaShop Webservice

  1. Log in to the PrestaShop admin panel.

  2. Navigate to Advanced Parameters > Webservice.

  3. Enable the option Enable Webservice.

  4. Click Save.

Important note on enabling Prestashop webServices

Warning: Enabling web services may not always work immediately upon activation. You may need to add the following lines to your Prestashop site's .htaccess file, right after RewriteEngine on:

RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule . - [E=HTTP_AUTHORIZATION:%1]

Watch out for maintenance mode!

If you are unable to connect from Dolibarr, it is possible that maintenance mode on your site is blocking access. Make sure to add all the IP addresses of your Dolibarr server.

2. Create an API Key

  1. In Advanced Parameters > Webservice, click Add new Webservice key.

  2. Click Generate! to create a unique key.

  3. Add a description (e.g., "Dolibarr Connection").

  4. Set the Status option to "Yes".

3. Configure Permissions

  1. Check the GET and/or PUT boxes for the respective resources.

  2. Click Save.

Ensure the key has the following permissions:

GET & Head for:

shops,languages,order_histories, attachments, addresses, carriers, combinations, countries, customers, orders, order_carriers, order_details, products, product_options, product_option_values, product_suppliers, suppliers, taxes, tax_rules, tax_rule_groups, customizations, product_customization_fields

PUT for:

combinations, order_histories, products

Configuration of mass price and stock updates

The module can use two different methods to retrieve the CSV file containing product price and stock information. The first method (recommended) is to use the "Download file from URL" option, which only requires the URL link to the file available in Dolibarr (the link contains a security token). The second method is the FTP method, which requires configuring an FTP connection to Dolibarr's documents folder for file retrieval.

Configuration of "Download file from URL" method

To enable bulk price and stock updates in Prestashop, follow these steps:

  1. Activate the scheduled task for exporting prices and stock in Dolibarr (Product price and stock export) (see dolibarr image point 1).

    This task generates a file stored in Dolibarr’s documents directory:
    /prestasync/export-stock.csv

  2. Copy in Dolibarr setup page the link to download prices and stocks csv file (see dolibarr image point 2).

  3. Go back to PrestaDoliSync setup in prestashop and select "Download file from URL" in get import price file mode field (see prestashop image point 1).

  4. Past your link into "Import price file URL" field  (see prestashop image point 2)

  5. Save

Note: your dolibarrimport price url need to be accessible by your prestashop apache server.

Configuration of FTP method

To enable bulk price and stock updates in Prestashop, follow these steps:

  1. Activate the scheduled task for exporting prices and stock in Dolibarr (Product price and stock export).

    This task generates a file stored in Dolibarr’s documents directory:
    /prestasync/export-stock.csv

  2. Set up FTP access to the documents folder of your Dolibarr installation.

  3. Go back to prestashop and select "Get file from FTP" in get import price file mode field (see prestashop image point 1).

  4. Enter the FTP access credentials in the module configuration on the Prestashop side (see point 3 in the image).
    Tip: Although Dolibarr generates the file as export-stock.csv, you can use a different file. This allows you to create a custom file with your own stock or pricing modifications.

  5. Enable bulk price updates. (See point 1 in the image).

  6. Add a scheduled task to call the URL provided below the bulk price update activation button. (See point 2 in the image).

  7. Save
Configuration of FTP in prestashop PrestaDoliSync setup page

Run mass price and stock updates

Once the module is configured, simply launch the update URL available on the configuration page of the PrestaDoliSync module in PrestaShop.
To automate regular updates, it is recommended to use a scheduled task (cron) to make periodic calls to this URL. It is advised to update this information at least once a day, and it is discouraged to make updates too frequently, with once per hour already being considered quite frequent.

Note: Errors are logged in the Dolibarr log section.  

Tip: You can call the URL with the parameter `&displaylog=1` to display all information during the URL call. Additionally, you can filter logs for a specific product reference by using `&ref=YOURREFERENCE`.

Configuration of Automatic Order Import in Dolibarr

PrestaShop webhooks allow for sending status updates to Dolibarr, enabling it to automatically retrieve orders based on changes in order status, provided the configuration allows for this. This integration streamlines the process by triggering automatic data synchronization whenever an order status is updated, reducing the need for manual intervention and improving efficiency.

WebHook configuration

1. To configure the webhook, simply enter the url provided by Dolibarr in the prestashop PrestaDoliSync module. (See points 1 and 2 on images)

2. Add a serveur cron task or planned task to call the webhook script URL (see point 3)

Setup

Configure Parameters in the Dolibarr Configuration Page

The first step for a successful PrestaDoliSync setup is to configure the basic parameters in the configuration page. These settings allow you to tailor the system to meet the specific needs of your business. In this section, you will define crucial parameters such as the customer contact type for billing and shipping, the products/services used for managing discounts and packaging, and the synchronization settings with PrestaShop.

It’s essential to complete this step carefully, as these parameters will directly affect how orders, invoices, and deliveries are managed within Dolibarr. These parameters should be configured based on your company’s  processes and how you operate day-to-day. Once the basic configurations are set, you can proceed with further system customization and integration with other tools as needed.

Don’t forget, this configuration page also allows you to define important options for managing stock, purchase and sales prices, as well as security and automation of actions within the system.

Create your first shop in Dolibarr

How to import prestashop orders in Dolibarr

Import an Order with PrestaDoliSync

If you have not configured automatic order synchronization via Webhooks, you can manually import orders from PrestaShop to Dolibarr in two ways:

1. Bulk Import

  • Go to the order list in the PrestaDoliSync module.
  • Select the orders you want to import.
  • Click the option to import the selected orders.

2. Individual Import

  • Open the card of a specific order.
  • Use the import option to retrieve the information from PrestaShop.

Manual import allows you to control which orders are integrated into Dolibarr, particularly if you want to filter or review certain orders before synchronization.

Known Incompatibilities

The Dolibarr Presta Sync module relies on PrestaShop's native WebServices to synchronize data between your online store and Dolibarr. However, certain versions of PrestaShop contain bugs or limitations in their WebService implementation that may interfere with the module’s proper operation.

These incompatibilities can lead to errors during data import or export (products, customers, orders, etc.), or even completely block the synchronization process. It is therefore essential to ensure that your PrestaShop instance is up to date and that the necessary fixes have been applied.

Please note: THERSANE actively contributes to the PrestaShop project by identifying WebService-related issues and submitting fixes directly to the core code via the collaborative GitHub platform. These contributions aim to improve the stability and compatibility of PrestaShop with business management tools like Dolibarr.

Below is a list of recommended fixes that may need to be manually applied to certain PrestaShop versions to ensure full compatibility with the module.

WebService: Fixes for "customizations" type images

See fix #38417 on the PrestaShop GitHub repository