【问题标题】:Always get Nil Returned When Querying Customers with Shopify_API Gem使用 Shopify_API Gem 查询客户时总是返回 Nil
【发布时间】:2014-12-05 13:38:59
【问题描述】:

我正在尝试为我的 shopify 开发实例获取所有客户的列表,但无论我如何使用 Shopify_API Gem 构建客户 API 调用,我总是返回 Nil。

customers = ShopifyAPI::Customer.all 返回 nil.findparams 的变体也是如此。而示例products = ShopifyAPI::Product.all 返回所有products。根据文档,我应该能够让客户回来,但我不能......我的 shopify 实例中有 5 个。

我将应用设置为私有应用,并为 shopifyAPI 设置 base.site,如下所示 ShopifyAPI::Base.site = "https://apikey:password@storename.myshopify.com"

任何帮助将不胜感激。

【问题讨论】:

    标签: ruby-on-rails ruby shopify


    【解决方案1】:

    我的客户查找器始终有效...我使用的与您略有不同。以此为例,让您继续前进。

     ShopifyAPI::Customer.find(:first, :from => :search, :params => { :q => "email:#{customer['email']}" })
    

    【讨论】:

    • 谢谢,在我第 10 次重新设置我的 rails 和 shopify API 之后。它现在似乎起作用了。即使是我最初的 Customer.all 电话。老实说,我不知道是什么修复了它,可能是一个过时的宝石或类似的东西,没有正确安装。我假设它在某种程度上与 Activeresource gem 有关。感谢您的帮助,尽管我很感激。
    猜你喜欢
    • 1970-01-01
    • 2017-03-28
    • 2015-03-05
    • 2014-08-25
    • 2016-05-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多