Shopify Metafields - How to use them in Shopify Liquid code

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ส.ค. 2024
  • Wanna go deeper into Shopify Theme Development? Join my mastermind community.
    shopifythemede...
    Or sign up for a free trial with Skillshare and take my Shopify class for free:
    skl.sh/2MCrJIE
    Do you run a business on Shopify and want help with your store? Get in contact
    form.typeform....
    Episode Overview
    -----------------------------
    The metafields system in Shopify is something that has been continually evolving since Online Store 2.0 in 2021.
    While all the changes might sound kinda simple, it’s further complicated how we use metafields in Shopify Liquid. So in this video, let’s take a refreshed look at how to use metafields within Shopify Liquid code.
    My Other Videos Mentioned
    ---------------------------------------------
    My first video on Metafields
    • Shopify Metafields: Ho...
    Metafields since Online Store 2.0
    • Shopify Metafields: Ho...
    Shopify Editions Summer 2023 Recap
    • Shopify Editions - Wha...
    Check out my stuff online...
    My Skillshare.com channel:
    www.skillshare...
    My travel channel:
    / christhefreelancer
    My website:
    christhefreela...
    My socials:
    Instagram: / christhefreelancer
    Facebook: / christhefreelancer
    Twitter: / chrisrdodd

ความคิดเห็น • 54

  • @ginacostanzo4005
    @ginacostanzo4005 ปีที่แล้ว +4

    I have literally spent the entire day trying to figure out how to access metaobject data referenced in a metafield... THANK YOU!!!

    • @KnivesandStones
      @KnivesandStones 6 หลายเดือนก่อน

      I spent two days before finally stumbling this video, great work!

  • @hortology
    @hortology 5 หลายเดือนก่อน +1

    Thanks for demystifying this, you have just opened up a world of possibilities for using metaobjects, much appreciated

  • @christophernelson2261
    @christophernelson2261 27 วันที่ผ่านมา

    Chris thank you! It feels rewarding combing through all the dropshipping crap to finally get some dev advice on how to implement these solutions.

  • @ProjectorPeople
    @ProjectorPeople 3 หลายเดือนก่อน

    Excellent tutorial. Perfectly explained.

  • @oscarcrisanto3072
    @oscarcrisanto3072 หลายเดือนก่อน

    This has change from the time the video was uploaded to now July 2024 in order to access an image via metafields, you now have to add image_url separated by "|" and then add image_tag the img has been dropped in recent updates to shopify 2.0

  • @diegotaylor8547
    @diegotaylor8547 ปีที่แล้ว

    Hi Chris, I found that you got a new TH-cam avatar, cool! Glad you're back! In fact, maybe 1 or 2 days ago, I was thinking about posting a comment in any of your TH-cam videos to make sure you're fine. It has been 3 months since your last update! I suggest update at least once each month :)

    • @CodewithChristheFreelancer
      @CodewithChristheFreelancer  ปีที่แล้ว

      I've been a bit busy sorry! Two more videos are in the works and should be out soon though ;)

  • @tet726
    @tet726 ปีที่แล้ว

    I really appreciated this video. In Japan, to use Shopify is in the minority so there's no one who I can ask for help.

  • @supportmyappsmarket2576
    @supportmyappsmarket2576 ปีที่แล้ว +2

    I am the first person who like & comment the video

  • @RyanLeeLab
    @RyanLeeLab 9 หลายเดือนก่อน

    Hi I subscribed today. Thank you for all valuable information for Shopify users.

  • @kovid.rathee
    @kovid.rathee 6 หลายเดือนก่อน +1

    Great tutorial!

  • @dimavavilov7737
    @dimavavilov7737 10 หลายเดือนก่อน

    Thank you so much! You helped me with my problem

  • @eloctinar
    @eloctinar 5 หลายเดือนก่อน

    good stuff, thanks!

  • @JayZambrano
    @JayZambrano ปีที่แล้ว +1

    Hey Chris. Thanks for sharing, pretty userful! I'd like to have the ability to create repeatable groups of metafields. Do you know if Shopify is making this possible?

  • @freeskierjim
    @freeskierjim 10 หลายเดือนก่อน

    Chris, thanks for the informative video. Is there a way to match search keyword / search query to shopify product title? In other words, make the shopify product title dynamic?

  • @rayediaz
    @rayediaz ปีที่แล้ว

    Very helpful!

  • @user-mn9xz8tl7b
    @user-mn9xz8tl7b 11 หลายเดือนก่อน

    thanks buddy

  • @PuffyCloud-qq6gn
    @PuffyCloud-qq6gn 2 หลายเดือนก่อน

    Hi, thank you for that. I am trying to add a metafield into a liquid code, but I could not grasp in the end which piece of code in your file I’d have to add to this liquid code? I basically have a weather widget on a page template on which Id like to replace the coordinates with a metafield, the location is set up as a simple line text field. I have set up your page template, and added the metafield, it shows this particular location, but then how do I add this to the Shopify Liquid code section? There is the widget code. Do I just replace the location coordinates in the widget code, with the metafield name? I am probably wrong, but I sort of missed the link to the shopify liquid code section there. Thank you!

    • @CodewithChristheFreelancer
      @CodewithChristheFreelancer  2 หลายเดือนก่อน

      How did you build the widget? Or is it generated via an app you have installed on your store?

  • @giacomobaggio7313
    @giacomobaggio7313 6 หลายเดือนก่อน

    Hi there, nice video!
    Do you know if it possible to access the definition from a metafield object in Liquid? I have to work with the validations of the metafield definitions but I'm not able to get them

    • @CodewithChristheFreelancer
      @CodewithChristheFreelancer  6 หลายเดือนก่อน

      The only access you have to the field is through the metafield object. Why do you need to read the validations for specific metafields?

  • @elitheasian
    @elitheasian ปีที่แล้ว

    Hi Chris, metafields and metaobjects are without a doubt very useful! But when you have a store with hundreds of unique products, how do you automatically add metafields to products via csv imports or rules? I’m having trouble finding a solution that does not require an external app…

    • @CodewithChristheFreelancer
      @CodewithChristheFreelancer  ปีที่แล้ว

      Unless the option exists in the Shopify admin, the only alternative is to use (or build) an app.

  • @danieledepaolis5259
    @danieledepaolis5259 ปีที่แล้ว

    Hey Chris, thanks for the informative video. I have a question on metafields for products: I have 1 SKU with different prices. Below the original price it lets me decide if I want to charge the tax on top of the price, by simply checking the box. But it doesn't let me to do the same for the each of the prices that I set up with metafields. The problem is that I don't want to charge tax on the original price, but I do want to charge the tax on the metafield price. How can I solve this? Thanks in advance!

    • @CodewithChristheFreelancer
      @CodewithChristheFreelancer  ปีที่แล้ว

      Hey Daniel. This is a bit of a unique case. If you send me a message on Patreon I can take a look for you.
      www.patreon.com/shopifydeveloper

  • @xyzxyz324
    @xyzxyz324 9 หลายเดือนก่อน

    I tried to create a metafield for choosing some of the collections from my entire collections. I managed to choose them but when i go to the custom page, when i connect as dynamic resource, to show them in a collection list, its giving error that no references are selected. What may be the cause ? How many definitions should i create in a metatag

    • @CodewithChristheFreelancer
      @CodewithChristheFreelancer  9 หลายเดือนก่อน

      "giving error that no references are selected" - what do you mean by this? Is the error in your console? What does it say exactly?

  • @adamstorey8251
    @adamstorey8251 9 หลายเดือนก่อน

    Will this help or is there a way to code in more metafields ? thank you,

  • @albi55uk
    @albi55uk 5 หลายเดือนก่อน

    Your only aloud 20 Metafields, is there a way to add more?

  • @thebizyman1
    @thebizyman1 ปีที่แล้ว

    Hi Chris, really enjoy your videos. Can a customer metafield be exposed for an integration with say Jotform? I'm collecting a field in Jotform that does not existing in shopify but want to populate it to a metafield. Is that possible by creating a customers.metafield?

    • @CodewithChristheFreelancer
      @CodewithChristheFreelancer  11 หลายเดือนก่อน

      You can expose it but only via the Admin API I believe. That's why you need an app in order to receive any data from a user (beyond the normal user input),.

  • @merihdecember4058
    @merihdecember4058 7 หลายเดือนก่อน

    Hey Chris, thank you for these great tutorials. We are using a vintage shopify theme and trying to upgrade it to version 2.0 The confusing part is the "create template" feature. If we cannot create a template in the vintage version (which is the live version), how can we make it visible in the preview theme (new version is not published yet)? Would creating a new template in the templates section in the backend of the vintage theme work?

    • @ChristheFreelancer
      @ChristheFreelancer 7 หลายเดือนก่อน

      Why can't you create a template?

    • @merihdecember4058
      @merihdecember4058 7 หลายเดือนก่อน

      You can only create a metaobject template but not a template from the dropdown menu in the 3.4.0. version it seems. So I created a template manually in the backend and it shows up in the drop down menu in the live version. But it doesn't show up in the preview theme which is version 11. I'm also on skillshare following your classes, so if I'm missing something you can refer to a video there as well!

    • @ChristheFreelancer
      @ChristheFreelancer 7 หลายเดือนก่อน

      @@merihdecember4058 did you also create the template (manually) on the preview version?

    • @merihdecember4058
      @merihdecember4058 7 หลายเดือนก่อน

      @@ChristheFreelancer Yes I did. The old version of the theme has the default collection template in liquid and the new version has it in json. When I create the same file in both versions either it can't pull the collection data, showing nothing but only the header and footer or a pile of code. I've been trying to re-create the json file in the old version and also added all the sections the json code is referring to but no luck :(

    • @CodewithChristheFreelancer
      @CodewithChristheFreelancer  7 หลายเดือนก่อน

      Looks like my reply didn't come through so I'll write it again. If you send me a video explaining the issue to my email chris@christhefreelancer.com, I'll take a look asap as what you're describing should not be happening.

  • @vishvajitkumar9497
    @vishvajitkumar9497 9 หลายเดือนก่อน

    Hi chris nice video. can u explain how do i insert value in metafields from liquid file??

    • @CodewithChristheFreelancer
      @CodewithChristheFreelancer  8 หลายเดือนก่อน

      You mean you would like to give a user the ability to edit a metafield value on the frontend?

    • @vishvajitkumar9497
      @vishvajitkumar9497 8 หลายเดือนก่อน

      @@CodewithChristheFreelancer yes

    • @CodewithChristheFreelancer
      @CodewithChristheFreelancer  8 หลายเดือนก่อน

      That won't be possible without creating some kind of API that then connects to Shopify and inserts the data via the admin API. You can't do it with it Liquid.

  • @user-mb9zi6fi1o
    @user-mb9zi6fi1o 11 หลายเดือนก่อน

    how to add metafields into homepage?

  • @ApoorvDwivedi
    @ApoorvDwivedi ปีที่แล้ว

    Hi Chris, just out of the box question, is there a way by which i can edit the value of cart.total_price in cart.liquid so that checkout happens on the price i want to send

    • @CodewithChristheFreelancer
      @CodewithChristheFreelancer  ปีที่แล้ว

      haha no. You can use Shopify Liquid to modify data. You can of course change it's output by passing the original value through one or more filters but you cannot mutate the data via Liquid.

    • @ApoorvDwivedi
      @ApoorvDwivedi ปีที่แล้ว

      @@CodewithChristheFreelancer can u please make a video for that. I need to implement a code with conditions to give discounts if line item has more than 5 or 10 quantity in it.

  • @Salamaleikum80
    @Salamaleikum80 ปีที่แล้ว

    My Custom Data is named athlete, but for me the code doesn't say "page.metafields.custom.athlete" instead it only says athletes.first_name to access the first name field. But that doesn't work when I write {{athletes.first_name}} am I missing something?