How to Add a Gift Message Field to Shopify Checkout Without an App
Shopify checkout doesn't have a built-in gift message field, but you don't need a monthly app subscription to add one. Cart attributes let you collect a message on the cart page and carry it through to the order, packing slip, and notification emails. This guide walks through the exact Liquid edits, the theme files involved, and how to test the flow before customers see it.
Why Use Cart Attributes Instead of a Paid App
Cart attributes are key-value pairs attached to the cart that Shopify stores on the order. They're a native platform feature, available on every plan, and they don't add a third-party script to your checkout. That matters for two reasons: checkout scripts are restricted by Shopify anyway, and every extra script is another thing that can slow your store or break when the theme updates.
Paid gift message apps (like those in the Shopify App Store category for cart and checkout customization) typically add a field, sometimes a gift wrap option, and formatting for the message. If all you need is a text box that says "add a note," an app is overkill — you'd be paying a recurring fee for markup you can write yourself in about 30 minutes.
Use cart attributes when: - You only need a plain text message (no gift wrap SKU, no image upload, no delivery date picker). - You want the message to appear on the packing slip and in order emails. - You're comfortable editing theme Liquid files and can test in a duplicate theme first. - You want to avoid adding scripts to checkout, where Shopify's customization options are limited on non-Plus plans.
What You Need Before You Start (Theme Access and a Backup)
Before touching any file:
- Theme access. Go to Online Store > Themes. You need edit rights on the theme. If you're on a staff account without theme permissions, ask the store owner.
- Duplicate the theme. Click the three-dot menu on your live theme and choose Duplicate. Work on the copy. This is your rollback if something breaks.
- Locate the right files. In the duplicated theme, click Edit code. You'll work in
sections/main-cart-items.liquid(orsections/cart-template.liquidon older themes) andtemplates/cart.liquidif your theme still uses it. Themes differ — if you can't find the cart form, search the code editor for<form action="/cart". - Know your theme's vintage. Dawn and other Online Store 2.0 themes structure the cart differently from older themes like Debut or Brooklyn. The code below targets Dawn-style themes; older themes need the same logic in slightly different files.
Make a note of which files you edit so you can reverse the change later.
Step 1: Add the Gift Message Field to Your Cart Form
Open your cart section file and find the cart form — the <form action="{{ routes.cart_url }}" method="post"> block. Inside that form, add a labelled textarea. In Dawn, place it just above the checkout button block, or inside the cart footer section:
<div class="cart-gift-message">
<label for="gift-message">Gift message (optional)</label>
<textarea
id="gift-message"
name="attributes[Gift message]"
maxlength="250"
rows="3"
placeholder="Add a short message for the recipient"
>{{ cart.attributes['Gift message'] }}</textarea>
</div>
Two details matter here:
- The name attribute.
attributes[Gift message]is what tells Shopify to store this as a cart attribute called "Gift message." The text inside the brackets becomes the label on the order. Keep the name consistent everywhere you reference it. - The pre-filled value.
{{ cart.attributes['Gift message'] }}re-populates the field if the customer navigates back to the cart, so they don't lose their text.
Add basic styling so the field matches your theme — a simple margin-top: 1rem on the wrapper and width styling on the textarea is usually enough. If your theme has a cart.css or similar stylesheet, put it there rather than inline.
Step 2: Capture the Message in the Cart Template
The form above submits with the cart update. When the customer clicks Update cart or proceeds to checkout, Shopify saves the attribute to the cart. You don't need JavaScript for the basic flow — a standard form submission handles it.
If your theme uses AJAX to update the cart (Dawn does, via the Cart API), the attribute is still captured because the textarea sits inside the cart form and submits with it. Confirm this by checking that your theme's cart update script serializes the whole form rather than only quantity inputs. In Dawn, assets/cart.js reads the form data, so the attribute is included automatically.
One thing to watch: if your theme has a separate "quick add" or drawer cart, the drawer's form is a different form. Either add the same field to the drawer cart form, or accept that gift messages can only be added on the full cart page. For most small stores, the full cart page is fine and simpler to maintain.
Step 3: Show the Gift Message on the Order and in Notifications
Cart attributes appear automatically in the Shopify admin order page under Additional details — no code needed for that. To surface the message where staff and customers actually look, you'll edit two places.
Packing slip. Go to Settings > Shipping and delivery > Packing slips (or Orders > Packing slips depending on your admin layout) and click Edit template. Add:
{% if order.attributes['Gift message'] != blank %}
<p><strong>Gift message:</strong> {{ order.attributes['Gift message'] }}</p>
{% endif %}
Order confirmation and notification emails. Go to Settings > Notifications, open the Order confirmation email, and add the same Liquid block near the order summary. Repeat for any other templates where the message is useful, such as the shipping confirmation.
| Location | What to edit | Liquid variable |
|---|---|---|
| Admin order page | Nothing — automatic | — |
| Packing slip | Packing slip template | order.attributes['Gift message'] |
| Order confirmation email | Notification template | order.attributes['Gift message'] |
| Customer order status page | Theme's order template (optional) | order.attributes['Gift message'] |
Test each template by placing a real test order with a message and checking the rendered output.
Step 4: Test the Full Flow Before You Launch
Run this checklist on your duplicated theme, previewing it before publishing:
- Add a product to the cart, open the cart page, type a message, and click Update cart. Reload the page — the message should still be there.
- Proceed to checkout and complete a test order (use Shopify's Bogus Gateway or a real low-value order you refund).
- Open the order in admin and confirm the message appears under Additional details.
- Check the packing slip preview and the order confirmation email for the message.
- Test with the field left blank — the
!= blankcondition should hide the block entirely, with no empty "Gift message:" line. - Test a message at the 250-character limit and confirm the textarea stops accepting input.
- Check the cart page on mobile — the textarea should be full width and not overlap the checkout button.
Only after all of these pass should you publish the duplicated theme.
Limitations and When an App Is Actually Worth It
Cart attributes are text only. They can't add a gift wrap product to the cart, charge for the message, validate against a banned-words list, or offer a date picker without custom JavaScript. They also don't appear on the checkout page itself — the customer adds the message on the cart page, then checks out. And because checkout customization is restricted on non-Plus plans, you can't move the field into checkout without Shopify Plus checkout extensibility.
Consider a paid app when you need: - Gift wrapping as a paid add-on line item. - A message field inside checkout rather than on the cart page. - Multiple gift options (message, wrap, delivery date, recipient email). - No-code setup with support, and you'd rather not maintain Liquid.
Check current pricing in the Shopify App Store before committing — gift apps range widely, and a store doing a handful of gift orders a month may not justify a recurring fee.
Conclusion
A gift message field on Shopify is a textarea with the right name attribute, a pre-filled value for returning customers, and two Liquid snippets in your packing slip and email templates. The whole change lives in your theme, costs nothing monthly, and takes less time than installing and configuring an app. Duplicate your theme, make the edits, and run the test checklist before you publish.
FAQ
Will the gift message survive if the customer edits their cart after adding it? Yes. The attribute stays attached to the cart until the order is placed or the cart is emptied. The pre-filled value in the textarea means the customer sees their message when they return to the cart.
Does this work on Shopify's Basic plan? Yes. Cart attributes are available on all plans. Only moving the field into the checkout itself requires Shopify Plus.
Can I make the gift message required?
Not with plain HTML alone — a required attribute on the textarea would block checkout for every customer, gift or not. If you need conditional requirements, that's a case for custom JavaScript or an app.