Master the three essential tools for Shopify theme customization: Cart attributes, Line Item Property, and Customer notes!
We receive many individual requests for the design of online stores in Japan. These include requests to specify the delivery date, to include an option for gift envelopes, to have options other than variations for products, and to include gender and date of birth in customer information.
We receive many individual requests regarding the design of online stores in Japan.
We receive many individual requests for the design of online stores in Japan. These include requests to specify the delivery date, to include an option for gift envelopes, to have options other than variations for products, and to include gender and date of birth in customer information.
A simple way to meet these needs without coding is to use Shopify apps that provide such functionality. However, while apps are convenient, they also have drawbacks, such as the individual usage fees and the fact that providing functionality to the storefront as described above can affect the display speed of the store (installing many apps or heavy apps will slow down the store's display speed).
Therefore, the next option to consider is searching for a theme with these features in the Shopify theme store, but it may be difficult to find a theme that meets all of a merchant's needs (especially those specific to Japanese business practices).
So, are there no other options? Actually, with a little knowledge of Liquid and HTML, it's sometimes possible to fulfill these needs by slightly modifying the theme's code. The key is that only minor changes to the theme's code (not major ones) won't impair the theme's original performance (loading speed), and if you ever need to revert the changes, it won't be a major hassle.
In this blog, I'd like to explain some simple theme extension methods that can be applied to various purposes, such as Cart attributes, Line Item Property, and Customer note.
1. What are Cart attributes?
Cart attributes are special input fields used to add custom input fields to the Shopify shopping cart screen. As described in the developer documentation, inserting input fields that follow the naming convention below into your cart theme allows you to add custom input fields to the cart, reflect their values on the order details screen, and reference them from Liquid.
Cart attribute naming conventions
Cart attributes can be added by manually inserting the code by referring to the development documentation, but you can also use a generator site called Shopify UI Element Generator to generate the code to insert while previewing the UI of the input fields you want to add.
Here, I'd like to show you an example using the generator mentioned above.
First, copy the following code displayed in the generator above.
Actual insertion code for Cart attributes
`name="attributes[Your name]"` indicates that it is an input tag that follows the naming convention above. `value="{{ cart.attributes["Your name"] }}"` indicates that this value can be referenced from Liquid.
Next, in the Shopify admin panel, go to "Online Store" > "Themes" > "Actions" > "Edit Code" and open Sections/cart-template.liquid (if you are using the Debut theme; the insertion location may differ depending on the theme).
The generator above states that the code should be placed within the `<form></form>` section of the cart theme file. So, follow those instructions, find the `</form>` section in your file, paste the code above onto that line, and save the file.
An example of inserting the Cart attribute code into the cart theme file.
In this state, if you open the storefront, add items to your cart, and proceed to the cart screen, you will see that an input field for the code you inserted above has been added, as shown below.
Example of displaying input fields for the "cartridge attributes" attribute.
Enter any text in this field (I'll enter my name here) and complete the purchase. After the purchase, open the order details from the Order Management section in your Shopify admin panel. You will see that the value you entered during the purchase is displayed in the "Details" section along with the field name, as shown below.
Example of Cart attributes being reflected in order details
Cart attributes can be specified in multiple ways, as long as the attribute names do not overlap. In that case, the values will be stored in a structured manner for each name.
Example of inserting multiple CartAttributes
Additionally, the inserted values can be changed for each item in the "Edit" menu.
Cart attributes editing screen
And (as observant readers may have already noticed), by changing the type of the input tag, you can create UI elements other than text fields, and by using JavaScript in conjunction with it, you can provide even more sophisticated UI elements.
Shopify's help section includes an example of inserting a UI for specifying delivery dates and times using the approach described above, so please check it out.
Example of specifying delivery date and time using port attributes
2. What is a Line Item Property?
Cart attributes are fields for custom items in the shopping cart, while Line Item Properties are the product page equivalent. Similar to Cart attributes, inserting input fields that follow the naming convention below into the product page theme allows you to add custom input fields to the product page, reflect their values on the order details screen, and reference them from Liquid.
Naming conventions for Line Item Properties
While you can manually insert code for the Line Item property by referring to the development documentation, you can also generate the code using the Shopify UI Element Generator. Therefore, I'd like to show you an example using the generator, similar to how we did with Cart attributes.
Actual insertion code for Line Item Property
`name="properties[Your name]"` indicates that it is an input tag that conforms to the naming convention described above.
Next, in the Shopify admin panel, go to "Online Store" > "Themes" > "Actions" > "Edit Code" and open Sections/product-template.liquid (if you are using the Debut theme; the insertion location may differ depending on the theme).
The generator above states that the code should be placed within the `<form></form>` section of the product page's theme file. Following these instructions, search for the `{% endform %}` section in your file, paste the code above it, and save the file.
An example of inserting the Line Item Property code into the product page's theme file.
In this state, if you open the storefront and navigate to the product page, you will see that the input field for the code you inserted above has been added, as shown below.
Example of displaying input fields for Line Item Property
Enter any text in this field (I'll enter my name here) and complete the purchase. After the purchase, open the order details from the Orders Management section in your Shopify admin panel. You will see that the value you entered during the purchase is displayed in the product details along with the field name, as shown below.
An example where the Line Item property is reflected in the order details.
You can specify multiple Line Item Properties, as long as the property names don't overlap. Also, unlike Cart attributes, it's possible to store different values for each product.
An example of using multiple Line Item Properties and entering different values for multiple items in a single order (displayed in the shopping cart).
An example where multiple Line Item Properties are prepared and different values are entered for multiple products in a single order (displayed in the order details on the admin screen).
Please note that Line Item Properties do not have an editing function. Deletion is only possible by hovering your mouse over the right edge of the item's row and using the icon that appears.
Delete button for Line Item Property
The Line Item Property also allows you to create UI elements other than text fields by changing the type of the input tag, and you can provide even more sophisticated UI elements when used in conjunction with JavaScript.
This can be useful when you want to offer options other than variations, such as the gift wrapping option mentioned at the beginning.
3. What is a Customer Note?
The last of the three essential tools is Customer note. This is a method for adding custom fields to the store's customer information, and it also uses input fields with a special naming convention, but it cannot be referenced from Liquid or generated by a generator. It exists as a supplementary function for the customer registration screen.
I'd like to explain this using the tutorial in the development documentation.
First, copy the insertion code for the additional items below from the tutorial page above.
Actual insertion code for customer note
The name "customer[note][Allergies]" indicates that it is an input tag that conforms to the naming convention.
Next, in the Shopify admin panel, go to "Online Store" > "Themes" > "Actions" > "Edit Code" and open Templates/customers/register.liquid.
Following the tutorial above, find the {% endform %} section in the file, paste the code above above that line, and save.
An example of inserting Customer Note code into the product page's theme file.
In this state, if you open the storefront and navigate to the customer registration screen, you will see that the input field for the code you inserted above has been added, as shown below.
Example of displaying input fields in Customer Note
Enter any text you like in this field (I'll enter something I like here) and complete the customer registration. After registration, open the customer in the customer management section of your Shopify admin panel. You will see that the value you entered during registration is displayed in the "Customer Notes" field along with the field name, as shown below.
An example where customer notes are reflected in customer details.
You can also specify multiple Customer notes, as long as the note names are unique. However, unlike the other two options, they are not structured and are simply recorded as notes. Therefore, while you can edit them, you need to be careful not to break the formatting.
In this tutorial example, we've provided a text field, but just like the other two, you can create UI elements other than text fields by changing the type of the input tag, and you can create more sophisticated UI elements by using JavaScript in conjunction with it.
I think it can be used to obtain information such as gender and date of birth, as mentioned at the beginning.
How to customize Shopify email notifications for your clients
How did you find the explanation of the three essential tools for theme customization for buyers: Cart attributes, Line Item Property, and Customer note?
As explained at the beginning, if you find an app or theme that meets your needs and satisfies your requirements, then this kind of customization is unnecessary. However, if you have the skills to customize themes yourself, we encourage you to try it as an easy alternative.
One of Shopify's key features is its flexible and versatile extensibility, which means that even if a specific function isn't available, you can still achieve your goals depending on your ideas.
The developer documentation and help files I introduced today contain many examples of customizations that can serve as hints for this, so I encourage you to try out the examples I couldn't cover today.
Grow your business with the Shopify Partner Program. Whether you offer marketing, customization, web design, or development services, the Shopify Partner Program will guide you to success. Joining the program is free, offers revenue-sharing opportunities, and provides access to a wealth of tools to grow your business. Join our passionate commerce community today!
read more
- COHINA's Merchant Story: Delivering perfectly sized clothing for petite women - COHINA
- [How to Use Shopify] Opening an Online Store: Basic Setup
- This guide explains how to set up and specify a domain name for your online shop.
- What are the advantages of dropshipping, and what should beginners be aware of? [A noteworthy method for operating e-commerce sites in Europe and the US]
- A beginner's guide to using Sass with Shopify
- How to use Shopify with WordPress
- Customize your Shopify store even further! 11 apps you can use right away.
- Selling original design apparel worldwide via on-demand printing: The story of CHA2, a brand launched that aligns with their core business.
- Fast theme creation by the Shopify theme team: How we improved Narrative's web performance
- The Truth and Lies of Affiliate Marketing
FAQ
What are Cart attributes?
What is a Line Item Property?
What is a Customer Note?
Share this article
- Share on Facebook
- Share on X
- Share on LinkedIn


















