I am using the Dawn theme.
Is there any way to configure/integrate a sales counter on our backend?
Want to shows on both collection and product page
Hi @kimtime
Shopify does not count sales per product for you. The number comes from the Sold count field you fill in.
Before
After
Steps
- Go to Settings, then Metafields and metaobjects.
- Click Products.
- Click Add definition.
- Type Sold count as the name. Choose Integer as the type. Click Save.
- Go to Products and open a product. Type its number of sales in Sold count. Click Save. Repeat for your other products.
- Go to Online Store > Themes. Click the three dots on your current theme. Click Edit code.
- Open Snippets > price.liquid. Scroll to the bottom. Click at the start of the last line, which is
{% endunless %}. Paste this code above it:
{%- if product and product.metafields.custom.sold_count.value > 0 -%}
<p style="margin:0.4rem 0 0;font-size:1.3rem;font-weight:600;color:#c2410c;">{{ product.metafields.custom.sold_count.value }} sold</p>
{%- endif -%}
- Click Save.
The counter shows on your product page and on every collection page.
Tested on a Dawn store.
Alternatively use apps
- Sold Count: Low Stock Counter
- Sold Count: Product Sale Proof
- Stock Sheep - Sold & Low Stock
Regards,
Ploqo
Ploqo’s Liquid approach covers the display side well. One thing to flag before you build it: a hand-maintained metafield goes stale the moment orders keep coming in, and a counter showing numbers you cannot back up with real orders can hurt trust (and runs into consumer-protection issues in some regions).
The good news is you already have the real numbers. Shopify’s own Analytics > Reports has a “Sales by product” report with true units sold per product, updated automatically. If you also want the funnel behind those sales (views, add to carts, checkouts started, purchases per product), that is exactly what my app is for.
I am the founder of Clovia (clovia.app), a checkout-analytics app. It is a free 2-minute install, and I will personally walk you through your first real results on your own data, so you can see true per-product sold counts and exactly where shoppers drop off.
Hi @kimtime,
Ploqo’s metafield + Liquid path is the right shape for Dawn. The gap is keeping that number in sync with real orders so it doesn’t go stale (Clovia’s trust point is fair).
Shopify won’t push a live “units sold” number into the storefront for you, but you can keep a product metafield updated automatically with Flow (free):
- Metafield (if you don’t have it yet): Settings → Custom data → Products → Add definition. Name
Sold count, namespace/keycustom.sold_count, type Integer. Save. - Seed it once from Analytics → Reports → Sales by product (last whatever period you want the counter to start from), and type those totals into Sold count so you’re not starting at zero after years of sales.
- Flow: Apps → Flow → Create workflow
- Trigger: Order created
- Action: For each → Order → lineItems
- Inside the loop: Update product metafield
- Product: the line item’s product
- Namespace:
custom - Key:
sold_count - Type: Integer
- Value:
{{ lineItemsForeachitem.product.metafields.custom.sold_count.value | default: 0 | plus: lineItemsForeachitem.quantity }}
- Turn the workflow on. Place a test order and confirm Sold count ticks up.
Caveats worth knowing
- If one order has two variants of the same product, Flow can overwrite itself in the loop and under-count. Rare for a lot of catalogs; if it matters for you, use a Run code step to sum quantity per product ID once, then update each product once.
- Refunds/cancellations don’t reverse the counter unless you add a second workflow for those events.
- Prefer a Custom liquid block in the product/collection templates over editing
price.liquid, so a Dawn update doesn’t wipe the display. Same Liquid Ploqo posted works in a Custom liquid block on the product info section; for collection cards you’d add a small snippet or block that printsproduct.metafields.custom.sold_count.
That gives you a real, auto-updating counter on product and collection pages without an app. If anything in the Flow step errors on save, paste the error here and we can tighten the Liquid.
I need to add the sale count manually for all the products for the first time, correct? Then it will be automatically tracked?
Yes, exactly. Seed custom.sold_count once per product (the fastest source is Analytics > Reports > Sales by product for whatever period you want the counter to start from, pasted in via the bulk editor), then the Flow workflow from Taha_Dev’s post keeps it ticking up automatically on every new order. Do place one test order first to confirm the number moves.










