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) »
  • New contribution creating multiple accounts with membership
Pages: [1]

Author Topic: New contribution creating multiple accounts with membership  (Read 822 times)

dannybrowne

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6
  • MySQL version: 5
  • PHP version: 5
New contribution creating multiple accounts with membership
November 16, 2011, 04:00:16 am
Kind of stuck here... Any ideas of the best way for me to create a new contribution page where first name, last name and email are entered for TWO people. I need to assign BOTH a membership and add to a mailing list.

I have tried adding two profiles containing fields of type Individual: 'first name' etc but seemingly that is not possible as only one profile / set of fields shows up.

If I capture the second persons details as a set of custom fields is there some way (maybe using Drupal 'triggered rules' module) to extract the data from those fields and call a civi hook or make an api call to insert the individual and assign membership when a new contribution is made?

dannybrowne

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6
  • MySQL version: 5
  • PHP version: 5
Re: New contribution creating multiple accounts with membership
November 16, 2011, 09:11:39 am
OK... so I've added some custom fields to an 'Individual' contact and i'm gonna implement the _civicrm_post hook

but... how the heck do i debug while I'm writing this script?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: New contribution creating multiple accounts with membership
November 16, 2011, 11:40:13 am

might want to take a look at the code here:

http://svn.civicrm.org/tools/trunk/drupal/modules/civicrm_regsite/civicrm_regsite.module

which basically creates another contact and a relationship for a profile

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • New contribution creating multiple accounts with membership

This forum was archived on 2017-11-26.