Shopify Metafields: How to Add Custom Fields in Shopify (The Old Way)

Intro to Shopify Theme Development: skl.sh/2MCrJIE
7 day free trial for new Skillshare.com users
Wanna go deeper into Shopify Theme Development? Join my mastermind community.
shopifythemedeveloper.com/
Episode Overview
-----------------------------
Shopify Metafields probably seem quite inaccessible or complex at first glance but they’re actually quite handy and easy to use once you understand a few things.
Metafields allow you to store additional information on Liquid objects which you can output to your storefront during theme development using the metafields object.
Put in other words, Metafields are like custom fields that you can create in addition to the standard fields available on an object.
Check out my stuff online...
My Skillshare.com channel:
www.skillshare.com/r/profile/...
My travel channel:
/ christhefreelancer
My website:
christhefreelancer.com
My socials:
Instagram: / christhefreelancer
Facebook: / christhefreelancer
Twitter: / chrisrdodd

Пікірлер: 75

  • @CodewithChristheFreelancer
    @CodewithChristheFreelancer3 жыл бұрын

    Correction: %2C is the ASCII version of comma (,) not ampersand (&). Sorry, didn’t catch that one before publishing. Also, while product.images does still work, the modern version is product.media, just thought I’d mention that as well! Any other questions, let me know!

  • @mitchellbarnow1709

    @mitchellbarnow1709

    3 жыл бұрын

    Awesome video, Chris! I'm really glad to see how successful and hopefully happy that you have become!

  • @zdenekmakarov4627
    @zdenekmakarov46272 жыл бұрын

    Thank you Chris, just what I needed 👏👏

  • @jefwright8460
    @jefwright84603 жыл бұрын

    Awesome video! Super helpful. Thank you so much for the info.

  • @jdoogaming1575
    @jdoogaming15753 жыл бұрын

    Great vid. This is exactly what I needed. Thank you.

  • @danyaalhallak4992
    @danyaalhallak49922 жыл бұрын

    Thank you so much ! so helpful

  • @shopifythemesolutions.9190
    @shopifythemesolutions.91903 жыл бұрын

    WOW WOW WOW, thank you very much :)

  • @shopifythemesolutions.9190

    @shopifythemesolutions.9190

    3 жыл бұрын

    Hey, what if I want to edit the metafields again from the bulk editor. When I reenter the URL, what it does, actually reset all the values to null, can you confirm?

  • @TheNewton
    @TheNewton3 жыл бұрын

    Note: A new feature metafield definitions is being released to stores as another method of handling mf's, see /admin/settings/metafields if it's been enabled on your store early.

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    3 жыл бұрын

    Hi Paul. Bear with me. I will be addressing the announcements that were made recently at Shopify Unite shortly.

  • @jimjoco649

    @jimjoco649

    2 жыл бұрын

    that's nice to know. thanks

  • @KmillionaryShopifyExperts
    @KmillionaryShopifyExperts3 жыл бұрын

    Hi Chris! Is there a way to add extra fields in the checkout page, in order to get more information from the customers? For example, here in Guatemala we need extra fields for Tribute tax number.

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    3 жыл бұрын

    Hi Kmillionary. You can have metafields and custom order attributes on the order object. Metafields are something you only set in the admin so it would have to be order attributes. See here for documentation: shopify.dev/docs/themes/liquid/reference/objects/order It's likely however that you won't be able to do this on the checkout page as the checkout.liquid template is only editable on Shopify Plus. You can however take these attributes on the cart page (before the checkout page).

  • @thomasvareilhes2861
    @thomasvareilhes28612 жыл бұрын

    Hey Chris, thanks a lot for this video, very instructive. What's the way to go for Customer metafields? For instance if I want to add a customer status for a loyalty program let's say "gold" "silver" or "diamond" ?

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    2 жыл бұрын

    Have you tried using the url structure I show in the video but changing the resource name to 'Customer' ?

  • @jomotioncreative
    @jomotioncreative2 жыл бұрын

    Great video! Question: Does this method only default to text content? How would I add and manage both a multiline_text field and file (image) field with the bulk editor (the old way)? Thanks!

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    2 жыл бұрын

    Yep. I believe all metafields (even since OS2.0) are simply stored as one line of text so you would need to code in the line breaks into the metafield value. As for the images, you'll need to upload the image somewhere and then you can use a metafield to store the path (url) to the image.

  • @catboxer8257
    @catboxer82572 жыл бұрын

    Thanks for making this video! Is there a way to add by product variant via the url?

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    2 жыл бұрын

    Don't think so. Just add the variant on product's admin page.

  • @lesellc7246
    @lesellc72463 жыл бұрын

    Hi Chris, Great Video !!!!. Is there a way to remove metafields? Let's say I created by mistake or not needed anymore.

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    3 жыл бұрын

    Hi Lese. Removing a metafield is as simple as clearing the contents of that field.

  • @juanbarake7387
    @juanbarake73872 жыл бұрын

    Hey Chris, have you figured out a way to add an order metafield input box at checkout for orders?

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    2 жыл бұрын

    It's not clear what you mean by that Juan but you can add custom order properties without using metafields iliashaddad.medium.com/how-to-add-custom-properties-to-your-shopify-order-using-the-line-item-150c580f656e

  • @manuelasabatino6782
    @manuelasabatino67822 жыл бұрын

    Hi, very interesting your tutorial. Do you know if I can create a plugin where I create a metafield for a checkout page and I add a javascript component to this metafield? The component would make some API calls to get autosuggested address words.

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    2 жыл бұрын

    Not sure if you can use metafields in the checkout (especially if not on Shopify Plus) but by 'plugin' I suspect you are referring to an 'app'. Shopify recently announced 'checkout apps' which are able to interact with your checkout. I'd suggest looking into that. Examples on the app store: apps.shopify.com/collections/checkout

  • @casaceramica7102
    @casaceramica71022 жыл бұрын

    Thanks for your great videos! I am considering purchasing an OS 2.0 theme, but would like to hear if it is possible with matefields, or otherwise resolve the following issue. I sell tiles, in whole boxes these boxes contain different amount of square meters based on size and manufacturer. We price set our tiles, based on square meter price, and not box price. It has not yet been possible for me to solve it, to such an extent that customers get the right price based on the quantity they order. Since the current set up is based on piece quantities and not square meters. Looking forward to hearing from you Best Adam

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    2 жыл бұрын

    Hi Adam. I recommend you check out this video which talks about how Online Store 2.0 is not a separate system. kzread.info/dash/bejne/gYul07ehfMeuZ84.html If you wanted to put a definition on an 'Online Store 2.0 theme', it would just be a theme with JSON templates. All of OS2.0's features now apply regardless of what theme you are using.

  • @drmrboi311
    @drmrboi3112 жыл бұрын

    Hey Chris, great info. Not sure if the question was already asked. But I have thousands of products on my site. I want to add an estimated restock date to items that are back-ordered. I went to the bulk editor but I don't see a way for me to upload all the dates via a CSV file. Is there a way to do this? Otherwise, I see myself having to manually input these attributes, which can change on a daily basis.

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    2 жыл бұрын

    Never tried it but what objects are available in the order printer templates? Is it just line_item?

  • @marcinurbanski1298
    @marcinurbanski12983 жыл бұрын

    Hi Chris, great video. Do you know if I can filter products by them?

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    3 жыл бұрын

    Using Shopify's native filtering system: I don't think so. I wrote an article on filtering in Shopify here if you're interested: christopherdodd.com/shopify-collection-filtering/

  • @RachelCornishExtra

    @RachelCornishExtra

    3 жыл бұрын

    @@CodewithChristheFreelancer Thanks for such a quick reply and for the link. I have build the filters myself using tags but struggling with filtering by price. I know I can create tags ($10 - $20) and filter by them but I would like to use range slider from min price to max price. Do you know any tips and trick that can help with this?

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    3 жыл бұрын

    That will be a bit tricky but I believe it would be possible. Think you would have to define each possible range as it's own tag.

  • @souvikmitra1607
    @souvikmitra16072 жыл бұрын

    Hi Chris can u make a video on line item like emgraving on product page to be displayed on Dawn cart, tried diff things but not working

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    2 жыл бұрын

    It's just cart attributes my man. ui-elements-generator.myshopify.com/pages/cart-attribute

  • @lesellc7246
    @lesellc72463 жыл бұрын

    HI, How would I go about displaying the content of the metafields on Order confirmation email and packing list?

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    3 жыл бұрын

    Never tried it but I found this article via a quick Google search: community.shopify.com/c/Shopify-APIs-SDKs/Insert-metafields-in-order-email-notifications/td-p/148358

  • @dvaldesr
    @dvaldesr2 жыл бұрын

    any chance to show the metafields in the packinglist using order printer app?

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    2 жыл бұрын

    Are you talking about the order printer app?

  • @allmamalove
    @allmamalove Жыл бұрын

    Does this work for the Supply theme? Also what if you large inventory of products is there an easier way and for selective products?

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    Жыл бұрын

    This is a backend thing. It works on all themes. For the second part of your question, check out the new way of doing metafields (I have a video on this also)

  • @luckysales8558
    @luckysales85583 жыл бұрын

    Hi Chris, is it possible for customers to upload a picture at the checkout page?

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    3 жыл бұрын

    There is an option to add a file input to your add to cart form. See here: kzread.info/dash/bejne/hXuoppiJm8SfhZM.html

  • @sahilmulla1680
    @sahilmulla16803 жыл бұрын

    You can get to the bulk editor through admin > products > select a product (check box on the left) > edit

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    3 жыл бұрын

    Ah nice! Still need to add the metafield to the url though but good to know 👍

  • @sahilmulla1680

    @sahilmulla1680

    3 жыл бұрын

    @@CodewithChristheFreelancer Yep! Is there a way to change the field type like a drop-down or something? More importantly can we add a field to blog pages to hide them from indexing using an if statement?

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    3 жыл бұрын

    Hey Sahil. What do you mean by 'field type'? As for hiding pages from indexing, I'm assuming you mean from an SEO perspective? As this is more of a binary thing (it either hides or it doesn't) you could just use an if statement that checks for the handle of the post.

  • @sahilmulla1680

    @sahilmulla1680

    3 жыл бұрын

    @@CodewithChristheFreelancer Hi! By field type I meant a drop-down or something like the availability status etc options have but that isn't mandatory. Regarding the use of handle it might be a bit cumbersome to add every handle that you want to hide. So instead I think making a metafield and checking if that contains a specific character etc would be better and we won't have to touch the code each time we add a blog or something

  • @muscularavocado3547
    @muscularavocado35473 жыл бұрын

    Did I just miss it? Is there a way afterwards to add the metafield into the admin editor interface? I am looking to have a option to remove ingredients, but the names of the ingredients will depend on the product. Im looking for the option to change ingredients in the admin. Is this possible?

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    3 жыл бұрын

    Hi Bailey. You can use the same editor to update the contents of the metafield whenever you like. (I start typing the url at 5:06)

  • @muscularavocado3547

    @muscularavocado3547

    3 жыл бұрын

    @@CodewithChristheFreelancer Thanks Chris! Here's what I was able to do: I gave each Milkshake a "Removeable Items" metafield and for the value put it in as a string "Item 1, item 2, item 3" (each milkshake has a different amount of removable items) On the product page, I parsed the items by commas, and created a button for each item. So now I have buttons to remove each item! :) Thanks so much!

  • @mattm501
    @mattm5013 жыл бұрын

    Is there a way to set this up to work with Blogs ??

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    3 жыл бұрын

    The documentation says that Metafields are available on blogs but perhaps not on blog posts. I'd replace 'Product' in the url with 'Article' and see what happens.

  • @WeiXin729
    @WeiXin7292 жыл бұрын

    Hi, Chris, can I ask you a question? Create collection in Shopify, can you tell me what the code is? thank you very much.

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    2 жыл бұрын

    You can create a collection in the admin. No code required.

  • @WeiXin729

    @WeiXin729

    2 жыл бұрын

    @@CodewithChristheFreelancer Creating 'Product Sets' in Shopify What is the code you mentioned in this post? Can you help me?

  • @tonytullemans613
    @tonytullemans613 Жыл бұрын

    This has completely changed in the latest version of Shopify.

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    Жыл бұрын

    Hence why 'The Old Way" is written in the title. Check out my newer video on the subject.

  • @x99270
    @x992703 жыл бұрын

    Can we add stripe payment to our shopify?

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    3 жыл бұрын

    stripe.com/partners/shopify

  • @flaviomauri
    @flaviomauri3 жыл бұрын

    Mmh if there's a page like that, for which we have to write the address manually...wouldn't it be possible to create a simple tool to redirect us to that page? ie: a form on even a local webpage where one would fill in as many metafields as necessary, hit submit, and get directed there?

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    3 жыл бұрын

    If you're talking about a regular user (customer) of the website then no as you need to be an admin to access that page. If you are talking about admins, then yeah, for sure that's possible.

  • @flaviomauri

    @flaviomauri

    3 жыл бұрын

    @@CodewithChristheFreelancer Thanks! I failed to mention I was thinking of a tool to make life easier for developers ;)

  • @HARPREETKAUR-fn9dx
    @HARPREETKAUR-fn9dx3 жыл бұрын

    Hi, I am creating a website for doctors where customer can book appointment and make payment. Please suggest an app in shopify to do so...

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    3 жыл бұрын

    Hi Harpreet. I would probably use a third-party solution for that, wouldn't need to be Shopify specific.

  • @RajeshGupta-os5cy

    @RajeshGupta-os5cy

    3 жыл бұрын

    I think you should go with WordPress CMS

  • @misskevine5503
    @misskevine55033 жыл бұрын

    I literally tried this 11 times, and it's saying page not found! Am I the only one?? I don't understand what I am doing wrong

  • @CodewithChristheFreelancer

    @CodewithChristheFreelancer

    3 жыл бұрын

    What url are you using? It's probably a typo.