Answers.Body: <p>What version are you on - I just checked a 4.6.6 site &amp; a contact with a home address (only) is getting the prefill - although if you change processor that form is not prefilling. (there is an open ticket about that )</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-06T11:26:49.533Z
Answers.Text: Thanks Eileen, I am on 4.6.6. and you are correct it prefills the name &  address data if I go from person's profile > Contribution > Submit Credit card contribution. it works, Even that person only has home/primary address & NO billing address.
  However it does not work if used the link from the left CREATE NEW> Contribution> Contribution (credit Card). Bug may be!!??
Answers.UserDisplayName: Tapash
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-06T11:54:33.303Z
Answers.Text: can you also please post the link of that open ticket you are talking about?
Answers.UserDisplayName: Tapash
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-06T11:16:23.923Z
Answers.LastActivityDate: 2015-08-06T11:16:23.923Z
Answers.UserDisplayName: eileen
Answers.Body: <p>You can remove the requirement of those fields using <code>hook_civicrm_buildForm()</code> - see <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/Hook+Reference" rel="nofollow">CiviCRM hook reference</a></p>
  
  <p>Here's <a href="https://forum.civicrm.org/index.php?topic=27856.0" rel="nofollow">an example from a couple of years ago</a>, although this was written for user-facing forms:</p>
  
  <pre><code>/**
   * Implements hook_civicrm_buildForm().
   */
  function example_civicrm_buildForm($formName, &amp;$form) {
    switch ($formName) {
      case 'CRM_Contribute_Form_Contribution_Main':
        $fields_not_required = array(
          'billing_first_name',
          'billing_middle_name',
          'billing_last_name',
          'billing_street_address-5',
          'billing_city-5',
          'billing_state_province_id-5',
          'billing_postal_code-5',
          'billing_country_id-5',
        );
        foreach ($fields_not_required as $field) {
          $form-&gt;_paymentFields[$field]['is_required'] = FALSE;
        }
        break;
    }
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-06T11:28:39.210Z
Answers.Text: sorry, if my question was not clear. I am not trying to avoid entering the address data, rather want to prefill from the existing address of contact profile.
Answers.UserDisplayName: Tapash
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-06T12:19:27.523Z
Answers.Text: The code above doesn't do what you want then, but perhaps you could build on it to pre-fill the data as you desire instead of changing the field's required setting.
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-06T11:16:06.503Z
Answers.LastActivityDate: 2015-08-06T11:16:06.503Z
Answers.UserDisplayName: Chris Burgess
Body: <p><a href="https://i.sstatic.net/JAQLK.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/JAQLK.png" alt="enter image description here"></a>
  Although selected contact has an address in his profile (But No Billing address). It would be useful to have a tick box saying "same as home/primary address", admin doesn't need to type in all the info again. Can anyone suggest how to do it in a quick way?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-06T11:16:29.350Z
Comments.Text: CiviCRM thinks you need a street address because some credit card companies require it; if your CC processor is one of those (I've never hit one myself), then omitting the values might fail submission.
Comments.UserDisplayName: Chris Burgess
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-06T11:22:03.457Z
Comments.Text: Thanks. But my point is how to prefill the address & name info in the billing block. As we can see from the form street address is mandatory filed for paypal pro.
Comments.UserDisplayName: Tapash
Tags: <addresses><paypal>
Title: A tick box "same as home/primary address" when submitting Event/Contribution from Admin using paypal pro. way to fix it?
ThreadText: # A tick box "same as home/primary address" when submitting Event/Contribution from Admin using paypal pro. way to fix it?
  
  (Asked by: username_0 on 2015-08-06)
  
  [![enter image description here](https://i.sstatic.net/JAQLK.png)](https://i.sstatic.net/JAQLK.png)
  Although selected contact has an address in his profile (But No Billing address). It would be useful to have a tick box saying "same as home/primary address", admin doesn't need to type in all the info again. Can anyone suggest how to do it in a quick way?
  
  **Tags:** addresses, paypal
  
  > **Comments:**
  > **username_1**: CiviCRM thinks you need a street address because some credit card companies require it; if your CC processor is one of those (I've never hit one myself), then omitting the values might fail submission.  
  > **username_0**: Thanks. But my point is how to prefill the address & name info in the billing block. As we can see from the form street address is mandatory filed for paypal pro.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2015-08-06. Score: 1 | Accepted answer
  
  What version are you on - I just checked a 4.6.6 site & a contact with a home address (only) is getting the prefill - although if you change processor that form is not prefilling. (there is an open ticket about that )
  
  > **Comments:**
  > **username_0**: Thanks username_2, I am on 4.6.6. and you are correct it prefills the name &  address data if I go from person's profile > Contribution > Submit Credit card contribution. it works, Even that person only has home/primary address & NO billing address. However it does not work if used the link from the left CREATE NEW> Contribution> Contribution (credit Card). Bug may be!!??  
  > **username_0**: can you also please post the link of that open ticket you are talking about?  
  
  ---
  
  ### Answer by username_1 on 2015-08-06. Score: 1
  
  You can remove the requirement of those fields using `hook_civicrm_buildForm()` - see [CiviCRM hook reference](http://wiki.civicrm.org/confluence/display/CRMDOC/Hook+Reference)
  
  Here's [an example from a couple of years ago](https://forum.civicrm.org/index.php?topic=27856.0), although this was written for user-facing forms:
  
  ```
  /**
   * Implements hook_civicrm_buildForm().
   */
  function example_civicrm_buildForm($formName, &$form) {
    switch ($formName) {
      case 'CRM_Contribute_Form_Contribution_Main':
        $fields_not_required = array(
          'billing_first_name',
          'billing_middle_name',
          'billing_last_name',
          'billing_street_address-5',
          'billing_city-5',
          'billing_state_province_id-5',
          'billing_postal_code-5',
          'billing_country_id-5',
        );
        foreach ($fields_not_required as $field) {
          $form->_paymentFields[$field]['is_required'] = FALSE;
        }
        break;
    }
  }
  
  ```
  
  > **Comments:**
  > **username_0**: sorry, if my question was not clear. I am not trying to avoid entering the address data, rather want to prefill from the existing address of contact profile.  
  > **username_1**: The code above doesn't do what you want then, but perhaps you could build on it to pre-fill the data as you desire instead of changing the field's required setting.  
  
  ---
  
  