How to Display Singular or Plural of String Based on Number in Shopify

Updated: July 21, 2021


Drive 20-40% of your revenue with AVADA
avada email marketing

Would you want to create an automatic system of adding plural form on characters? Liquid in Shopify has a way to do that by using string filter. The tutorial today focuses on string filter, especially pluralise and guides you to display singular or plural of string based on number.

Table of content

Brief introduction to Liquid and filters

Since 2006, Liquid has been the backbone language of Shopify and has been trusted by a lot of web developers. Liquid is one of the open-source template languages in Shopify. The template has been sold since 2006 and now become a good source for a lot of hosted website application such as Jekyll, salesforce desk, and zendesk.

Filter is one of the four Liquid references including filter, objects, basics and tags. Filters are simple methods that modify the output of numbers, strings, variables, and objects. Filters are placed between an output tag and are denoted by a pipe character.

What is string filter and pluralise

String filters are sub-categories of filters. String filters are used to generate output automatically and variables of string types. String filters are divided into a lot of sub-types. Today we focus on pluralise.

Pluralise outputs the singular or plural version of a string based on the value of number.

How to display singular or plural of string based on number

Displaying singular or plural form of a string is not difficult by utilizing pluralise. Let’s look at the example below. The first parameter is singular string and the second one is plural string.


{{ cart.item_count }}
{{ cart.item_count | pluralize: 'item', 'items' }}


3 items


In a nutshell, string filters are useful for you to create automatic systems on your website. Of all string filters, you use pluralise to show the singular or plural version of a string based on the number. We hope that the tutorial is helpful and let us know your difficulties, we will address them.

Recommend for you
Image Description
SMS, Email Marketing Automation

Top rated Marketing automation for Shopify stores

Learn more
Image Description
SEO Suite

Auto-optimize website elements and structure in one-click.

Learn more
Boost Sales [Free]

Boost sales: Sales Pop, Trust badges, Countdown timer, more

Learn more
Image Description
Photo Reviews [Free]

Use photo reviews to boost sales

Learn more


Stay in the know

Get special offers on the latest news from AVADA.

40k subscribers has been joined!

Earn $10 in reward now!

go up