Shopware Marketing & Promotions

Cart Counter for Shopware 6: social proof badge “In more than 20 carts” on the product page

The social proof that converts: show how many customers already have this product in their cart.

On Shopware, a cart does not exist as rows in a table: it is serialized into a single payload column of the cart table. Displaying "this product is in 23 carts" would therefore require deserializing every cart in the shop on each product page view, which is out of the question. This plugin solves the problem differently: it maintains its own index (cart token, product, sales channel, ordered flag) fed in real time by Shopware cart events, then counts that index with a single indexed query kept in cache. The result is a social proof badge built on your real cart data, with no measurable impact on product page render time.

At a glance
  • "In more than 20 carts" badge displayed under the product page buy box
  • Real count of current carts, deduplicated by cart token and scoped to the sales channel
  • Dedicated index fed by cart events, working around Shopware cart serialization
  • Display threshold, time window, rounded tier or exact number, configurable cache
  • Compatible with Shopware 6.5, 6.6 and 6.7, wording translated into 6 languages
Shopware 6.5 / 6.6 / 6.7 PHP 8.1+ Multi sales channel 6 languages Source code included
  • 30-day refund
  • 12 months updates
  • 24h support
www.datafirefly.com/en/
"In more than 20 carts" badge displayed under the buy box of a Shopware 6 product page
v1.0.0 · updated 2026-08-11
What it does

The short version.

01

Instant social proof

An "In more than 20 carts" badge under the buy box, triggered only above the threshold you define. Below it nothing is rendered, so the message always stays flattering.

02

Built on your real data

Counts the carts that actually contain the product, deduplicated by cart token and limited to the current sales channel. No invented figure, no random simulation.

03

An index, not a deserialization

Shopware serializes the cart into a single payload. The plugin maintains an index table fed by CartSavedEvent, which turns an impossible problem into an indexed query of a few milliseconds.

04

Performance under control

Built-in cache with a configurable lifetime, flushed automatically whenever the configuration changes. No SQL recomputation on each page view, even under traffic peaks.

05

Variants aggregated

On a product with variants, carts from every variant roll up to the parent counter. Size 42 in three carts and size 43 in two carts display five carts, not two isolated counters.

06

Configurable in detail

Threshold, time window, active carts only, tier or exact mode, rounding step, placement above or below the buy box, three badge styles, retention period.

The long version

Everything you'd want to know before you install.

A detailed look at how Cart Counter for Shopware 6: social proof badge "In more than 20 carts" on the product page works, why we built it the way we did, and the thinking behind the features above.

§ 01

Why this module does not exist natively on Shopware

On PrestaShop, counting the carts that contain a product is a join on the cart line table. On Shopware that table does not exist: the whole cart is serialized into a payload column of the cart table, often compressed. A SQL query therefore cannot know what a cart contains without deserializing it, and deserializing several thousand carts on every product page view is not an option. That is why this kind of social proof is common on PrestaShop and rare on Shopware.

§ 02

The solution: an index fed by events

The plugin creates a df_cart_popularity table mapping a cart token, a product id, a sales channel, a quantity and an ordered flag. That index is updated on every cart persistence through CartSavedEvent: added products, changed quantities, removed lines, everything is synchronized in two queries. Counting then becomes a plain COUNT DISTINCT over a composite index, executed once per cache lifetime and per product. The overhead on the cart side is about two indexed queries per change, invisible in a performance profile.

§ 03

Two ways to display the number

Tier mode rounds the counter down using the step you define, for an "In more than 20 carts" effect that stays credible and moves by brackets. Exact mode shows the real figure for shops that prefer full transparency, with a singular variant handled automatically. All three wordings live in Shopware snippets and are edited per language from the administration, with no code change and a dynamic placeholder for the number.

§ 04

An honest, configurable count

The time window limits counting to recently updated carts, which avoids piling up ghost carts several months old. The active carts only option excludes carts already turned into orders, detected through CartConvertedEvent. Sales channel scoping prevents a spike on your German shop from inflating the counter on the French one. Each of these options can be overridden channel by channel from the plugin configuration.

§ 05

6.5 to 6.7 compatibility with no compromise

The template extends the outer block of the buy widget only and calls its parent, which makes it immune to the inner block renamings that happened between 6.5 and 6.7 and compatible with themes that customise the buy box. Retention housekeeping runs without a scheduled task or message queue, because the task handler signature changed between 6.5 and 6.6: it runs at most once an hour, or on demand through the CLI command. The display struct is attached both to the product entity and to the page, which covers rendering through the Shopping Experiences buy box element as well as the quick view.

§ 06

DataFirefly standards

Plugin developed with no Composer dependency, server side rendering, no external JavaScript library, no outbound network call. A single table created, dropped on uninstall when you choose not to keep the data. No personal data recorded: the index only holds the pseudonymous cart token and the product reference, with a configurable retention. Unobfuscated PHP and Twig source code, perpetual licence, 12 months of updates included.