Flair Dynamic Badge Text

4 min read
updated Sep 26 2023

Overview

Flair product badge text can show dynamic information such as company name, customer first name, discounted price, inventory, metafield values, price, and sale price.

Company Name

Display the Shopify B2B company name for the currently logged in customer.

The following variable is supported:

  • company_name - the company name

Example

Welcome {{ company_name }}!

For a company named 'Initech' this displays as:

Welcome Initech!

Customer First Name

Display the first name of the currently logged in customer.

The following variable is supported:

  • customer_first_name - the customer first name

Example

Welcome {{ customer_first_name }}!

For a customer with first name 'Milton' this displays as:

Welcome Milton!

Discounted Price

Display discounted prices dynamically based on either a fixed amount or percent off.

The following variables are supported:

  • price_max_discount_amount_10 - $10 off the max price; amount can be any number between 1-999
  • price_min_discount_amount_10 - $10 off the min price; amount can be any number between 1-999
  • price_max_discount_percent_15 - 15% off the max price; percent can be any number between 1-99
  • price_min_discount_percent_15 - 15% off the min price; percent can be any number between 1-99

The discounted price text is based on all variants. You can enable variant badges to only use the selected variant.

Example: $10 off

To show a $10 off discounted price:

Sale Price {{ price_max_discount_amount_10 }}

For a product with a $19.99 max price this displays as:

Sale Price $9.99

Discounted prices will display based on your shop's currency formatting setting.

Example: 20% off

To show a 20% off discounted price:

Sale Price {{ price_max_discount_percent_20 }}

For a product with a $40 max price this displays as:

Sale Price $32

Inventory

Display the remaining available inventory total for a product.

The following variable is supported:

  • inventory_total - the remaining available inventory

The inventory total text is based on all variants. You can enable variant badges to only use the selected variant.

Example

To show the remaining inventory:

Only {{ inventory_total }} left!

For a product with 3 items available, this displays as:

Only 3 left!

Metafield

Display custom content based on shop, product and variant Shopify metafield values.

The following variables are supported:

  • metafield.shop.namespace.key - display the value of the shop metafield stored at namespace.key
  • metafield.product.namespace.key - display the value of the product metafield stored at namespace.key
  • metafield.variant.namespace.key - display the value of the variant metafield stored at namespace.key; Only available for the main product on product pages.

Example

To show the product metafield stored at namespace custom and key ships_by:

Ships {{ metafield.product.custom.ships_by }}

For a metafield value of '5-7 days' this displays as:

Ships in 5-7 days

Metafield values are displayed using the Shopify metafield_text liquid filter.

Price

Display the minimum and maximum product price.

The following variables are supported:

  • price_min - the lowest price of the product across all variants
  • price_max - the highest price of the product across all variants

The price text is based on all variants. You can enable variant badges to only use the selected variant.

Example

To show the minimum price:

Starting at {{ price_min }}

For a product with a $19.99 minimum price, this displays as:

Starting at $19.99

Sale Amount

Display the sale amount, based on the difference between the compare at price and the price.

The following variables are supported:

  • sale_amount_min - the minimum savings in dollars
  • sale_amount_max - the maximum savings in dollars

The sale amount text is based on all variants. You can enable variant badges to only use the selected variant.

Example

To show the maximum savings as an amount:

SAVE {{ sale_amount_max }}

For a product with a maximum savings amount of $20 this displays as:

SAVE $20

Sale Percent

Display the sale percent, based on the difference between the compare at price and the price.

The following variables are supported:

  • sale_percent_min - the minimum savings as a percentage
  • sale_percent_max - the maximum savings as a percentage

The sale percent text is based on all variants. You can enable variant badges to only use the selected variant.

Example

To show the maximum savings as a percentage:

SAVE {{ sale_percent_max }}%

For a product with a maximum savings percent of 50% this displays as:

SAVE 50%

Percents are rounded to the nearest whole number, so 25.4 becomes 25.

Have a suggestion?

If you'd like to see support for any dynamic variables that aren't listed here, let us know.