Answers.Body: <p>I just came across this question and we have solved a similar problem a few years ago, i.e. we want to count the total value of recurring contributions (e.g. a $10 recurring should count as much as a $120 one time).</p>
  <p>What we do is to rewrite the function used for computing the premium amount. The javascript is in <code>templates/CRM/Contribute/Form/Contribution/PremiumBlock.tpl</code> (copied in a custom extension).</p>
  <p>Simply adding the following to the function <code>get_amount</code> do the trick :</p>
  <pre><code>var isrecur = $('.is_recur_radio-section input:checked').val();
  if (isrecur == 1) amount = amount * 12;
  </code></pre>
  <p>I suppose it's possible to add some more complex logic.</p>
  <p>The fact that we need to update a core template file is not ideal for maintenance but it's a rather small change so it's easy to keep track of it and re-apply the change when we upgrade CiviCRM.</p>
  <p><strong>EDIT</strong> 2021-03-22</p>
  <p>The solution above is not enough: there is validation in <code>CRM/Contribute/Form/Contribution/Main.php</code> that require adjustment.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-18T14:54:40.587Z
Answers.LastActivityDate: 2021-03-22T13:15:52.893Z
Answers.LastEditDate: 2021-03-22T13:15:52.893Z
Answers.UserDisplayName: samuelsov
Body: <p>It seems like premiums only work on the minimum amount, without regard for other settings.  Is there a way to get around this?  I see the <a href="https://supporters.eff.org/donate/join-eff-4" rel="nofollow noreferrer">EFF</a> has this option, but their contribution page seems not to be generated by CiviCRM anymore.</p>
  
Tags: <contribution-page><premiums>
Title: Can I set a premium for a $20 minimum on a recurring contribution, but $80 for a one-time contribution?
ThreadText: # Can I set a premium for a $20 minimum on a recurring contribution, but $80 for a one-time contribution?
  
  (Asked by: username_0 on 2020-07-15)
  
  It seems like premiums only work on the minimum amount, without regard for other settings. Is there a way to get around this? I see the [EFF](https://supporters.eff.org/donate/join-eff-4) has this option, but their contribution page seems not to be generated by CiviCRM anymore.
  
  **Tags:** contribution-page, premiums
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-03-18. Score: 3
  
  I just came across this question and we have solved a similar problem a few years ago, i.e. we want to count the total value of recurring contributions (e.g. a $10 recurring should count as much as a $120 one time).
  
  What we do is to rewrite the function used for computing the premium amount. The javascript is in `templates/CRM/Contribute/Form/Contribution/PremiumBlock.tpl` (copied in a custom extension).
  
  Simply adding the following to the function `get_amount` do the trick :
  
  ```
  var isrecur = $('.is_recur_radio-section input:checked').val();
  if (isrecur == 1) amount = amount * 12;
  
  ```
  
  I suppose it's possible to add some more complex logic.
  
  The fact that we need to update a core template file is not ideal for maintenance but it's a rather small change so it's easy to keep track of it and re-apply the change when we upgrade CiviCRM.
  
  **EDIT** 2021-03-22
  
  The solution above is not enough: there is validation in `CRM/Contribute/Form/Contribution/Main.php` that require adjustment.
  
  
  ---
  
  