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) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Customizing contribution page for recurring payments
Pages: [1]

Author Topic: Customizing contribution page for recurring payments  (Read 1564 times)

randallemery

  • Guest
Customizing contribution page for recurring payments
September 24, 2008, 08:21:42 pm
I'd like to have a contribution page that has recurring payments only and that allows you only to select monthly with no end date.  I know this is not possible in CiviContribute as delivered and that I will need to customize some part of the module.  Could anybody give me any pointers on what files to look in and what I would need to change?

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Customizing contribution page for recurring payments
September 24, 2008, 10:20:08 pm
I would suggest you should go through: http://civicrm.org/architecture

In terms of code, it will under CRM/Contribute/*

Feel free to ping me on #civicrm , if you are stuck anywhere..
HTH

Kurund
Found this reply helpful? Support CiviCRM

randallemery

  • Guest
Re: Customizing contribution page for recurring payments
September 24, 2008, 11:15:42 pm
I'm really at a loss -- I did a search in all the files in directory CRM to see if I could find any file that contains "month(s)" (from the recurring contribution screen) and I don't get any hits.  Is the text stored in the database, maybe?

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Customizing contribution page for recurring payments
September 24, 2008, 11:50:40 pm
I would recommend, first understand the flow / structure of civicrm code. Then things would be much easier. Intervals are stored in DB.

May be you should consider hiring someone from: http://civicrm.org/professional

HTH

Kurund

Found this reply helpful? Support CiviCRM

randallemery

  • Guest
Re: Customizing contribution page for recurring payments
September 25, 2008, 09:38:13 pm
The following modifications to CRM/contribute/Form/Contribution/Main.php allow monthly recurring donations only and default to once a month indefinitely.  Not prefect, but an improvement over the original, from our perspective anyway.  Hope posting this helps somebody in the future:

Code: [Select]
    /**
     * build elements to collect information for recurring contributions
     *
     * @access public
     */
    function buildRecur( ) {
        $attributes = CRM_Core_DAO::getAttribute( 'CRM_Contribute_DAO_ContributionRecur' );

        $elements = array( );
        /* $elements[] =& $this->createElement('radio', null, '', ts( 'I want to make a one-time contribution.' ), 0 ); */
      $elements[] =& $this->createElement('radio', null, '', ts( 'I want to contribute this amount' ), 1 );
        $this->addGroup( $elements, 'is_recur', null, '<br />' );
        /* $this->_defaults['is_recur'] = 0; */
        $this->_defaults['is_recur'] = 1;  /* added this line */
       
        $this->add( 'text', 'frequency_interval', ts( 'Every' ),
                    $attributes['frequency_interval'] );
        $this->addRule( 'frequency_interval', ts( 'Frequency must be a whole number (EXAMPLE: Every 3 months).' ), 'integer' );
        $this->_defaults['frequency_interval'] = '1';  /* added this line */

        /* $units = array(  0       => ts( '-period-' ),
                        'day'   => ts( 'day(s)'      ),
                        'week'  => ts( 'week(s)'     ),
                        'month' => ts( 'month(s)'    ),
                        'year'  => ts( 'year(s)'     ) ); */
        $units = array( 'month' => ts( 'month(s)'    ) ); /* added this line */
        $this->add( 'select', 'frequency_unit', null, $units );

        $this->add( 'text', 'installments', ts( 'installments' ),
                    $attributes['installments'] );
        $this->addRule( 'installments', ts( 'Number of installments must be a whole number.' ), 'integer' );

    }

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Customizing contribution page for recurring payments

This forum was archived on 2017-11-26.