Add unique field to a bunch of product

Ivan993
New Member
2 0 0

Hi all. As described in the title, i would like to add a custom field (just text) to some products. I'm already using the app called "Custom Fields" but this app add the fields "globally" in every product. What is the best method in order to add a field just to some products?

Thanks in advance.

0 Likes
Guleria
Shopify Partner
1359 277 383

Hello,

Custom field is good for this concept. You have to just leave the value blank in the products where you don't need it.
But anyhow if still it shown on product pages then wrap the code in if condition.

Thanks

Want to modify or custom changes on store hire me.
Email: guleriathakur43@gmail.com, Skype: navrocks1
If helpful then please Like and Accept Solution.
0 Likes
Ivan993
New Member
2 0 0

Hi, thanks for the quick response. In fact, leaving it blank works, but it shows kind of an "empty white place" in the product page if one of the fields is missing. What will be the best approach to fix this?

0 Likes
Guleria
Shopify Partner
1359 277 383

As I mentioned above use if condition

e.g

{% if custom-field == '' %}
leave blank
{% else %}
you custom filed code will go here 
{% endif %}

 

Want to modify or custom changes on store hire me.
Email: guleriathakur43@gmail.com, Skype: navrocks1
If helpful then please Like and Accept Solution.
0 Likes