How to Add Urgency Messages Below Product Prices in Shopify

Last updated:

Home » Articles » Shopify » How to Add Urgency Messages Below Product Prices in Shopify

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

  1. Go to Settings > Custom Data in your Shopify admin
  2. Click Product metafields
  3. Click Add definition
  4. Name it “Urgency Message”
  5. Choose “Single line text” as the content type
  6. Save the definition

Step 2: Add messages to your products

  1. Go to Products and edit any product
  2. Scroll down to find your new “Urgency Message” field
  3. Add messages like “⚡ Only 3 left!” or “🔥 Limited time offer!”
  4. Save the product

Step 3: Display the message on your website

  1. Go to Online Store > Themes
  2. Click Customize
  3. Navigate to Products > Default Product
  4. In the Product Information section, click Add block
  5. Choose Text
  6. Click the text block and select Connect dynamic source
  7. Choose your “Urgency Message” metafield
  8. Position this block below the price area
  9. 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)

  1. Go to Online Store > Themes
  2. Click Actions > Edit code
  3. Find sections/product-form.liquid
  4. Add your urgency code after the price display (usually around line 200-300)
  5. Save the file

For older themes

  1. Go to Online Store > Themes
  2. Click Actions > Edit code
  3. Find templates/product.liquid or sections/product-template.liquid
  4. Add your urgency code near the price display
  5. 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 %}

Wave

Enjoy our articles? Join our free list and get more.

Sign Up

Book a Discovery Call