This guide shows you three different ways to add urgency messages like “Selling Fast!” below product prices. You can use Shopify’s built-in features, get creative with existing fields, or add custom code. Each method works with any Shopify theme.
Method 1: Using Product Metafields
This method requires no coding and uses Shopify’s built-in features.
Step 1: Create the metafield
- Go to Settings > Custom Data in your Shopify admin
- Click Product metafields
- Click Add definition
- Name it “Urgency Message”
- Choose “Single line text” as the content type
- Save the definition
Step 2: Add messages to your products
- Go to Products and edit any product
- Scroll down to find your new “Urgency Message” field
- Add messages like “⚡ Only 3 left!” or “🔥 Limited time offer!”
- Save the product
Step 3: Display the message on your website
- Go to Online Store > Themes
- Click Customize
- Navigate to Products > Default Product
- In the Product Information section, click Add block
- Choose Text
- Click the text block and select Connect dynamic source
- Choose your “Urgency Message” metafield
- Position this block below the price area
- Save your changes
Method 2: Using Existing Fields Creatively
These methods use fields that already exist in Shopify for urgency messages.
Using the product description
Add HTML code to your product description to create styled urgency messages:
<div style="background: #ff6b6b; color: white; padding: 10px; border-radius: 5px; margin: 10px 0;">
⚡ URGENT: Limited stock remaining!
</div>
Using product tags
Add tags like “urgent-low-stock” or “sale-24-hours” to products, then use code to show different messages based on these tags.
Using the vendor field
Instead of the manufacturer name, put urgency text like “⚡ URGENT – Low Stock” in the vendor field.
Using the product type field
Add urgency prefixes like “URGENT-Electronics” or “SALE-Clothing” to the product type.
Method 3: Adding Custom Code
This method allows automatic messages based on stock levels.
Basic urgency code for any theme
Add this code to your product template near where the price is displayed:
{% if product.available %}
{% assign current_variant = product.selected_or_first_available_variant %}
{% if current_variant.inventory_quantity <= 10 and current_variant.inventory_quantity > 0 %}
<div class="urgency-message">
<span>⚠️ Only {{ current_variant.inventory_quantity }} left in stock!</span>
</div>
{% elsif current_variant.inventory_quantity <= 2 and current_variant.inventory_quantity > 0 %}
<div class="urgency-message urgency-critical">
<span>🔥 Almost gone! Only {{ current_variant.inventory_quantity }} remaining</span>
</div>
{% endif %}
{% endif %}
Code that works with multiple product options
For products with different sizes or colors, add this JavaScript to update messages when customers change options:
<div id="urgency-container"></div>
<script>
var variantStock = {};
{% for variant in product.variants %}
variantStock[{{ variant.id }}] = {{ variant.inventory_quantity }};
{% endfor %}
function updateUrgencyMessage(variantId) {
var stock = variantStock[variantId];
var container = document.getElementById('urgency-container');
if (stock <= 3 && stock > 0) {
container.innerHTML = '<span style="color: #d32f2f; font-weight: bold;">Only ' + stock + ' left in stock!</span>';
} else if (stock <= 10 && stock > 0) {
container.innerHTML = '<span style="color: #ff9800; font-weight: bold;">Low stock: ' + stock + ' remaining</span>';
} else if (stock <= 0) {
container.innerHTML = '<span style="color: #666;">Sold Out</span>';
} else {
container.innerHTML = '';
}
}
</script>
Where to Add the Code in Different Themes
For Dawn and newer themes (Online Store 2.0)
- Go to Online Store > Themes
- Click Actions > Edit code
- Find sections/product-form.liquid
- Add your urgency code after the price display (usually around line 200-300)
- Save the file
For older themes
- Go to Online Store > Themes
- Click Actions > Edit code
- Find templates/product.liquid or sections/product-template.liquid
- Add your urgency code near the price display
- Save the file
Creating a custom section (Advanced)
Create a new file called sections/urgency-message.liquid
:
<div class="urgency-section">
{% if section.settings.show_urgency %}
{% assign threshold = section.settings.urgency_threshold %}
{% assign current_variant = product.selected_or_first_available_variant %}
{% if current_variant.inventory_quantity <= threshold %}
<div class="urgency-message">
{{ section.settings.urgency_text | replace: '[quantity]', current_variant.inventory_quantity }}
</div>
{% endif %}
{% endif %}
</div>
{% schema %}
{
"name": "Urgency Message",
"settings": [
{
"type": "checkbox",
"id": "show_urgency",
"label": "Show urgency message",
"default": true
},
{
"type": "range",
"id": "urgency_threshold",
"label": "Low stock threshold",
"min": 1,
"max": 50,
"default": 10
},
{
"type": "text",
"id": "urgency_text",
"label": "Urgency message",
"default": "Only [quantity] left in stock!"
}
]
}
{% endschema %}