Pre-Calculated Discount Prices for Public Promotions

Last updated: November 18, 2026

Abra can pre-calculate discounted prices for eligible Public promotions and expose those prices through Shopify variant metafields. Rendering those values directly in your theme’s Liquid lets you show the discounted price immediately on page load, avoid JavaScript price flicker, support market-specific pricing more accurately, and make it easier for search engines to index the sale price.

ℹ Note

This setup is most useful for Public promotions because public promotions are visible to every shopper and apply automatically when customers meet the promotion requirements.

Why use Liquid instead of JavaScript pricing

  • Better SEO: search engines can read the discounted price directly from the HTML.

  • No price flicker: shoppers see the sale price immediately instead of waiting for a storefront script to update it.

  • More accurate market pricing: Shopify can render the right market and currency context on the first page load.

  • Cleaner product feeds and structured data: your product page markup can reflect the discounted price that shoppers actually see.

When to use this setup

Use this approach when all of the following are true:

  • You are running an Abra Public promotion.

  • You want discounted prices to appear directly in your Shopify theme.

  • You do not want price display to depend on storefront JavaScript.

  • You want Google and other search engines to see the discounted price in the page source.

⚠ Warning

Only one Public promotion can be active at a time in Abra. If you activate a new public promotion, it replaces the previously active public promotion.

Set up the promotion in Abra

Create the promotion

In Abra, click Create Promotion. Set Visibility to Private while you build and test. Switch it to Public only when you are ready to launch.

Add your discount

Add the discount type you want to run for the promotion. Public promotions support the same promotion-building workflow you already use for discounts, eligibility, and storefront messaging.

Target variants by metafield if needed

If you want to target groups of variants at scale, go to the discount setup area and use Applies to specific variants by metafield or Applies to variants by metafield. You can use Search metafield definitions, click Browse, and later use Bulk edit variants to update values in Shopify.

Schedule and save

Set Active Dates if needed, then click Save. For scheduled launches, keep the build controlled with Visibility and future start dates.

How the Liquid rendering approach works

With this setup, your theme checks whether the selected variant has an Abra discount price stored in a variant metafield. If it does, your theme renders:

  • the discounted price as the main selling price

  • the regular price as the compare-at or crossed-out price

  • the same price in the page HTML on first render

If the variant does not have an Abra discount price metafield value, your theme falls back to the standard Shopify variant price.

📝 Note

This is different from Abra’s dynamic pricing schema, which updates storefront prices after page load using theme integration logic. Rendering from Liquid moves the primary price display into the server-rendered page output.

Recommended Liquid pattern

Add this logic anywhere your theme renders the selected variant price, such as your product page price snippet and product card price snippet.

{% assign current_variant = product.selected_or_first_available_variant %}
{% assign abra_discount_price = current_variant.metafields.custom.abra_discount_price %}
{% if abra_discount_price != blank %}
  <div class="price price--on-sale">
    <span class="price__sale">{{ abra_discount_price.value | money }}</span>
    <span class="price__compare"><s>{{ current_variant.price | money }}</s></span>
  </div>
{% else %}
  <div class="price">
    <span class="price__regular">{{ current_variant.price | money }}</span>
  </div>
{% endif %}

In this pattern, the discounted price is rendered first when the Abra variant metafield is present. If your store uses a different metafield namespace or key for Abra’s pre-calculated price, replace the metafield reference with the one configured in your store.

💡 Tip

Use the same pricing logic in both your main product template and your collection or product-card templates. That keeps pricing consistent across product pages, collection pages, search results, and featured product sections.

Variant selection and market-specific pricing

If your theme supports variant switching on the product page, make sure the displayed price updates when the selected variant changes. The safest approach is to base the initial page render on product.selected_or_first_available_variant and then keep your theme’s variant picker aligned with that same variant’s metafield-backed price.

For stores selling in multiple markets, the benefit of pre-calculated prices is that Shopify can render the right market context immediately instead of waiting for a script to recalculate pricing after load. This helps reduce mismatches between what shoppers see, what structured data shows, and what search engines crawl.

Best practices for SEO

  • Render the discounted price directly in the HTML, not only through JavaScript.

  • Make sure your visible price, structured data, and product page source all match.

  • Use the selected variant price on product pages instead of a hard-coded product price.

  • Update collection cards, search results, and featured product blocks too, not just the main product page.

  • Test your public promotion while logged out so you see the same experience as search engines and shoppers.

⚠ Warning

If your theme still runs a separate JavaScript price replacement on top of your Liquid output, you can end up with duplicate price updates or mismatched sale styling. Use one primary pricing display method for the same price block.

Where this fits with Abra storefront features

Rendering discounted prices in Liquid does not replace Abra’s storefront messaging. You can still use Abra storefront experiences such as banners, progress bars, and promotion messaging for a Public promotion while using Liquid for the actual price display.

This means you can combine:

  • Liquid-rendered sale prices for SEO and no-flicker pricing

  • Storefront blocks for promotion messaging

  • Active Dates and Visibility for launch control

Testing checklist

  1. Open the promotion in Abra and confirm it is set to Public when ready to test live behavior.

  2. Confirm the eligible variants have the expected Abra metafield values in Shopify.

  3. Load the product page with JavaScript disabled and confirm the discounted price still appears.

  4. Check variant switching on the product page.

  5. Check collection cards and featured product sections.

  6. Verify the correct currency and market price from different market contexts.

  7. Inspect the page source to confirm the discounted price is present in the HTML.

Troubleshooting

The discounted price is not showing in Liquid

Check whether the selected variant actually has the Abra discount price metafield populated. If the metafield is blank, your theme should fall back to the standard Shopify price.

The wrong price appears after variant selection

Make sure your variant picker updates the price block using the newly selected variant, not the product’s default variant.

Prices look right on product pages but not on collection cards

Update your collection card or product grid price snippet too. Many themes use a different Liquid snippet for cards than for the main product page.

Google still indexes the regular price

Check your structured data and confirm your rendered HTML, visible price, and product schema all reflect the same discounted value for the selected variant.

Abra messaging shows but the Liquid price does not

Storefront blocks and Liquid pricing are separate layers. Your promotion can be active and still fail to show the metafield price if the theme is reading the wrong metafield or wrong variant.

Related guides

Public Promotions

Learn how public promotions work, when to use them, and how to schedule them safely.

Use Metafields to Select Variants Faster

Target products and variants at scale using Shopify metafield definitions and bulk editing.

Dynamic pricing schema

See how Abra’s storefront pricing integration works when you need schema-based dynamic pricing.