question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Product Metafields

See original GitHub issue

Hi, How to get metafields of a product, please?

The Shopify api says:

GET /admin/products/#{id}/metafields/#{id}.json

or:

GET /admin/products/632910392/metafields.json

Cheers Marc

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16

github_iconTop GitHub Comments

2reactions
lpincacommented, Jan 17, 2017

Hi, try this.

const promise = shopify.metafield.list({
  metafield: { owner_resource: 'product', owner_id: 632910392 }
});
0reactions
UlisesCandela1commented, Feb 25, 2022

That’s correct. If you don’t need to get the created metafield back you can also use shopify.product.update() like this:

const promise = shopify.product.update(632910392, {
  id: 632910392,
  metafields: [
    {
      key: 'new',
      value: 'newvalue',
      value_type: 'string',
      namespace: 'global'
    }
  ]
});

this is giving me a 422 error, could you help me to figure out what’s going on?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Metafields - Shopify Help Center
Metafields enable you to customize the functionality and appearance of your Shopify store by letting you save specialized information that isn't usually ...
Read more >
Metafields - Shopify.dev
Metafields are a flexible way for your app to add and store additional information about a Shopify resource, such as a product, a...
Read more >
Shopify Product Metafields: How to Add Metafields to Your Store
The Product metafields in Shopify allow the store owners to upgrade their product page by adding special product details. Using the custom product ......
Read more >
Ultimate guide on using metafields in Shopify [Non-tech user]
1. In Shopify admin, go to Products > All products > choose the products you want to add more information through metafields. ·...
Read more >
Customize Your Products with Shopify Metafields - Metorik
The role of Shopify metafields is to allow you as the store owner to add extra information to parts of your store like...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found