How to add a custom text field to product page Brooklyn theme

Topic summary

A user seeks help adding a custom text field to product pages in Shopify’s Brooklyn theme.

Initial Solution Provided:

  • Navigate to Online Store > Themes > Edit Code
  • Locate and modify product-template.liquid to insert custom text field code
  • Update the product form by finding product-form.liquid in the Sections folder
  • Add specific code above the “Add to Cart” button form to ensure the custom field value passes through when clicked

Implementation Issue:
The user successfully completed initial steps but encountered a problem at step 6—they cannot locate the product-form.liquid file in the Sections folder.

Alternative Files Suggested:

  • product.liquid
  • product-template.liquid

Current Status:
After adding code from step 7, an error appears (screenshot provided). The discussion remains unresolved as the user awaits further guidance on the correct file location and error resolution.

Summarized with AI on November 19. AI used: claude-sonnet-4-5-20250929.

Hello! How do I put a custom text field on product pages in Brooklyn theme? I found a few tutorials but none of them helped me.

1 Like

Hello @POZ_K

  1. In your Shopify Admin go to online store > themes > actions > edit code
  2. Find product-template.liquid Add the custom text field: Open the “product-template.liquid” file and search for the area where you want to add the custom text field. For example, you might want to add it below the product title or above the add to cart button.
  3. Insert the code for the text field: Use the following code snippet to create a custom text field:

  1. In this code, “Custom Field” is the name of the custom field you want to add. You can modify the label text and input field attributes to suit your needs.
  2. Save the changes: After adding the code, save the file.
  3. Update the product form: Now, find the “product-form.liquid” file located in the “Sections” folder. Open it and search for the tag. Inside the form, find the line that looks like this:
{{ form | payment_button }}
  1. Add the following line of code just above it:
{{ form | payment_button, product_form_id: 'AddToCartForm' }}
  1. This ensures that the custom text field value is passed through when the “Add to Cart” button is clicked.

  2. Save and test: Save the changes to the “product-form.liquid” file and preview your store. Go to a product page and check if the custom text field appears as expected.

I did everything good, but on the step 6. I can’t find “product-form.liquid” file in the “Sections” folder. it’s not there.

Hello @POZ_K

You can check it.

product-template.liquid

product.liquid

This error appears after I added the code from step 7.