Shopify themes, liquid, logos, and UX
hi,
i want to create input text filed before add to cart button on product page to get email of client before making purchase, i want it for specific collection's products. not for all products.
any suggestion ?
below is my store link and pswd and i want for my wix templates collection
https://advertfox.myshopify.com/
pswd: advertfox
Solved! Go to the solution
This is an accepted solution.
Done, check it with tproduct https://advertfox.myshopify.com/products/candy-pastel-instagram-story-template
It will display only show with the product where metafield Display input field is enabled.
You are using outdated vision of Shopify Dawn theme. Please update the theme with the latest virsion so that I provide you updated code.
Thanks
do i need redo all the design if i update the theme ? thank you
No,
You have to make a copy of your theme and then you can update the theme.
When It's done Let me know I will provide you code.
not really sure how to do it
Hello @Advertfox ,
Please follow to add field in PDP page https://ui-elements-generator.myshopify.com/pages/line-item-property
To make it available for specific collection, you can use meatfiled to make it conditional.
or use an alternate template for specific collection products.
Regards
Guleria
hi,
thank you for the response, can you please help me with more steps, i'm not sure which metafield i have to select since not showing any for the custom code.
thanks for your help
You need to use type Text -- Short
well, in that case do i need to paste below code on product.liquid page ?
<p class="line-item-property__field">
<label for="your-name">Your name</label>
<input id="your-name" type="text" name="properties[Your name]">
</p>
i have assigned one text metafield to one of my the product and pasted given custom code within in it.
but not sure what to do next on the product page
Find the form tag in sections -> main-product.liquid
or snippets product-form.liquid
and paste the code there.
If you need further help you can drop an email or PM the store collaborator code and I'll do it for you.
Request sent!
This is an accepted solution.
Done, check it with tproduct https://advertfox.myshopify.com/products/candy-pastel-instagram-story-template
It will display only show with the product where metafield Display input field is enabled.
thanks a lottt for your help :))))
1) Created metafield with name Display input field and type True or false.
2) Code in snippets -> buy-buttons.liquid
Just after this code
{%- form 'product',
product,
id: product_form_id,
class: 'form',
novalidate: 'novalidate',
data-type: 'add-to-cart-form'
-%}
Here is the code
{% if product.metafields.custom.display_input_field %}
<div class="fields custminut">
<label for="email">Email</label>
<input required class="required field__input" placeholder="Email" id="email" type="email" name="properties[Email]">
</div>
{% endif %}
Regard
Guleria
that worked like a butter, thank you 🙂
hi,
also i wanted to ask something, i have created metafield to assign different banners collection vise. however in some collection i just want to keep titles. is there any suggestion ?
thanks again for all your help.
I think if you leave meatafield blank for specific collection then by default it will pick the collection title.
btw if such option is not available in theme theme you re using then you need to write that logic.
Hi, when i try to keep metafield blank then it shows default image on the collection page instead of title.
hmm then it needs customization.
alright
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024