Answers.Body: <p>This should do what you're looking for:</p>
  
  <pre><code>craft.commerce.discounts.getAllDiscounts()
  </code></pre>
  
  <p><code>craft.commerce.discounts</code> is a reference to <a href="https://github.com/craftcms/commerce/blob/develop/src/services/Discounts.php" rel="nofollow noreferrer"><code>services/Discounts</code></a>, so you've got access to all of the public methods in there, of which <code>getAllDiscounts()</code> is one.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-31T17:12:00.327Z
Answers.LastActivityDate: 2018-05-31T17:12:00.327Z
Answers.UserDisplayName: Brad Bell
Body: <p>I would like to retrieve all available discounts for an eshop using the Craft Commerce v2.
  In Craft Commerce v1, I could use the following:</p>
  
  <pre><code>craft.commerce.discounts.all()
  </code></pre>
  
  <p>However, I can't find an equivalent method for Commerce v2</p>
  
  <p>Can anyone please help?</p>
  
Tags: <plugin-craftcommerce><plugin-craftcommerce2>
Title: Is there a way to retrieve discounts for a product in Craft Commerce v2?
ThreadText: # Is there a way to retrieve discounts for a product in Craft Commerce v2?
  
  (Asked by: username_0 on 2018-05-31)
  
  I would like to retrieve all available discounts for an eshop using the Craft Commerce v2.
  In Craft Commerce v1, I could use the following:
  
  ```
  craft.commerce.discounts.all()
  
  ```
  
  However, I can't find an equivalent method for Commerce v2
  
  Can anyone please help?
  
  **Tags:** plugin-craftcommerce, plugin-craftcommerce2
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-05-31. Score: 0 | Accepted answer
  
  This should do what you're looking for:
  
  ```
  craft.commerce.discounts.getAllDiscounts()
  
  ```
  
  `craft.commerce.discounts` is a reference to [`services/Discounts`](https://github.com/craftcms/commerce/blob/develop/src/services/Discounts.php), so you've got access to all of the public methods in there, of which `getAllDiscounts()` is one.
  
  
  ---
  
  