简体   繁体   中英

Rails Gem Shopify_app not able to save new products to shop

Using the Shopify API and app gem I've created a valid session and activated it, but for some reason I cannot save a new product to the connected Shopify store. See code below

session = ShopifyAPI::Session.new(shop,token)
  if session.valid?
     ShopifyAPI::Base.activate_session(session)
       sellersku.each do |xyz|
         yours = find_by sellersku: xyz
         new_product = ShopifyAPI::Product.new
         new_product.title = yours.title
         new_product.product_type = yours.product_type
         new_product.vendor = yours.vendor
         new_product.body_html = yours.description
         new_product.images = yours.image
         new_product.save

end

希望您能告诉我们您究竟得到了什么错误,也请检查一下范围,它是否包含“ write_products”?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM