I ran into this problem for a client who needs to specify, when renewing a membership, the bank name.
So I decided to store this value into contribution note, but when renewing, this field does not appears in the form.
I added this on line 409 of CRM_Member_Form_MembershipRenewal.php
$this->add('text', 'contribution_note', ts('Note'),
CRM_Core_DAO::getAttribute('CRM_Core_DAO_Note', 'note')
);
And this on line 730 of CRM_Member_Form_MembershipRenewal.php
$note = new CRM_Core_DAO_Note();
$note->entity_table = 'civicrm_contribution';
$note->entity_id = $temporaryParams['contribution_id'];
$note->note = $formValues['contribution_note'];
$note->contact_id = $formValues['contact_id'];
$note->modified_date = CRM_Utils_Date::getToday();
$note->privacy = 0;
$note->save();
Here is the .tpl modification on line 176
<tr id="contributionNote" class="crm-member-membershiprenew-form-block-contribution_note">
<td class="label">{$form.contribution_note.label}</td>
<td>{$form.contribution_note.html}</td>
</tr>