CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions »
  • CiviContribute Suggestions »
  • Contribution Amount and Type fields in add and renew membership forms
Pages: [1]

Author Topic: Contribution Amount and Type fields in add and renew membership forms  (Read 2181 times)

jbertolacci

  • I post occasionally
  • **
  • Posts: 54
  • Karma: 1
Contribution Amount and Type fields in add and renew membership forms
August 27, 2010, 10:31:18 am
The Contact add and renew membership forms are missing Contribution Amount and Type fields if you are submitting a live credit card transaction. So if you record a membership in the Add Membership form:

http://drupal.demo.civicrm.org/civicrm/contact/view/membership?reset=1&action=add&cid=102&context=membership

When you check Record Membership Payment you can set Contribution Amount and Type, but on the Submit Credit Card Membership form:

http://drupal.demo.civicrm.org/civicrm/contact/view/membership?reset=1&action=add&cid=102&context=membership&mode=preview
 
Contribution amount and type are not fields that the user can set. The form defaults to the minimum membership payment amount and contribution type set for that membership type. The same is true in the membership renewal forms.

So if a donor wants to become a member at a $500 level rather than the the minimum amount, you can process an offline membership contribution for a $500 paid by check, but if the member calls with a credit card number for the $500 membership contribution, that contribution cannot be submitted through the CiviCRM offline membership or membership renewal pages.

You can record a contribution and add/renew the membership separately, but the database record in table civicrm_membership_payment is not recorded if you use this work-around.

Below are diffs for adding contribution amount and type fields to the Submit Credit Card Membership and Renew Credit Cark forms to mirror the functionality in the Add Membership and Renew forms. Is there a reason not to have these fields in the credit card processing versions of the add/renew membership forms? If not would whese be good enhancements to place in core?


jbertolacci@imbatmp:~/www.imba.com/sites/default/files/civicrm/custom/php/CRM/Member/Form$ diff Membership.php /var/www/sites/all/modules/civicrm/CRM/Member/Form/Membership.php
383,392c373
<         // IMBA -- contribution type and amount mod
<         // begin
<       require_once 'CRM/Contribute/PseudoConstant.php';
<       $this->add('select', 'contribution_type_id',
<                ts( 'Contribution Type' ),
<                array(''=>ts( '- select -' )) + CRM_Contribute_PseudoConstant::contributionType( ) );
<       
<       $this->add('text', 'total_amount', ts('Amount'));
<         $this->addRule('total_amount', ts('Please enter a valid amount.'), 'money');
<       // end
---
>        
401,403c382
<             // IMBA -- contribution type and amount mod
<             // begin
<             /*
---
>            
411,412c390
<             */
<             // end
---
>


jbertolacci@imbatmp:~/www.imba.com/sites/default/files/civicrm/custom/php/CRM/Member/Form$ diff MembershipRenewal.php /var/www/sites/all/modules/civicrm/CRM/Member/Form/MembershipRenewal.php
246,255d240
<         // IMBA -- contribution type and amount mod
<         // begin
<       require_once 'CRM/Contribute/PseudoConstant.php';
<       $this->add('select', 'contribution_type_id', ts( 'Contribution Type' ),
<                array(''=>ts( '- select -' )) + CRM_Contribute_PseudoConstant::contributionType( )
<                );
<       
<       $this->add('text', 'total_amount', ts('Amount'));
<       $this->addRule('total_amount', ts('Please enter a valid amount.'), 'money');
<       // end
258,260d242
<          // IMBA -- contribution type and amount mod
<          // begin
<          /*
268c250
<             */
---
>            
347c329
<    
---
>        
353,355d334
<            // IMBA -- contribution type and amount mod
<          // begin
<          /*
360,364d338
<          */
<          $params['total_amount']         = $formValues['total_amount'];
<          $params['contribution_type_id'] = $formValues['contribution_type_id'];
<          // end
<          


jbertolacci@imbatmp:~/www.imba.com/sites/default/files/civicrm/custom/templates/CRM/Member/Form$ diff Membership.tpl /var/www/sites/all/modules/civicrm/templates/CRM/Member/Form/Membership.tpl
99,100c99,102
<    {* IMBA -- contribution type and amount mod *}
<    {* begin *}
---
>    {elseif $membershipMode}
>         <tr class="crm-membership-form-block-billing"><td colspan="2">
>         {include file='CRM/Core/BillingBlock.tpl'}
>         </td></tr>
103c105
<         {if $accessContribution AND ($action neq 2 or !$rows.0.contribution_id or $onlinePendingContributionId)}
---
>         {if $accessContribution and ! $membershipMode AND ($action neq 2 or !$rows.0.contribution_id or $onlinePendingContributionId)}
119c121
<                       <td><span id='totalAmount'>{$form.total_amount.html|crmMoney:$form.currency.html|crmReplace:class:eight}</span><br />
---
>                       <td>{$form.total_amount.html}<br />
122d123
<                   {if ! $membershipMode }
135c136
<                   {if $action neq 2 }   
---
>                 {if $action neq 2 }   
140c141
<                    {/if}
---
>                 {/if}
145d145
<                   {/if}
153,159d152
<    {if $membershipMode}
<         <tr class="crm-membership-form-block-billing"><td colspan="2">
<         {include file='CRM/Core/BillingBlock.tpl'}
<         </td></tr>
<     {/if}
<     {* end*}
<  


jbertolacci@imbatmp:~/www.imba.com/sites/default/files/civicrm/custom/templates/CRM/Member/Form$ diff MembershipRenewal.tpl /var/www/sites/all/modules/civicrm/templates/CRM/Member/Form/MembershipRenewal.tpl
72,76c72,73
<
<       {* IMBA -- contribution type and amount mod *}
<       {* begin *}
<         {if $accessContribution}
<         {if ! $membershipMode}
---
>    
>         {if $accessContribution and ! $membershipMode}
82,83c79
<         {/if}    
<         {* end *}
---
>            
95c91
<                        <td><span id='totalAmount'>{$form.total_amount.html|crmMoney:$form.currency.html|crmReplace:class:eight}</span><br />
---
>                        <td>{$form.total_amount.html}<br />
98,100d93
<                {* IMBA -- contribution type and amount mod *}
<                {* begin *}
<                     {if ! $membershipMode}
117,118d109
<                     {/if}
<                     {* end *}

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions »
  • CiviContribute Suggestions »
  • Contribution Amount and Type fields in add and renew membership forms

This forum was archived on 2017-11-26.