Answers.Body: <p>For a site using CiviCRM profiles you can opt to use Joinery's <a href="https://civicrm.org/extensions/profile-conditionals" rel="nofollow noreferrer">Profile Conditionals extension</a> and adapt the conditions to which you want this behavior to occur.</p>
  <p>For it be checked with any price field selected, an example is below:</p>
  <pre><code>&lt;?php
          
  $civicrm_setting['com.joineryhq.profcond']['com.joineryhq.profcond']['contribution']['all'] = array(
            '01_auto_renew_is_checked' =&gt; array(
              'conditions' =&gt; array(
                'all_of' =&gt; array(
                  array(
                    'selector' =&gt; 'input[name=&quot;price_7&quot;]',
                      'op' =&gt; 'is_checked',
                      ),
                    ),
                  ),
                  'states' =&gt; array (
                    'pass' =&gt; array (
                      'selectors'  =&gt; array(
                        'input#auto_renew[type=&quot;checkbox&quot;]' =&gt; array (
                          'properties' =&gt; array('checked' =&gt; TRUE),
                        ),
                      ),
                    ),
                    'fail' =&gt; array (
                      'selectors'  =&gt; array(
                        'input#auto_renew[type=&quot;checkbox&quot;]' =&gt; array (
                          'properties' =&gt; array('checked' =&gt; FALSE),
                        ),
                      ),
                    ),
                  ),
                ),
              );
  </code></pre>
  <p>Change out the price field (price_7) with yours. There are many ways to change the conditions based on your use case, you can find instructions on those options <a href="https://github.com/twomice/com.joineryhq.profcond?tab=readme-ov-file#configuration" rel="nofollow noreferrer">here</a>.</p>
  <p>I put this in it's own <code>profcond.settings.php</code> file in case you make a syntax error and want to quickly deactivate the conditionals to prevent it from breaking CiviCRM. Add <code>include __DIR__ . '/profcond.settings.php';</code> to <code>civicrm.settings.php</code> file for this setup.</p>
  <p>Also noting that recently there was a change in core that displays / unchecks the &quot;Please renew my membership automatically&quot; option when selecting a price option so using the &quot;onload&quot; option exclusively no longer works (tested 5.65 where that last worked).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-24T21:00:27.343Z
Answers.LastActivityDate: 2024-03-25T05:01:30.633Z
Answers.LastEditDate: 2024-03-25T05:01:30.633Z
Answers.UserDisplayName: Andy Burns
Answers.Body: <p>Unless things have changed I believe this requires a customisation. We did one a while back. I will check what effort is involved in getting it extracted in to an extension if there is not one 'out there'.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-07T08:53:01.720Z
Answers.Text: Hmm looks like the work we did doesn't properly deal with switching between Pay Later and CC. We could get this sorted if you are interested. PM me if you want an estimate. Don't expect it will take much
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-07T02:07:49.097Z
Answers.LastActivityDate: 2020-04-07T02:07:49.097Z
Answers.UserDisplayName: petednz - fuzion
Body: <p>We're running on Drupal 7.69 and Civi 5.13.x. </p>
  
  <p>Is there a way to have the option to autorenew ticked by default through configuration?</p>
  
  <p>See image below:
  <a href="https://i.sstatic.net/MdUrp.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/MdUrp.png" alt="enter image description here"></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-07T02:50:25.947Z
Comments.Text: So you always want the General membership to auto-renew? Or just check box on initial load and than let user un-select it if they wont like to auto-renew?
Comments.UserDisplayName: Pradeep Nayak
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-07T03:13:52.430Z
Comments.Text: This one Pradeep - "just check box on initial load and than let user un-select it if they wont like to auto-renew".
Comments.UserDisplayName: P Joseph
Tags: <civicontribute><contribution-page><recurring-contributions><auto-renew><condition>
Title: How do I automatically check the autorenewal option by default on a membership contribution page?
ThreadText: # How do I automatically check the autorenewal option by default on a membership contribution page?
  
  (Asked by: username_0 on 2020-04-07)
  
  We're running on Drupal 7.69 and Civi 5.13.x.
  
  Is there a way to have the option to autorenew ticked by default through configuration?
  
  See image below:
  [![enter image description here](https://i.sstatic.net/MdUrp.png)](https://i.sstatic.net/MdUrp.png)
  
  **Tags:** civicontribute, contribution-page, recurring-contributions, auto-renew, condition
  
  > **Comments:**
  > **username_1**: So you always want the General membership to auto-renew? Or just check box on initial load and than let user un-select it if they wont like to auto-renew?  
  > **username_0**: This one username_1 - "just check box on initial load and than let user un-select it if they wont like to auto-renew".  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2024-03-24. Score: 2
  
  For a site using CiviCRM profiles you can opt to use Joinery's [Profile Conditionals extension](https://civicrm.org/extensions/profile-conditionals) and adapt the conditions to which you want this behavior to occur.
  
  For it be checked with any price field selected, an example is below:
  
  ```
  <?php
          
  $civicrm_setting['com.joineryhq.profcond']['com.joineryhq.profcond']['contribution']['all'] = array(
            '01_auto_renew_is_checked' => array(
              'conditions' => array(
                'all_of' => array(
                  array(
                    'selector' => 'input[name="price_7"]',
                      'op' => 'is_checked',
                      ),
                    ),
                  ),
                  'states' => array (
                    'pass' => array (
                      'selectors'  => array(
                        'input#auto_renew[type="checkbox"]' => array (
                          'properties' => array('checked' => TRUE),
                        ),
                      ),
                    ),
                    'fail' => array (
                      'selectors'  => array(
                        'input#auto_renew[type="checkbox"]' => array (
                          'properties' => array('checked' => FALSE),
                        ),
                      ),
                    ),
                  ),
                ),
              );
  
  ```
  
  Change out the price field (price\_7) with yours. There are many ways to change the conditions based on your use case, you can find instructions on those options [here](https://github.com/twomice/com.joineryhq.profcond?tab=readme-ov-file#configuration).
  
  I put this in it's own `profcond.settings.php` file in case you make a syntax error and want to quickly deactivate the conditionals to prevent it from breaking CiviCRM. Add `include __DIR__ . '/profcond.settings.php';` to `civicrm.settings.php` file for this setup.
  
  Also noting that recently there was a change in core that displays / unchecks the "Please renew my membership automatically" option when selecting a price option so using the "onload" option exclusively no longer works (tested 5.65 where that last worked).
  
  
  ---
  
  ### Answer by username_3 on 2020-04-07. Score: 1
  
  Unless things have changed I believe this requires a customisation. We did one a while back. I will check what effort is involved in getting it extracted in to an extension if there is not one 'out there'.
  
  > **Comments:**
  > **username_3**: Hmm looks like the work we did doesn't properly deal with switching between Pay Later and CC. We could get this sorted if you are interested. PM me if you want an estimate. Don't expect it will take much  
  
  ---
  
  