Hello!
Sorry for the late reply, it was my work weekend and I’ve just come back.
So, essentially the use of a tag or metafield is to set the products apart from each other. It marks only the ones you want the vendor to show for.
For example, let’s say I am selling three products. Their SKUs are Pen, Shoe, and Umbrella. All of them are internally marked as having the same vendor.
I decided I only want the Shoe to have the vendor show on the product page, so I will go ahead and set the product.metafields.show.vendor to 1.
With integers like this, 1 usually means “yes” or “true”, where 0 usually means “no” or “false”.
So if I used the code above, it should make it so only the Shoe will show a vendor. The other products don’t have the product.metafields.show.vendor set to 1, so the Liquid code knows not to show any vendor.
If I ever wanted to hide the vendor for Shoe, I would just change product.metafields.show.vendor to 0. Likewise, if I wanted to show the vendor for Pen or Umbrella, I would set their product.metafields.show.vendor to 1.
You can’t have an “empty” vendor in Shopify, but you can use metafields to tell the code not to show the vendor to anyone visiting your website.
Here is the code I provided earlier, but explained. Please remove the parts after //// to make sure the code works right.
{% if section.settings.product_vendor_enable %} ////If I have product vendors enabled, proceed with the following code.
{% if product.metafields.show.vendor == "1" %} ////If the product has been assigned the metafield with the value 1, proceed with the following code.
{{ product.vendor }}
////Show the product's vendor
{% endif %} ////Stop checking for a metafield.
{% endif %} ////Stop checking if product vendors are enabled.
Metafields are hidden product data. It’s useful to be able to group the products in a more hidden or sophisticated way than tags. You can also use metafields to show data on a product page or packing slip.
It is a bit confusing, but once you get it it should be a lot easier. I can try and help as best I can for free. Good luck!