Hello Everyone,
I am changing from Brooklyn template to Craft template, however some of my code don’t work thus I need some help on this:)
I am trying to include a custom line field in my product page.
My code from the Brooklyn template is as follows:
Message to recipient. Indicate "Blank" if you wish
to write your own message.
I am also trying to add some wordings on my cart liquid, for which my original one in brooklyn was as follows:
Standard Delivery ($15)
Monday- Saturday:
- 9am- 2pm
- 1pm- 6pm
Sundays: 9am- 2pm
It will be great if someone can advice how to change the code such that they will work in the craft theme. Thank you!
Hi @Abscondance
With the Craft theme, you can add your code to a Custom liquid block, you don’t need to edit directly in the theme code like this: https://take.ms/aiP4w
But please notice that you have to add an form attribute to the input field to ref it with the product form, see my example code below
{%- assign product_form_id = 'product-form-' | append: section.id -%}
Regarding the cart page, you can do the same, just add more Custom liquid section or block to the cart page then insert your text.
Thank you so much! This works perfectly!
You are welcome, don’t hesitate to let me know if you have any questions
Regards,
James from FoxEcom
Hello there,
I used this code and it worked great. However, when I add it, it’s adding to all my products. I only need it on a few. Do you know how to add it to just specific products? I am accessing the online store customization link, clicking on the product, then adding the custom liquid field there. But again it’s then adding to all my products.
Thank you,
Hey,
Did you find a solution to this??
Hello, no. When I chatted with a Shopify rep, they did not know either and told me to ask my question here. Can you help?
Hi,
Yeah sure - You just have to create a separate product template for each product style. So duplicating the product liquid and naming a new file as the product you want to add the field to.
This step by step explains it all -
https://littlethemeshop.com/how-to/how-to-add-custom-fields-to-a-shopify-theme/
Hi,
For future reference, you can simply add any custom field to your product page, cart page, and even contact form using our Enhanced Shopify UI Elements generator tool. No apps needed. It works well with Shopify 2.0 Free themes.
Please check the video tutorial below
@James_FoxEcom thanks it was working fine. for me.