Answers.Body: <p>To my Knowledge:-</p>
  
  <p>For some reason billing address field selection is hard coded in core files</p>
  
  <p>getBillingAddressFields()</p>
  
  <p>so you are forced to list all the listed fields details - if you dont want to display specific details then:</p>
  
  <ul>
  <li>you need to overriding the core files 
  Or </li>
  <li>A JAVA script to hide the fields and unset the fields in formbuild </li>
  </ul>
  
  <p>I guess this helps !!!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-11T10:50:07.797Z
Answers.Text: Thanks Ramesh! I haven't yet reached the level needed to tweek CiviCRM using JS. It therefore seems easier taking the fields out of the Payment.php (somewhere around line 710++) - albeit having to redo that in a case of updates. Would you agree!? Cheers
Answers.UserDisplayName: Abteilung Gerontopsychiatrie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-11T11:16:50.717Z
Answers.Text: Indeed - will be the quicker option but need to make a note of the changes and also need to test in all the possible way –
Answers.UserDisplayName: Ramesh - ARTECH Consultancy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-02T15:31:18.740Z
Answers.Text: I looked through all the Payment.php files I could find in 4.7.22 and couldn't spot any fields with 'postal' in them. Any ideas? 
  Also, the main file generating the payment block treats all fields as required;  there's no apparent opportunity to make individual fields required or not. See CRM/Core/Payment/Form.php, around li 135. Forgive me if I'm missing something completely obvious here... :)
Answers.UserDisplayName: Andyg8
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-10T17:06:25.043Z
Answers.LastActivityDate: 2016-11-10T17:06:25.043Z
Answers.UserDisplayName: Ramesh - ARTECH Consultancy
Answers.Body: <p>Thanks,
  I changed the file Core/Payment.php file at lines 863 and 901 for both credit cards and checks.</p>
  
  <p>You can set the paramaters that are needed for the billing address by adding comment in the <code>wp-content/plugins/civicrm/civicrm/CRM/Core/Payment.php</code>. For example for the middle name that we don't use in France:</p>
  
  <p>line 901 </p>
  
  <pre><code>/** $metadata['billing_middle_name'] = array( 'htmlType' =&gt; 'text', 'name' =&gt; 'billing_middle_name', 'title' =&gt; ts('Billing Middle Name'), 'cc_field' =&gt; TRUE, 'attributes' =&gt; array( 'size' =&gt; 30, 'maxlength' =&gt; 60, 'autocomplete' =&gt; 'off', ), 'is_required' =&gt; FALSE, ); */ 
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-12T19:31:39.693Z
Answers.Text: Thanks for your post but it is unclear if you are trying to make a comment or to answer the original question.  If this is an answer to the question it would be helpful if you could provide some more details.  This could help other people with the same question.
Answers.UserDisplayName: William Mortada
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-15T07:50:52.287Z
Answers.Text: This was an answer. you can set the paramaters that are needed for the billing address by adding comment in the wp-content/plugins/civicrm/civicrm/CRM/Core/Payment.php
  For example for the middle name that we don't use in France:
  line 901
  /**
      $metadata['billing_middle_name'] = array(
        'htmlType' => 'text',
        'name' => 'billing_middle_name',
        'title' => ts('Billing Middle Name'),
        'cc_field' => TRUE,
        'attributes' => array(
          'size' => 30,
          'maxlength' => 60,
          'autocomplete' => 'off',
        ),
        'is_required' => FALSE,
      );
  */
Answers.UserDisplayName: Guillaume Sorel
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-15T08:12:29.657Z
Answers.Text: Thanks.  I've added this to your answer.
Answers.UserDisplayName: William Mortada
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-09T13:36:39.947Z
Answers.LastActivityDate: 2019-04-15T08:12:05.353Z
Answers.LastEditDate: 2019-04-15T08:12:05.353Z
Answers.UserDisplayName: Guillaume Sorel
Body: <p>I understand that on contribution pages the "Billing Name and Address" block pops up in default - for most payment types.
  Where can I set what fields I want to have displayed -> I don't want the "middle name" and I certainly don't want a "State/Province" field when it's mandatory to start with.
  I can CSS them out -> but is there a back office way to choose what is shown?
  Cheers.</p>
  
  <p>This is Wordpress.</p>
  
Tags: <wordpress><civicontribute><contribution-page>
Title: Billing Name and Address
ThreadText: # Billing Name and Address
  
  (Asked by: username_0 on 2016-11-10)
  
  I understand that on contribution pages the "Billing Name and Address" block pops up in default - for most payment types.
  Where can I set what fields I want to have displayed -> I don't want the "middle name" and I certainly don't want a "State/Province" field when it's mandatory to start with.
  I can CSS them out -> but is there a back office way to choose what is shown?
  Cheers.
  
  This is Wordpress.
  
  **Tags:** wordpress, civicontribute, contribution-page
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2016-11-10. Score: 1 | Accepted answer
  
  To my Knowledge:-
  
  For some reason billing address field selection is hard coded in core files
  
  getBillingAddressFields()
  
  so you are forced to list all the listed fields details - if you dont want to display specific details then:
  
  * you need to overriding the core files
    Or
  * A JAVA script to hide the fields and unset the fields in formbuild
  
  I guess this helps !!!
  
  > **Comments:**
  > **username_0**: Thanks Ramesh! I haven't yet reached the level needed to tweek CiviCRM using JS. It therefore seems easier taking the fields out of the Payment.php (somewhere around line 710++) - albeit having to redo that in a case of updates. Would you agree!? Cheers  
  > **username_1**: Indeed - will be the quicker option but need to make a note of the changes and also need to test in all the possible way –  
  > **username_2**: I looked through all the Payment.php files I could find in 4.7.22 and couldn't spot any fields with 'postal' in them. Any ideas?  Also, the main file generating the payment block treats all fields as required;  there's no apparent opportunity to make individual fields required or not. See CRM/Core/Payment/Form.php, around li 135. Forgive me if I'm missing something completely obvious here... :)  
  
  ---
  
  ### Answer by username_3 on 2019-04-09. Score: 3
  
  Thanks,
  I changed the file Core/Payment.php file at lines 863 and 901 for both credit cards and checks.
  You can set the paramaters that are needed for the billing address by adding comment in the wp-content/plugins/civicrm/civicrm/CRM/Core/Payment.php. For example for the middle name that we don't use in France:
  line 901 
  /** $metadata['billing_middle_name'] = array( 'htmlType' => 'text', 'name' => 'billing_middle_name', 'title' => ts('Billing Middle Name'), 'cc_field' => TRUE, 'attributes' => array( 'size' => 30, 'maxlength' => 60, 'autocomplete' => 'off', ), 'is_required' => FALSE, ); */
  
  > **Comments:**
  > **username_4**: Thanks for your post but it is unclear if you are trying to make a comment or to answer the original question.  If this is an answer to the question it would be helpful if you could provide some more details.  This could help other people with the same question.  
  > **username_3**: This was an answer. you can set the paramaters that are needed for the billing address by adding comment in the wp-content/plugins/civicrm/civicrm/CRM/Core/Payment.php For example for the middle name that we don't use in France: line 901 /**     $metadata['billing_middle_name'] = array(       'htmlType' => 'text',       'name' => 'billing_middle_name',       'title' => ts('Billing Middle Name'),       'cc_field' => TRUE,       'attributes' => array(         'size' => 30,         'maxlength' => 60,         'autocomplete' => 'off',       ),       'is_required' => FALSE,     ); */  
  > **username_4**: Thanks.  I've added this to your answer.  
  
  ---
  
  