PS PrestaShop Intermediate

DataFirefly B2B Portal — Documentation

Install and configure the B2B portal: organisation, roles, negotiated prices, approvals, payment on account, recurring orders, due dates and reminders.

Updated Module version 2.0.0

Overview

DataFirefly B2B Portal gives each business customer a portal inside your PrestaShop store: its negotiated prices, its organisation (head office, regions, stores, franchises, departments), its approval rules, its budgets, its payment on account and its invoices. Your consumer customers see no change.

The module is built for merchants who sell to key accounts, store networks or franchisees: each store orders with its own addresses, prices and limits, while the head office keeps the overall view.

The negotiated price wins by default. A public promotion no longer overrides the contract price. You can switch to “lowest price” mode so the customer benefits from a promotion whenever it is cheaper.

B2B portal: head office overview with spending, contract savings, approvals, recent orders and budgets per entity
B2B portal: head office overview with spending, contract savings, approvals, recent orders and budgets per entity

Compatibility

  • PrestaShop 1.7.8 to 9.x.
  • Classic and Hummingbird themes; the portal works on mobile.
  • Multistore.
  • Included languages: French, English, Spanish, German, Portuguese, Italian, Polish and Dutch, e-mails included.

Version 2.0.0 was tested on PrestaShop 1.7.8.11 (Classic, PHP 7.4), 8.2.1 (Classic) and 9.1.5 (Hummingbird, PHP 8.5).

Installation

  1. Install the ZIP archive from Modules > Module Manager > Upload a module.
  2. The module creates its tables, the “Awaiting payment on account (B2B)” order status, the portal payment method and the Customers > B2B key accounts menu.
  3. Open Customers > B2B key accounts, create a first account, then work through the account tabs: Organisation, Users, Contract, Approvals, Settings.
  4. Schedule the cron task shown in the API and webhooks tab: it runs recurring orders, payment reminders, approval escalations and webhook retries. Call it every 5 to 15 minutes.

The module has no effect on customers who are not attached to any account. You can install it on a live store and create your accounts gradually.

Upgrading from 1.0.0

Install the 2.0.0 archive over the current version, without uninstalling. Accounts, members and prices are carried over; the former catalog price rule is replaced by the contract prices. In our tests (PrestaShop 8.2.1 and 9.1.5), the prices paid by members were identical before and after the upgrade.

Version 1.0.0 required PrestaShop 8: on 1.7.8, do a fresh install of 2.0.0.

Account organisation

An account represents a business customer. Its organisation is a tree: head office, regions, stores (branches or franchises) and departments. Each level can have:

  • a code and a manager;
  • master addresses, copied into each member’s address book;
  • a budget per period, as a simple alert or with approval;
  • an assortment (the whole catalog, selected categories or the contract only);
  • its own contract lines, a minimum order amount and a free shipping threshold;
  • ordering days, a cut-off time and delivery days;
  • centralised or separate invoicing, and the allowed payment methods.

Anything left blank is inherited from the level above. In the Imports tab, you can build the tree from a CSV file (preview, line-by-line errors, undo) or duplicate a template store.

Back office: tree of head office, regions, stores, franchises and departments with billing, own prices and budgets
Back office: tree of head office, regions, stores, franchises and departments with billing, own prices and budgets

Users, roles and invitations

Six roles are provided: brand administrator, regional manager, store manager, buyer, accountant and read only. Permissions are checked server side, and each user only sees the stores within their scope.

A user can be attached to several stores: they pick their active store in the portal, with one cart per store.

Invitations are sent by e-mail with a single-use link, hashed and with an adjustable validity period. The invitee explicitly accepts to join the account.

Team: roles per store (administrator, regional, manager, buyer, accountant, read only) and invitations with consent
Team: roles per store (administrator, regional, manager, buyer, accountant, read only) and invitations with consent
Back office: users per store and role, "Order for this user" button for the account manager
Back office: users per store and role, “Order for this user” button for the account manager

Negotiated prices and contract

The Contract tab gathers the price lines of the account or of a store: fixed price or discount, quantity tiers, combinations, currencies, countries, customer references and validity dates. An account-wide global discount can be added on top. Lines can also be imported from CSV.

Prices are written as PrestaShop specific prices, on customer groups owned by the module, with a priority scale that puts the contract ahead of public promotions. Only the lines created by the module are recalculated: a price line you add by hand is kept.

Priority over public promotions setting:

  • The negotiated price always applies (default);
  • The lowest price applies (promotion if better): while a cheaper public promotion is running, the customer pays the promotional price.

When a store and the account both have a price for the same product, you choose which one wins: the store, the account, or the account only.

On a test store with 10,000 products, 14,025 contract lines and 40 stores, a full sync of 23,671 lines took 1.8 s, and the recalculation after editing a promotion took 0.059 s.

Back office: contract lines with fixed prices and discounts, quantity tiers, customer references and validity dates
Back office: contract lines with fixed prices and discounts, quantity tiers, customer references and validity dates
Store catalogue with negotiated prices, quantity tiers, customer references and a downloadable price list
Store catalogue with negotiated prices, quantity tiers, customer references and a downloadable price list

The buyer portal

The portal is reached from My account. Depending on their role, the user finds: dashboard, catalog at their prices, quick order, lists and kits, approvals, orders, invoices and finance, network and team.

  • Catalog: negotiated prices, tiers, customer references, and a Download my prices button (a CSV file of the whole assortment, or a PDF of the first 1,500 lines).
  • Quick order: references (yours, the customer’s or the EAN) and quantities pasted from a spreadsheet, or a CSV file; prices and unknown references are checked before anything is added to the cart.
  • Lists and kits: personal, shared with the store or set by the head office (restocking, store opening kits).
  • Group order: the head office prepares one order for several stores; one order and one delivery are created per store.
Quick order: paste references and quantities, prices and unknown references checked before adding to the cart
Quick order: paste references and quantities, prices and unknown references checked before adding to the cart
Network: stores and franchises with budgets, and head office group order for several stores at once
Network: stores and franchises with budgets, and head office group order for several stores at once
B2B portal on mobile: active store, cart, budget and overview
B2B portal on mobile: active store, cart, budget and overview

Recurring orders

A list can be ordered automatically for a store: every 1 to 8 weeks on a given weekday, or every 1 to 12 months on a day of the month (1 to 28), with an optional end date. The purchase order number can contain {date}.

Each run applies the portal rules: an order on account, an approval request above the threshold, or, if some information is missing (mandatory PO, blocking budget…), a named cart prepared for the buyer. The owner receives an e-mail after each run. A recurring order can be paused and resumed; it stops by itself if its owner loses access to the store.

Recurring orders are run by the cron task: without it, nothing is placed.

Recurring orders: a list ordered automatically every week or month, with PO number, next date and last result
Recurring orders: a list ordered automatically every week or month, with PO number, next date and last result

Named carts

On the cart page, Put this cart aside saves the cart under a name, optionally shared with the store’s colleagues. The owner or a colleague can pick it up again in one click from Lists and kits.

Carts put aside under a name, shared with the store and resumed in one click
Carts put aside under a name, shared with the store and resumed in one click

Checkout, purchase order and approvals

At checkout, the portal offers Submit for approval or Pay on account, depending on the store’s rules. The buyer enters the purchase order number (optional or mandatory), a cost center, a requested delivery date and a comment. They can attach the purchase order document: PDF, JPEG or PNG up to 5 MB, with the type checked against the file content, stored outside the site’s public folders.

Approval is required based on the amount, the store, the category or a budget overrun. The steps are frozen at submission, the cart is checked when the order is created, a rejection requires a reason, and an unanswered request can be escalated. Delegation has start and end dates.

The workflow cannot be bypassed: the other payment methods are removed (PrestaShop 8 and 9) or hidden (1.7.8), and their controllers refuse the order server side.

Checkout: PO number, purchase order document attached, budget and available credit, payment on account
Checkout: PO number, purchase order document attached, budget and available credit, payment on account
Order approvals: pending request with amount, reason, PO number and the store manager's decision
Order approvals: pending request with amount, reason, PO number and the store manager’s decision
E-mail sent to the approver in their language: approval request with amount, reason and PO number
E-mail sent to the approver in their language: approval request with amount, reason and PO number

Outstanding balance, due dates and reminders

Payment on account creates the order with the “Awaiting payment on account (B2B)” status, without an invoice or a payment. Each entity’s outstanding balance is calculated from its orders and is released on payment or cancellation.

In the account settings, configure:

  • the payment terms in days, with the end-of-month option: the due date is shown on the PDF invoice and in the portal;
  • the reminder days relative to the due date, for example -3,7,15,30: each reminder is sent only once, to the accountants and administrators of the invoiced entity;
  • holding orders beyond N days overdue, released as soon as payment is received;
  • whether the purchase order document is optional or mandatory.

In the portal, the Invoices and finance page shows the outstanding balance per entity, open invoices with their days overdue, an aged balance (not yet due, 1-30, 31-60, 61-90, over 90 days), the statement and the accounting CSV export.

Settings: payment days, end of month, order hold when invoices are overdue and e-mail reminders
Settings: payment days, end of month, order hold when invoices are overdue and e-mail reminders
Invoices and finance: outstanding per entity, aged balance, due dates and overdue invoices, statement and accounting export
Invoices and finance: outstanding per entity, aged balance, due dates and overdue invoices, statement and accounting export

Business account applications

Enable Accept business account applications in the settings: a link appears in “My account” and a public form lets visitors apply for an account (company, company registration number, VAT number, address, contact, needs, optional or mandatory proof of business, consent). The form is protected against bots (honeypot field, minimum fill time, 3 submissions per hour per address).

You receive an e-mail for each application. In the back office, approve it (the account, head office and address are created, and the contact is invited as administrator) or decline it with a reason sent to the applicant. Declined applications are deleted after 90 days.

Public business account application form: company, registration number, VAT number, contact, company document and consent
Public business account application form: company, registration number, VAT number, contact, company document and consent
Back office: reviewing a business account application, approval with an invitation of the administrator, or a reasoned rejection
Back office: reviewing a business account application, approval with an invitation of the administrator, or a reasoned rejection

Key accounts dashboard

Over 30 days, 90 days or 12 months, the dashboard shows: revenue excluding tax, orders, average order value, stores placing orders, last order, outstanding balance and overdue amounts per account. It flags what needs action: contracts ending soon, accounts with no order in 60 days, late payments, applications to review. It can be exported to CSV. The account manager receives an e-mail 30 days and then 7 days before a contract ends.

Back office: key accounts dashboard with revenue, average order, outstanding, overdue invoices and things to do
Back office: key accounts dashboard with revenue, average order, outstanding, overdue invoices and things to do

Ordering on behalf of the customer

In the Users tab, the Order for this user button prepares a cart attached to the chosen store, with its addresses and prices, then opens PrestaShop’s order creation page (or dfordercreator / dfconnectas if installed). The order is marked as “entered by” the employee, in the back office and in the portal.

Invoices

The module adds an information block to the PDF invoice: purchase order number, cost center, store and, for orders on account, payment terms and due date. Invoice numbering and legal invoice content are not changed.

The module does not send any invoice to an e-invoicing platform and does not produce a structured format (Factur-X, UBL, CII). Legal late-payment wording (penalty rate, fixed recovery fee) goes in the free text field of PrestaShop invoices.

API and webhooks

The API and webhooks tab creates access tokens (read or write) for your ERP: orders, stores, contract and budgets, limited to 120 requests per minute. Webhooks are signed (HMAC-SHA256) and only call public HTTPS addresses.

Import from dfb2bteam

If you use DataFirefly B2B Team, the import brings over companies (as accounts), departments (as organisation levels) and members (as users), with preview and undo. Both modules can stay installed side by side; a customer who is active in dfb2bteam is ignored by the portal as long as they remain there.

Multistore

Contract prices, the portal context and back-office filters are isolated per store.

Known limitation: when customers are shared between stores and an account is limited to one store, its global discount also applies in the other stores of the group. The back office flags this on the account concerned. Per-product contract lines are not affected.

GDPR and uninstallation

The module only keeps the data the portal needs; IP addresses in the log are purged after an adjustable period. Export and erasure go through the psgdpr module. On uninstall, everything is removed and the original customer groups are restored; the “keep the data” option lets you reinstall without losing the accounts.

FAQ

Can a public promotion override the negotiated price?

No, unless you choose “lowest price” mode.

What happens if the cron task is not scheduled?

Orders, prices and approvals work, but recurring orders, payment reminders, escalations and webhook retries are not sent.

Do invoice numbers change on install or uninstall?

No. The module never renumbers an invoice; numbers were compared before and after installation, upgrade and uninstallation.

Can a buyer pay by card to avoid an approval?

No. When an approval is required, the other payment methods refuse the order server side.

Does the module work with a theme other than Classic or Hummingbird?

It has only been tested on Classic and Hummingbird. On another theme, check the portal and the checkout before going live.

Was this page helpful?

Still stuck? Contact support