Addons
Live View Counter
Adds urgency to product pages by injecting a dynamic "{count} people are watching" line underneath the product summary.
How it works
LiveViewCounterAddonhooks intowp_enqueue_scriptsandkitbix_commerce_after_product_details.- The addon is product-only; assets only load when
[kitbix_commerce_product](or the query var) is present. - Counts are generated on the fly using the product ID plus the current minute (
generateCount()) so each product gets a unique, believable number. - The markup lives in
views/live-view-counter.phpand inherits storefront typography to blend in.
Settings reference
| Field | Key | Description |
|---|---|---|
| Message Template | message_template |
Defaults to {count} people are watching this product right now. The addon auto-appends {count} if you forget to include it. |
Frontend behavior
- When enabled, the addon enqueues
live-view-counter.cssandlive-view-counter.json product pages. - Each render passes the calculated count and template into the view.
- The JS file simply handles fade-in animations; no polling occurs, so numbers stabilize after load.
- The block respects
kitbix_commerce_after_product_detailspriority 20, so it appears below badges but above the Q&A section.
Testing checklist
- Enable the addon and customize the message template.
- Open several products; counts should differ per product and per minute.
- Switch languages to verify
{count}is replaced inside translated strings. - Disable the addon and confirm the block disappears immediately.
Common pitfalls
- Expecting literal real-time analytics—this addon intentionally fakes a believable range instead of querying analytics providers.
- Embedding
{count}twice in the template, producing duplicated numbers. - Trying to use it on non-product pages; hooks never run outside the product context.
Reminder: The counter runs entirely on the frontend. If caching strips the localized script, purge your cache or add the addon handles to your cache exclusion list.