Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating product metafields not working #1023

Open
wesleylathan opened this issue Feb 20, 2024 · 0 comments
Open

Creating product metafields not working #1023

wesleylathan opened this issue Feb 20, 2024 · 0 comments

Comments

@wesleylathan
Copy link

The store has a set of metafields that are surfaced in the Shopify UI. The code runs without error, but the meta fields aren't updated.

Here's a screen shot of the fields in shopify

image

Here's the code I'm using to do the update. If I manually enter values through the UI and can pull the metafileds using ShopifySharp, I'm just not able to update the values.

       public async Task<bool> UpdateMetaFields(TCGProduct tCGProduct) {
           long? productId = (long)tCGProduct.Id;
           var service = new MetaFieldService(ShopifyTokens.myShopifyUrl, ShopifyTokens.shopAccessToken);
           
           
           var metafield = new MetaField()
           {
               Namespace = "custom",
               Key = "tcgplayer_id",
               Value = tCGProduct.TCGplayerID,
               Type = "integer",
               Description = "TCGPlayer ID"
           };
           var bar = await service.CreateAsync(metafield, Convert.ToInt64(tCGProduct.Id), "products");
           Debug.WriteLine(bar.Id + " " + bar.Key);
           return true;

       }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants