Back to Shopify Liquid
Money Back & Limited Stock
Shopify Liquid

Money Back & Limited Stock

Adds a dual-badge trust and urgency display to product pages or carts. Features a green '30-day money back guarantee' badge with a lock icon and a red 'Limited stock available!' badge with an animated rotating clock hand SVG to drive conversions.

EasyTrust BadgeUrgencyProduct PageCartCRO
105 lines · 2.9 KB
Setup 5–10 minutes 4 min read 104 lines
Key features
  • Animated CSS clock rotation
  • SVG vector icons included
  • Fully responsive inline design
  • Zero external dependencies
  • Lightweight CSS footprints
Best use cases
  • Reducing buyer friction on high-ticket items
  • Creating FOMO for limited release collections
  • Improving conversion rates near the 'Add to Cart' button
Compatibility
  • Shopify Online Store 2.0
  • Most Shopify themes

The code

Shopify Liquid
1<!DOCTYPE html>
2<html lang="en">
3<head>
4<meta charset="UTF-8">
5<meta name="viewport" content="width=device-width, initial-scale=1.0">
6<title>Items Left Badge</title>
7<style>
8.unique-body-Xyz123 {
9 font-family: Arial, sans-serif;
10 background-color: #f9f9f9;
11 color: #333;
12 display: flex;
13 justify-content: center;
14 align-items: center;
15 height: 100vh;
16 margin: 0;
17}
18
19.unique-container-Abc456 {
20 display: flex;
21 justify-content: center;
22 align-items: center;
23 gap: 10px; /* Badge'ler arasındaki boşluk */
24}
25
26.unique-badge-Def789 {
27 display: inline-flex;
28 align-items: center;
29 background-color: #e0ffd8; /* Çok açık yeşil arka plan */
30 color: #004d00; /* Koyu yeşil metin */
31 padding: 2px 4px; /* Küçültülmüş padding */
32 border-radius: 3px; /* Küçültülmüş yuvarlama */
33 font-size: 10px; /* Küçültülmüş font boyutu */
34 font-weight: bold;
35 text-align: center;
36 position: relative;
37}
38
39.unique-badge-Ghi012 {
40 display: inline-flex;
41 align-items: center;
42 background-color: #ffdede; /* Açık kırmızı arka plan */
43 color: #b22222; /* Koyu kırmızı metin */
44 padding: 2px 4px; /* Küçültülmüş padding */
45 border-radius: 3px; /* Küçültülmüş yuvarlama */
46 font-size: 10px; /* Küçültülmüş font boyutu */
47 font-weight: bold;
48 text-align: center;
49 position: relative;
50}
51
52.unique-icon-Jkl345 {
53 width: 12px; /* Küçültülmüş ikon boyutu */
54 height: 12px; /* Küçültülmüş ikon boyutu */
55 margin-right: 2px;
56 vertical-align: middle;
57}
58
59.unique-badge-Def789 span, .unique-badge-Ghi012 span {
60 display: flex;
61 align-items: center;
62 white-space: nowrap; /* Metinlerin tek satırda kalmasını sağlar */
63}
64
65@keyframes unique-rotate-Mno678 {
66 from {
67 transform: rotate(0deg);
68 }
69 to {
70 transform: rotate(360deg);
71 }
72}
73
74.unique-clock-hand-Pqr901 {
75 transform-origin: 50% 50%;
76 animation: unique-rotate-Mno678 2s linear infinite;
77}
78</style>
79</head>
80<body class="unique-body-Xyz123">
81
82<div class="unique-container-Abc456">
83 <div class="unique-badge-Def789">
84 <span>
85 <svg class="unique-icon-Jkl345" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
86 <path fill="#004d00" d="M12 2C9.24 2 7 4.24 7 7V10H5C3.9 10 3 10.9 3 12V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V12C21 10.9 20.1 10 19 10H17V7C17 4.24 14.76 2 12 2M12 4C13.66 4 15 5.34 15 7V10H9V7C9 5.34 10.34 4 12 4M12 12C13.1 12 14 12.9 14 14C14 15.1 13.1 16 12 16C10.9 16 10 15.1 10 14C10 12.9 10.9 12 12 12Z"/>
87 </svg>
88 30-day money back guarantee.
89 </span>
90 </div>
91
92 <div class="unique-badge-Ghi012">
93 <span>
94 <svg class="unique-icon-Jkl345" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
95 <circle cx="12" cy="12" r="10" stroke="#b22222" stroke-width="2" fill="none"/>
96 <line x1="12" y1="12" x2="12" y2="6" stroke="#b22222" stroke-width="2" class="unique-clock-hand-Pqr901"/>
97 <line x1="12" y1="12" x2="16" y2="12" stroke="#b22222" stroke-width="2"/>
98 </svg>
99 Limited stock available!
100 </span>
101 </div>
102</div>
103</body>
104</html>

How to install Money Back & Limited Stock on your Shopify theme

This snippet belongs in sections/main-product.liquid, directly under the Add to cart button, where it reinforces the purchase decision. Expect the whole job to take about 5–10 minutes.

  1. 1From your Shopify admin, open Online Store → Themes, click the button on your live theme and choose Duplicate. Always work on a copy so you can roll back instantly.
  2. 2On the duplicated theme, click … → Edit code to open the theme code editor.
  3. 3Open sections/main-product.liquid in the file tree. If your theme uses different file names, search for the template that renders the area where you want the block to show up.
  4. 4Click Copy code on this page, then paste the snippet directly under the Add to cart button, where it reinforces the purchase decision.
  5. 5The snippet ships with its own scoped <style> block, so you do not need to touch base.css or theme.css. If you prefer to keep CSS centralised, move the contents of the style tag into your theme stylesheet and delete the inline block.
  6. 6Click Save, then hit Preview and check the block on desktop, tablet and mobile widths.
  7. 7When you are happy with the result, publish the duplicated theme from Online Store → Themes → Actions → Publish.

How to customise it

Every value below lives inside the snippet, so you can adapt Money Back & Limited Stock to your brand without touching the rest of the theme.

  • Colours — the snippet uses #f9f9f9, #333, #e0ffd8, #004d00. Replace those values inside the style block with your brand palette, keeping at least a 4.5:1 contrast ratio between text and background so the block stays accessible.
  • Typography — the block declares font-family: Arial, sans-serif. Delete that line to inherit your theme font instead, which usually looks better integrated.
  • Sizing — adjust the font-size values (10px) and the padding so the block carries the same visual weight as the elements around it.
  • Cornersborder-radius: 3px controls the roundness. Set it to 0 for a sharper editorial look, or increase it for a softer, app-like feel.
  • Copy — rewrite the hard-coded text (for example “Items Left Badge”) in your own brand voice, and translate it if you sell in more than one language.

Common mistakes to avoid

These are the issues merchants run into most often when installing a snippet like this one.

  • Editing the live theme directly. Duplicate it first — a single unbalanced Liquid tag can take a storefront down mid-campaign.
  • Pasting the code into the wrong file. Dropped into layout/theme.liquid instead of sections/main-product.liquid, this block will render on every page of the store, including ones where it makes no sense.
  • Renaming the CSS classes in the markup but not in the style block, or vice versa. The class names have to match exactly or the styling silently disappears.
  • Publishing without testing on a real phone. Most Shopify traffic is mobile, and layout problems almost always surface there first.

Performance notes

What this block costs you in load time, and how to keep that cost at zero.

  • The CSS is inline and scoped to this block, so it adds no extra network request. At a few kilobytes it has no measurable effect on your Lighthouse score.
  • The animation runs on CSS keyframes. Animate only transform and opacity where you can — animating width, height or top forces a layout recalculation on every frame.
  • Run PageSpeed Insights before and after you add the block so you have a concrete number rather than a guess.

SEO & accessibility

How to add this block without damaging your on-page structure or your rich results.

  • Nothing in this snippet should replace your page <h1>. Keep product and page headings intact and use <h2> or <h3> for the block's own heading so the document outline stays clean.
  • If the block shows review or rating content, keep it consistent with the structured data your review app already outputs. Duplicating or contradicting rating markup can cost you the rich result entirely.
  • The block does not create a new URL, so there is no canonical or indexing change to make. It improves on-page engagement signals rather than crawlability.
Frequently asked questions

Money Back & Limited Stock — questions merchants ask

Will this snippet work with my theme?

It is built with standard Liquid, HTML and CSS, so it works with Dawn and virtually every Online Store 2.0 theme, as well as most vintage themes. The only thing that changes between themes is the file you paste it into — if yours has no sections/main-product.liquid, look for the equivalent template that renders the same area.

Do I need an app to use it?

No. This is theme code you own outright: no monthly fee, no third-party script tag, and no app that can break your storefront the next time it updates.

How long does it take to add “Money Back & Limited Stock” to a store?

Most merchants have it live in under fifteen minutes — duplicate the theme, paste the code, adjust the colours and copy, preview on mobile, publish.

The styling looks broken after pasting. How do I fix it?

Confirm you copied the whole snippet including the closing style tag, then check whether one of your theme's own CSS rules is overriding it. If a theme rule wins, increase the specificity of the snippet's selector rather than scattering !important through the file.

Will it slow my store down?

Not meaningfully. It is inline markup with scoped CSS and at most a few lines of vanilla JavaScript — no external libraries, no extra HTTP request. Optimising your product images will always have a far bigger impact on load time.

Can I use it on a client store or a commercial project?

Yes. Every snippet in the MCO Hub library is free to copy, modify and ship on any store, including client work. Attribution is appreciated but not required.

Related snippets

Keep exploring