Adding sold in the last hours to product page

Topic summary

A user seeks a free or code-based solution to display “sold in the last X hours” counters on Shopify product pages, similar to social proof widgets that show recent purchase activity.

Apps Explored:

  • Fomo Social Proof and Nudgify were tested but found expensive or limited (1000 notifications max)
  • Social Proofy was recommended as an alternative with 30+ widgets

Code Solution Provided:
One participant shared custom HTML/JavaScript code that generates random “fake counters” displaying numbers like “23 sold in last 5 hours.” The code uses Math.random() to create variable counts and timeframes, creating urgency without tracking actual sales data.

Implementation Challenges:

  • Multiple users requested the code solution via direct messages
  • Questions arose about where to place the code (typically below product price/title)
  • One user reported “invalid JSON in tag schema” errors when attempting implementation

Current Status:
The discussion remains active with ongoing requests for the code snippet. The original poster is sharing the solution privately via DM rather than publicly posting it in the thread.

Summarized with AI on November 2. AI used: claude-sonnet-4-5-20250929.

Hi There,

I’m looking for an app that shows "sold in the last hours " on the product page.

I research and found a few apps but they were quite expensive.

Looking for an app that can be free

Or can this be done by modifying the liquid file?

Thank you.

Mel

@mel30
You are trying to add sold out labels?

1 Like
{%- if product.tags contains 'new' -%}

sold in the last hours 

{%- endif -%}

@mel30

try this code.

1 Like

@Zworthkey

Thank you for your reply.

I’m looking for something like the below image

Sold.PNG

Does the above code meet the purpose?

Thank you

Mel

Which app you have tried?

1 Like

@Zworthkey

I tried the Fomo Social Proof & Nudgify app its shows only 1000 notification

https://apps.shopify.com/fomo?surface_detail=fomo&surface_inter_position=1&surface_intra_position=1&surface_type=search

https://apps.shopify.com/nudgify?surface_detail=fomo&surface_inter_position=1&surface_intra_position=2&surface_type=search

1 Like

ok, We have to Add it by custom code.

1 Like

@Zworthkey

I saw some websites adding fake counters.

Not sure it is done with Code or by some app.

1 Like

yes, its fake counter.

Sold.PNG

Can you provide me refrence website.

2 Likes

Ill share privately

1 Like

@Zworthkey Thank you sharing the solution privately

1 Like

Hi @mel30 ,

We offer powerful social proof widgets to help Shopify store owners increase their sales. You also have access to more than 30+ widgets that you can use to convert your visitors into customers. In addition to improving existing widgets, we continue to add new widgets actively.

https://apps.shopify.com/social-proofy

Let us know if you need any help.

May I also have access to the solution please as this is something I also need to accomplish.

Thank you kindly.

Hey,

I’m looking for the same functionality, could you share with me if you found the solution?

Thanks!

Can you share with me please.
many thanks

where would i place this code?

Its usually placed on the product page below the price or product title.

Can you share with me please,
Thanks.

Here you go…

{% if product.available == true %}
🔥 sold in last hours

Hello there! It shows “invalid json in tag schema” actually I’m using Envato theme, I don’t know anything about coding