Adding a personalization or custom line item in the Craft Theme

I have been moving from the Debut theme to Craft over the past week and a sticking point was allowing for engraving on one of my products. I did the easily in Debut following instructions I found in this community.

The method I used I tried but the content of the input field wasn’t being passed through. It also looked messy. At first I thought I was going to have to add an “if” in the main-product.liquid because I only wanted the personalization field to be visible on a couple of products. Then I found there was a custom liquid option in the product information…The code I used which worked in Debut

Personalization

didn’t pass the personalization information

I found this on GitHub https://github.com/Shopify/dawn/pull/509

I made my mods… and put it in the custom liquid of the product information and it worked… information was passed through to the item in the cart etc. Here’s the code. I have also done a checkbox. I use separate custom liquid label for each custom function I need. Here’s the code for text entry.

Personalization

<input class=“field__input”
type=“text”
id=“personalization”
name=“properties[personalization]”
form=“product-form-{{ section.id }}”

Enter Text-less than 20 characters looks best

3 Likes

Amazing!

This line saved the day for me

form=“product-form-{{ section.id }}”

Thanks so much

Hi, Thanks for posting this.

One question if I could please.

how do you space it so it isnt so tight against the add to cart button below?

Thanks in advance.

Hi @lanterncozies ,

I’d like to suggest another alternative solution that allows you to set up a custom text box in just a few minutes using the Free version of the Easify Product Options app. Here’s a quick demonstration on how you can do it :hugs: :

  • Create a new option set:

  • Add the Text Box option type and customize its details, such as the option label, text length (min & max characters), help text, placeholder, info, and more.

  • Select the product(s) in your store where you want to add the Text Box.

It’s as simple as that! Trying out the Easify Product Options app can save you time and effort while providing the flexibility to create the custom text box you need :+1: .