Answers.Body: <p>When you call <code>craft.commerce.products</code> you're asking Craft for an <a href="https://craftcommerce.com/docs/product-model" rel="nofollow noreferrer">Commerce_ProductModel</a>. </p>
  
  <p>So you could sort by:</p>
  
  <ul>
  <li>title (alpha)</li>
  <li>defaultPrice</li>
  <li>type</li>
  <li>promotable (sale products on top)</li>
  <li>postDate (newest products)</li>
  <li>.. etc.</li>
  </ul>
  
  <p>To sort by sales (popularity), you might consider something like BonFire's <a href="http://www.hellobonfire.com/product/popular-products-plugin-for-craft" rel="nofollow noreferrer">Popular Products</a> plugin which keeps track of how many purchases were made and how many times the product was viewed, very similar to Ben Croker's <a href="https://www.putyourlightson.net/craft-entry-count" rel="nofollow noreferrer">EntryCount</a> plugin.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-07T21:22:07.930Z
Answers.Text: Glad it was helpful!
Answers.UserDisplayName: RitterKnight
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-07T17:04:22.767Z
Answers.LastActivityDate: 2017-10-07T17:04:22.767Z
Answers.UserDisplayName: RitterKnight
Body: <p>What are all the available options that products can be ordered by?</p>
  
  <p><code>craft.commerce.products({ order: '???' })</code></p>
  
  <p>I have found this reference <a href="https://craftcommerce.com/docs/products-fields#templating" rel="nofollow noreferrer">https://craftcommerce.com/docs/products-fields#templating</a> but it does not list the available options.</p>
  
  <p>Bonus points if it includes the key that sorts by sales (aka popularity).</p>
  
Tags: <plugin-craftcommerce><plugins>
Title: Commerce product order/sort options
ThreadText: # Commerce product order/sort options
  
  (Asked by: username_0 on 2017-10-06)
  
  What are all the available options that products can be ordered by?
  
  `craft.commerce.products({ order: '???' })`
  
  I have found this reference <https://craftcommerce.com/docs/products-fields#templating> but it does not list the available options.
  
  Bonus points if it includes the key that sorts by sales (aka popularity).
  
  **Tags:** plugin-craftcommerce, plugins
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-10-07. Score: 2 | Accepted answer
  
  When you call `craft.commerce.products` you're asking Craft for an [Commerce\_ProductModel](https://craftcommerce.com/docs/product-model).
  
  So you could sort by:
  
  * title (alpha)
  * defaultPrice
  * type
  * promotable (sale products on top)
  * postDate (newest products)
  * .. etc.
  
  To sort by sales (popularity), you might consider something like BonFire's [Popular Products](http://www.hellobonfire.com/product/popular-products-plugin-for-craft) plugin which keeps track of how many purchases were made and how many times the product was viewed, very similar to Ben Croker's [EntryCount](https://www.putyourlightson.net/craft-entry-count) plugin.
  
  > **Comments:**
  > **username_1**: Glad it was helpful!  
  
  ---
  
  