Ad

Use Shopify Price Rules Api To Create Discounts In RoR

- 1 answer

I am developing an app for shopify app store in RoR and trying to use Shopify's new PriceRules API. But I am not able to make it work. I am using shopify-app gem and for price rules api I tries using:

ShopifyAPI::PriceRule

ShopifyAPI::PriceRules

but it throws following error :

uninitialized constant ShopifyAPI::PriceRule

Does anyone has any idea on how can I make it work in Ror?

Thanks.

Ad

Answer

Do a bundle open shopify_api and examine the resources. You probably won't find the new-ish PriceRules endpoint. So you have to make it yourself or wait if you want the official Shopify one.

If you are using RoR, then you almost certainly are using bundler. An alternative is to open the Shopify Gem shopify_api, and you'll see all the resources currently supported. If you wanted to add PriceRules endpoint, hack it into that gem.

Ad
source: stackoverflow.com
Ad