PrestaShop Marketing & Promotions

dffreegift — Cart-threshold free gift for PrestaShop 8 & 9

Free gift at cart threshold — clean, measurable, no price hack.

“Add €12 to receive your gift”: on the cart page, a progress bar shows exactly how far the visitor is from triggering the offer. When the threshold is crossed, the gift product is automatically added to the cart at zero price. If the visitor removes an item and the cart drops below the threshold, the gift is removed immediately. The module relies on PrestaShop's native CartRule mechanism (gift_product field): no hacked price calculation, full compatibility with your existing promotions, voucher codes, taxes and multi-currency.

PrestaShop 8.0 → 9.x PHP 8.1+ Native CartRule Auto-add & auto-remove Progress bar Multi-shop
  • 30-day refund
  • 12 months updates
  • 24h support
www.datafirefly.com/en/
dffreegift — Cart-threshold free gift for PrestaShop 8 & 9
v1.0.0 · updated 2026-05-15
What it does

The short version.

01

Auto-add and auto-remove when the threshold is crossed

On every cart save (actionCartSave hook), the module recomputes the total based on your configuration (tax-incl. or excl., with or without shipping) and attaches or detaches the gift rule. The visitor has nothing to tick, nothing to validate — the gift appears or disappears on its own. Crossing the threshold also triggers a visual pulse animation on the progress block.

02

Visual progress block on the cart page

Automatically shows a banner with the gift product image, a dynamic message (“Add €12.40 to receive your gift” or “Your gift was added to the cart!”), and a colored progress bar. The message transitions from gray-orange (pending) to green (goal reached) at the crossing. Responsive, ARIA-accessible, compatible with every theme that exposes the standard displayShoppingCart hook.

03

Native PrestaShop mechanism — no price hack

The module creates and maintains a ghost CartRule (code DFFREEGIFT_xxxxxxxx) with gift_product configured. When the rule is attached to a cart, PrestaShop itself inserts the gift line (gift = 1, price = 0) — exactly like a promotional rule built manually in the back office. Direct consequence: native compatibility with other promotions, voucher codes, taxes, multi-currency, multi-shop, checkout and order conversion. The historical snapshot of past orders remains intact too.

04

Fine-grained configuration: threshold, taxes, shipping, stock, customer groups

Everything is configurable from Modules → Configure: gift product ID and a specific combination, threshold amount with tax-incl. or excl. calculation, shipping inclusion, stock check (auto-add suspended on out-of-stock), restriction to chosen customer groups, and independent toggles for the message and the progress bar. Multi-language on the frontend.

The long version

Everything you'd want to know before you install.

A detailed look at how dffreegift — Cart-threshold free gift for PrestaShop 8 & 9 works, why we built it the way we did, and the thinking behind the features above.

§ 01

The most measurable lever on average cart value

On an e-commerce store, two variables drive revenue: order count and average cart value. The cost of acquiring a new order has become very high (ads, SEO, retargeting). On the other hand, bumping up the cart of a visitor who is already about to buy costs almost nothing — it is upsell on already-paid traffic. The cart-threshold gift is one of the most effective mechanics for that: the visitor voluntarily adds a few euros so as not to miss the offer. Provided the mechanic is visible, quantified, and instantaneous. That is exactly what dffreegift does.

§ 02

The progress block: psychological mechanics to the cent

On the cart page, the module permanently shows a dedicated banner with the gift product image, its name, and a message that quantifies the remaining distance to the cent: “Add €12.40 to receive your gift”. A colored progress bar transitions from gray-orange to green as the threshold approaches. At the crossing, the banner flips to green with the “Your gift was added to the cart!” message and a pulse animation visually confirms the success. This real-time storytelling is what turns a simple conditional promotion into a behavior lever: the visitor watches the gauge fill, mentally calculates the effort needed, and tips over.

§ 03

Under the hood: PrestaShop's native mechanism, done right

Most gift modules on the market manipulate product prices directly via the actionProductPriceCalculation hook, create cart lines with a forced zero price, or inject temporary SpecificPrice rows. This approach breaks compatibility with other promotion modules later, generates inconsistencies in accounting exports, and complicates debugging. dffreegift does the opposite: at install time, it creates a standard CartRule (visible in Catalog → Discounts → Cart rules) with a DFFREEGIFT_xxxxxxxx code and a gift_product initialized to zero. On every cart save, the module synchronizes gift_product and gift_product_attribute with your configuration, then attaches or detaches the rule from the cart via the native Cart::addCartRule and Cart::removeCartRule methods. PrestaShop then takes care of everything: gift-line insertion (gift = 1, price = 0), cart display, totals, order conversion, historical snapshot. No direct price call, no invasive injection — hence native compatibility with your other promotional mechanisms.

§ 04

Three sync triggers, plus self-healing

The main logic runs on the actionCartSave hook, which PrestaShop calls on every cart save — that is, on every product add, modification or removal, but also on customer login (cart merge) and during some back-office actions. A static anti-recursion flag prevents the module from re-triggering the hook in a loop when it modifies the cart. In parallel, the actionObjectCartRuleDeleteBefore hook watches for manual deletion of our CartRule from the back office: if an admin deletes the rule by accident, the configuration is reset and the next sync recreates a clean rule. Finally, on each configuration save from the Configure screen, the module re-synchronizes gift_product and gift_product_attribute on the existing rule — you never have to touch the rule directly in the Discounts section.

§ 05

Configuration: threshold, taxes, shipping, stock, groups

The Modules → DataFirefly Free Gift → Configure screen gathers everything. A master switch to enable or disable the whole thing. The gift product ID (entered manually, with the product name shown as a hint after saving). A dropdown of the product's combinations (auto-populated after you first save the product ID, the module then reads the available combinations). The trigger threshold amount, with two associated switches: Tax-inclusive (otherwise tax-exclusive) and Include shipping costs (otherwise products only). A Check gift stock switch that suspends auto-add if the product is out of stock (respects the out-of-stock strategy configured globally in PrestaShop). A checkbox grid to restrict the offer to specific customer groups — if none is ticked, all customers are eligible, unidentified visitors included. Two independent display switches for the progress message and the progress bar.

§ 06

Typical use cases

Cosmetics shop with comfortable margins: offer a perfume sample above €40 incl. VAT to push carts of €28-35 to €40. Fashion and accessories: branded pouch as a gift from €80 incl. VAT, calculated excluding shipping, to reward first-time buyers. B2B equipment: keychain or USB stick above €200 ex. VAT, restricted to the Professionals group. Food marketplace: a free tasting product from €50 incl. VAT shipping included, to absorb the free-shipping cost and bring it to profitability. In all these cases the mechanic is the same: a clear threshold, a desirable gift, a visible progression, an automatic add. dffreegift handles it all with zero manual intervention.

§ 07

PrestaShop 8 and 9 compatibility — tested, not promised

The module only uses cross-version stable APIs: Module, Hook, Configuration, CartRule, Cart, HelperForm, Smarty. No use of the Symfony product tabs in PrestaShop 9 (which introduced incompatibilities for many third-party modules), no injection into the one-page checkout, no dependency on classes deprecated in PS 9. The admin screen uses HelperForm — a stable component identical in PS 8 and PS 9. On the frontend, the displayShoppingCart hook is present and functional in both versions, and the getCurrentLocale helper (used for price formatting) has been available since PrestaShop 1.7.6. Install the module on PS 8 today, migrate to PS 9 whenever you want: no action required from you on the module side.

§ 08

Multi-shop, multilingual, readable code

The module works with PrestaShop's multi-shop setup on the default shop context. Frontend messages are translatable via the standard PrestaShop mechanism (Modules.Dffreegift.Shop for the frontend, Modules.Dffreegift.Admin for the back office), with FR, EN, ES and DE pre-positioned. The source code is delivered open (PHP not obfuscated, compliant with standard PrestaShop conventions) with French and English comments at the top of every important method. The main logic fits in a dffreegift.php file under 700 lines — readable and auditable in less than an hour. You can modify, extend via your own hooks, or fork for a specific business need.