Why isn't my custom text box displaying on the order page?

I just created a custom box for my website, but the data is not showing in the order, can you help me? Thanks a lot

website : swing-love.com/products/custom-ankle-boots-limited

Hello @LongLe ,

To add a custom attribute to the order details in Shopify, you will need to follow these steps:

  1. From your Shopify admin, go to Products > All Products.
  2. Click on the product that you want to add the custom attribute to.
  3. Click on the “More actions” button and select “Edit product”.
  4. Scroll down to the “Variants” section.
  5. Click on the variant that you want to add the custom attribute to.
  6. In the “Option2 name” field, enter the name of your custom attribute (e.g. “Do you want laser?”).
  7. In the “Option2 value” field, enter the options for your custom attribute (e.g. “Yes” and “No”).
  8. Click the “Save” button to save your changes.

After you have added the custom attribute to your product variant, it will appear on the product page for customers to select. When a customer places an order, the selected option for the custom attribute will be included in the order details.

To display the custom attribute on the order details page, you will need to modify the order template. To do this, you will need to have some familiarity with HTML and Liquid, the template language used by Shopify. You can find more information about modifying the order template in the Shopify Help Center.

To display the data from your custom attribute on the order details page, you will need to use the line_item.properties object. This object contains a list of the custom attributes that were selected for each line item in the order. You can loop through the list of properties and display each one in the template.

Here’s an example of how you could display the data from your custom attribute in the order template:

{% for line_item in line_items %}
  ### {{ line_item.title }}
  {% for property in line_item.properties %}
    {% if property.name == 'Do you want laser?' %}
      

{{ property.name }}: {{ property.value }}

    {% endif %}
  {% endfor %}
{% endfor %}

This code will loop through each line item in the order and display the title of the product. It will then loop through the list of properties for that line item and check the name of each property. If the name is “Do you want laser?”, it will display the name and value of the property.

Keep in mind that you will need to test your changes to the order template carefully to make sure that they are displayed correctly. You may also need to make additional changes to the template to ensure that it is properly formatted and styled.

DM me if you need any help with the it. I will be more that happy to help :slightly_smiling_face:

Hi [email removed]LongLe,

This is Victor from PageFly - Landing Page Builder App

you need additional properties for this element after adding properties when you click add to cart will have field properties on the order

Example: name=“properties[test]”

Result:

Hope my solution works perfectly for you!

Best regards,

Victor | PageFly

Thank for helping