d
Topic
Posts:
6
10 months ago

How to create a metafield on shopify site using api

I want to create metafield for a customer on shopify site when he logged in, i have gone through all forums, docs of shopify but no success, i found this link (http://www.shopify.com/technology/3032322-new-feature-metafields) where it can be done through api but i don't know how can i use api on liquid theme following example given on above url

<code>

product = ShopifyAPI::Product.find(148362461) 

product.add_metafield(ShopifyAPI::Metafield.new({ :description => 'product detail', :namespace => 'product', :key => 'user', :value => 'subscribed', :value_type => 'string' }))

</code>

Please guide me on this, how can i able to create a metafield using api.... Thanks in advance

i
Replies
Posts:
128
9 months ago

You can't access the API like that via liquid. The API is used to create apps that run on your own servers in your favourite programming language. Those apps can be either privately for just your shop or used by multiple shops in the App store.

Posts:
6
9 months ago

Can you send me link for PHP Programming language so i can use that api and how can i integrate that in Shopify apps ?

Posts:
128
9 months ago

You can learn more about the API here: http://docs.shopify.com/api and some PHP plugins that use the API can be found here: http://docs.shopify.com/api/libraries/php

Log in or sign up for an account to reply.

This thread has been closed! You will not be able to reply.