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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Collecting profile information for multiple contacts with Drupal Forms API
Pages: 1 [2]

Author Topic: Collecting profile information for multiple contacts with Drupal Forms API  (Read 2454 times)

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Collecting profile information for multiple contacts with Drupal Forms API
April 18, 2012, 04:02:19 pm
Well if you are using webforms to register the participants, and then redirect to a civi contribution form to collect payments, which is what I did, very little custom code is needed. You simply need to calculate the amount they owe and print it at the top of the contribution form. You can also set the default payment amount (still allowing them to change it if they want to pay in smaller installments). This is done with hook_civicrm_buildform();
Code: [Select]
// Existing intro text set in Civi UI
$intro = $form->_values['intro_text'];
// Append whatever you want
$intro .= 'foobar';
$form->assign('intro_text', $intro);
$price = 500;
$defaults = array('amount_other' => $price);
$form->setDefaults($defaults);
Try asking your question on the new CiviCRM help site.

jakecivi

  • I post frequently
  • ***
  • Posts: 140
  • Karma: 0
Re: Collecting profile information for multiple contacts with Drupal Forms API
April 23, 2012, 05:31:50 pm
I'm doing it the way you're describing.  I made a contribution page of type Event Fee that I'll use for this.  Are you linking the payment to the specific event registration in the civicrm_participant_payment table?  I'll need to do this because I need to calculate someone's outstanding fee for a particular event, not just overall - do you know if I'll screw anything up by programmatically writing entries to that table?
« Last Edit: April 23, 2012, 08:47:33 pm by jakecivi »

Pages: 1 [2]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Collecting profile information for multiple contacts with Drupal Forms API

This forum was archived on 2017-11-26.