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) »
  • Forcing a contribution page to create a new contact, logged in or not
Pages: [1]

Author Topic: Forcing a contribution page to create a new contact, logged in or not  (Read 1219 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Forcing a contribution page to create a new contact, logged in or not
February 08, 2010, 12:03:23 pm
Let's say we have a membership contact page like this one:
http://drupal.demo.civicrm.org/civicrm/contribute/transact?reset=1&id=2

We need it to process CC, as well answer some profile fields, and create a new contact with a new membership.  This particluar Contribution Page, should ALWAYS create a new contact, with a new membership.   Regardless of who is looking at the page, what their role is, and most importantly whether they are logged in or not.  This page will NOT process renewals.  It is simply for data entry and CC payment page and for creation of new memberships and contacts.

The default CiviCRM behavior when processing a membership through a contribution page is to attribute the contribution/membership to the contact record associated with the person logged in.  We want to eliminate this behavior and force a new contact to be created each time.

I thought originally that a Profile would be a good idea, but Profiles don't process credit cards, right?  Any ideas of what to hook or hack?  Thanks.

STOOB

« Last Edit: February 08, 2010, 12:05:26 pm by Stoob »
Try CiviTeacher: the online video tutorial CiviCRM learning library.

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: Forcing a contribution page to create a new contact, logged in or not
February 08, 2010, 01:48:43 pm

the easiest hack for this is:

edit: CRM/Contribute/Form/ContributionBase.php, lne 211

        $this->_userID = $session->get('userID');

comment out that line :) should do what u want now

i'm 99% sure that this will work. try it out, and let us know

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

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Forcing a contribution page to create a new contact, logged in or not
February 15, 2010, 11:34:57 am
thanks lobo that worked
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Yoda_Oz

  • I post occasionally
  • **
  • Posts: 107
  • Karma: 2
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
Re: Forcing a contribution page to create a new contact, logged in or not
July 02, 2010, 03:51:04 am
will this work for events too?

which file do i edit to make this work for events as well?

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: Forcing a contribution page to create a new contact, logged in or not
July 02, 2010, 04:16:14 am

CRM/Event/Form/Registration.php

Code: [Select]
            $contactID = $session->get( 'userID' );

you will learn a lot more if you take the time and energy to read and investigate the code base. Some good starting points:

http://en.flossmanuals.net/CiviCRM/DevelopIntro
http://civicrm.org/architecture/

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

Yoda_Oz

  • I post occasionally
  • **
  • Posts: 107
  • Karma: 2
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
Re: Forcing a contribution page to create a new contact, logged in or not
July 02, 2010, 05:48:42 am
tried that and it didn't work. that was the first place i looked.
any other suggestions for files.
would it makes sense this file?
CRM/Event/Form/Registration/Register.php

Yoda_Oz

  • I post occasionally
  • **
  • Posts: 107
  • Karma: 2
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
Re: Forcing a contribution page to create a new contact, logged in or not
July 12, 2010, 04:07:18 am
hi,
ive commented out all bits of code that says $contactID = $session->get( 'userID' ); in the events file registration.php around line 574 but it is still overwriting the contact.

any ideas???

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Forcing a contribution page to create a new contact, logged in or not

This forum was archived on 2017-11-26.