Cart Popularity — Documentation
Install and configure the cart-counting module on the product page.
The Cart Popularity module displays a social-proof badge on the product page showing how many carts contain the product, for example “In 20+ carts”. This guide covers installation, configuring each setting, how the counting works and troubleshooting.
Installation
The module installs like any PrestaShop module, with no external dependency.
- In the back office, open Modules > Module Manager.
- Click Upload a module and select the
dfcartpopularity.zipfile. - Once the installation is complete, click Configure.
Compatible with PrestaShop 8.0 to 9.x. No Composer dependency or external JavaScript library is required.
Configuration
The configuration page gathers all display and counting settings.
Displayed text
The message shown in the badge, translatable per language. Use the {count} marker to insert the number dynamically. Example: In {count}+ carts. French, English, Spanish, German and Italian translations are provided by default.
Display threshold
Minimum number of carts from which the badge appears. Below this threshold nothing is shown, which avoids displaying an unimpressive figure. Default value: 20.
Number display mode
- Rounded tier: the counter is rounded down to a tier (e.g. 23 carts shows “20+”). Ideal for a credible effect that grows in steps.
- Exact number: the real figure is shown, for shops that prefer full transparency.
Rounding tier
Used only in tier mode. Determines the rounding step: a tier of 10 turns 23 into “20+”, 37 into “30+”.
Time window (hours)
Only counts carts updated within this window. For example, 168 = 7 days. Set to 0 to apply no time limit.
Active carts only
When this option is enabled, carts already converted into an order are excluded from the count. You then reflect only active demand.
Placement
Choose where the badge appears on the product page: below the add-to-cart block (additional information) or near the buy buttons.
Cache duration (seconds)
How long the count is kept before recalculation. Default is 600 seconds (10 minutes). Set to 0 to recalculate on every display, which is not recommended in production.
Every time you save the settings, the counting cache is cleared automatically so your new parameters apply immediately.
How the counting works
The module counts the real carts containing the product. The count is de-duplicated per cart — the same cart is never counted twice — and limited to the current shop in a multistore context. The time window and the “active carts only” option refine this count so it reflects relevant demand.
Performance and cache
To avoid a counting query on every product view, the result is stored in a dedicated cache table with a configurable lifetime. The count is only recalculated when the cache expires, which preserves performance even on high-traffic shops.
Multistore and multilingual
In multistore, the count is scoped to the shop being viewed. On the language side, the badge text is fully translatable: it is set independently for each active language of the shop, with the {count} marker for the number.
Theme integration
The badge is rendered server-side through a module template. If you want to position it precisely in your theme, the Smarty variable {$dfcp_message} contains the ready-to-use message and can be inserted into a product-page override.
Troubleshooting
The badge does not appear
Check that the real number of carts containing the product reaches the defined threshold. If the threshold is 20 but the product is only in 5 carts, no badge appears — this is the expected behaviour. Temporarily lower the threshold to test the display.
The number does not update immediately
This is the cache effect. Wait for the configured duration to expire, or save the settings to force an immediate cache clear.
The counter seems too low
If the “active carts only” option is enabled and the time window is short, only recent, non-ordered carts are counted. Widen the time window or disable the option for a more inclusive count.