EN

Documentation

Setting up PrestaDoliSync

Installation, configuration and use, step by step.

Install the module in Dolibarr

  1. Download the module ZIP file (named module_xxx-version.zip), for example from the Dolistore.
  2. In Dolibarr, open Home > Setup > Modules/Applications > Deploy/install external app/module.
  3. Upload the ZIP file, then enable the module in the list of modules.
  4. Try it on a copy of your data first, and keep a backup before any update.

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).

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).

  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

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