Answers.Body: <p>I'm a little unclear but I think you're looking for:</p>
  
  <pre><code>{% set products = craft.commerce.products.type('productTypeHandle').order('postDate desc') %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-04T02:21:08.513Z
Answers.LastActivityDate: 2016-12-04T07:08:32.530Z
Answers.LastEditDate: 2016-12-04T07:08:32.530Z
Answers.UserDisplayName: Luke Holder
Body: <p>Is there a way to dynamically get all the related products based on the product type?</p>
  
  <p>I seem to be getting all the products regardless of product type when I use:</p>
  
  <p><code>{% set products = craft.commerce.products.relatedTo(category).order('postDate desc') %}</code></p>
  
  <p>(obviously since I don't have any categories).</p>
  
Tags: <plugin-craftcommerce>
Title: relatedTo using product type?
ThreadText: # relatedTo using product type?
  
  (Asked by: username_0 on 2016-12-04)
  
  Is there a way to dynamically get all the related products based on the product type?
  
  I seem to be getting all the products regardless of product type when I use:
  
  `{% set products = craft.commerce.products.relatedTo(category).order('postDate desc') %}`
  
  (obviously since I don't have any categories).
  
  **Tags:** plugin-craftcommerce
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-12-04. Score: 1 | Accepted answer
  
  I'm a little unclear but I think you're looking for:
  
  ```
  {% set products = craft.commerce.products.type('productTypeHandle').order('postDate desc') %}
  
  ```
  
  
  ---
  
  