Answers.Body: <p>Have you looked into building an adjuster for this purpose? You can find the documentation <a href="https://craftcommerce.com/docs/adjusters" rel="nofollow noreferrer">here</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-10T08:34:25.267Z
Answers.LastActivityDate: 2017-09-10T08:34:25.267Z
Answers.UserDisplayName: Andris Sevcenko
Body: <p>I want to change the total amount programatically before the payments are processed. </p>
  
  <p>If the total amount is $1000 I want to give a discount based on a point system in the users profile. You can add the desired amount based on his total points. If he adds 20 he gets a $20 discount and only have to pay $800. </p>
  
  <p>What is the best way to implement this? I have tried with <code>commerce_transactions.onCreateTransaction</code> but no luck.</p>
  
Tags: <plugin-craftcommerce>
Title: How to change/discount total amount before payment
ThreadText: # How to change/discount total amount before payment
  
  (Asked by: username_0 on 2017-09-08)
  
  I want to change the total amount programatically before the payments are processed.
  
  If the total amount is $1000 I want to give a discount based on a point system in the users profile. You can add the desired amount based on his total points. If he adds 20 he gets a $20 discount and only have to pay $800.
  
  What is the best way to implement this? I have tried with `commerce_transactions.onCreateTransaction` but no luck.
  
  **Tags:** plugin-craftcommerce
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-09-10. Score: 2
  
  Have you looked into building an adjuster for this purpose? You can find the documentation [here](https://craftcommerce.com/docs/adjusters)
  
  
  ---
  
  