smart_collection.rb 457 B

12345678910111213141516171819
  1. module ShopifyAPI
  2. class SmartCollection < Base
  3. include Events
  4. include Metafields
  5. def products(options = {})
  6. if options.key?(:only_sorted)
  7. Product.find(:all, from: "/admin/smart_collections/#{id}/products.json", params: options)
  8. else
  9. Product.find(:all, params: { collection_id: id })
  10. end
  11. end
  12. def order(options={})
  13. load_attributes_from_response(put(:order, options, only_id))
  14. end
  15. end
  16. end