我试过了 coll = ShopifyAPI :: SmartCollection.find(id) coll.image = {" src" =>" ..."} 以及其他方法 - 似乎什么都没有用
答案 0 :(得分:1)
Shopify API docs提供了如何更新SmartCollection图像的示例:
collection = ShopifyAPI::SmartCollection.find(id)
collection.image = { attachment: "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n" }
collection.save
attachment
应为base64编码。
还应该可以指定Shopify应下载图像的src
。
collection = ShopifyAPI::SmartCollection.find(id)
collection.image = { src: "http://example.com/rails_logo.gif" }
collection.save