Shopify Apps / Oauth Access / Get Products Correctly Sorted From A Collection
ProductsListing
and CollectionListing
aren't reachable from the oauth authentification (while building apps), those are reserved for plus-users.
The Smart collections of our store are sorted manually. I could not spot the correct way to retrieve the products of a collection correctly sorted
We're currently using the shopify_api
gem, but searched a lot, unable to find out.
Thanks for your help
Answer
There is an endpoint labelled:
/admin/smart_collections.json
Where you can easily interact with your Smart Collections. For example, if your collection is set to manual sorting, there is a PUT resource you can create to change the order of products. In the Shopify API gem under resources you will find SmartCollection.
To read products from your Smart Collection send the collection_id param to the Product endpoint. If Shopify does not return products in the collection sort order, you're screwed I guess.
Related Questions
- → Trigger a click with jQuery using link_to of rails 4
- → Adding html data attribute to simple_forms input
- → How to remove parameters from the root URL if it does I18n
- → passing parameters to rails back end from an ajax call
- → Blocking ?page= in robots.txt
- → react js and rails Updating state on a component with active record relationship
- → Kaminari How to process routes as javascript
- → State not passed into prop
- → Cannot read property 'modalIsOpen' of undefined
- → Objects not valid issue
- → How to map API params to model
- → Consuming webhooks shopify-api
- → How to add ScriptTag on shopify_api gem?