Home > Shopify Development > Liquid plus: Add Number in Shopify

Liquid plus: Add Number in Shopify

Sam Nguyen
Sam Updated: May 27, 2024

Share:

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

As a web developer and an online seller, we all want to have an effective functionality to contribute our websites professionally. In Shopify, there are many functionalities that the Shopify store owners enable building their online shops effectively. One of these effective tools is Liquid which is a flexible and safe language for website developers. Therefore, it is all we need for our theme setting. Known as the powerful Shopify tool, Liquid plays an important role in building themes. With the latest version of Liquid, it is easy for online sellers to use this tool to set up their storefront. Moreover, Shopify store owners will be able to load all the dynamic data with a significant number of Liquid codes types such as objects, tags, and filters.

Besides, to display the stored data, the Liquid objects provides the Shopify store owners the codes to manipulate their appearance. The Liquid filters can change the output of these objects. Moreover, the Liquid filters will help the users to change the output of Liquid objects so they can customize their website with the best performances. Because of these features, this Liquid is used in many websites and applications. In spite of the popularity of Liquid, as a flexible and safe language, Liquid is totally free for any online users so the Shopify store owners do not need to pay any cost.

Table of Content

About Liquid plus {#about-liquid-plus}

One of the combinations of Liquid codes, Liquid filters which are considered as the tool to modify the output of different types of data such as numbers, strings, objects, and variables. All of them are placed within an output tag {{ }} . The functional form is that the output will be denoted by a pipe character like this |.

Similar with other Liquid filters,math filters can also help admins change their Liquid object’s outputs. In addition, it allows the users to apply the mathematics functions in the Shopify shops. Besides, the Shopify users can link the math filters with any other filters, which is based on the order from left to right. For example, from the left side to the right side, if you apply the minus, times, and divided_by, the process will be minus first, then times, and divided_by. In the last tutorial Liquid minus: Subtract number, we introduced to the Shopify store owners with basic knowledge about the minus Liquid filter. In this article Liquid plus: Add Number in Shopify, we continue bringing the users simple steps to use plus Liquid filters in their shops.

The way to add number in Shopify

Step 1: Input

In this example, the product’s price is the expected data to add with number 15 so that we enter those following input.

Input

<!-- product.price = 200 -->
{{ product.price | plus: 15 }}

Step 2: Output

The result for this input is as below:

Output

215

Conclusion

In concluding, the math filters plays an important role in contributing the themes especially in dealing with the number of data. This article Liquid plus: Add Number in Shopify which includes simple steps for even the beginners in Shopify to plus a number into their numbers.
In addition, through our chain of articles like the following list, we hope that the Shopify store owners can discover more about math filters:


Sam Nguyen is the CEO and founder of Avada Commerce, an e-commerce solution provider headquartered in Singapore. He is an expert on the Shopify e-commerce platform for online stores and retail point-of-sale systems. Sam loves talking about e-commerce and he aims to help over a million online businesses grow and thrive.

Stay in the know

Get special offers on the latest news from AVADA.