How do I update a variant price using shopify gem in rails 3.2.2?

陌路散爱 提交于 2020-01-05 09:14:08

问题


Rails 3.2.2 app, using the most recent shopify gem on github.

I've looked at other threads on the shopify google group that suggested switching ShopifyAPI::Base to use xml, but that had no effect. Simple script, updates a product's variant prices. This used to work, not sure when it stopped working, but script is identical to the old working version.

Essentially, if I set a variant price and compare_at_price, and then save, shopify does not reflect a change. The method returns true, however. Originally, the script simply called product.save at the end, but I've also tried saving the variants individually and no luck. Thanks for any help.


回答1:


This was a bug in Shopify, which has now been fixed.

It affected product updates through the API for shops that had inventory management enabled.

Please retest and confirm that it has been fixed by accepting this answer.




回答2:


I wasn't able to reproduce the problem.

If you provide us with a request id then we could lookup the request in our logs. You can obtain the request id using the following code just after save that isn't working.

ShopifyAPI::Base.connection.response['x-request-id']

What I can tell you is that:

  • You shouldn't need to use xml format (JSON tends to be faster)
  • You should be able to save changes on a variant or product


来源:https://stackoverflow.com/questions/10924734/how-do-i-update-a-variant-price-using-shopify-gem-in-rails-3-2-2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!