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) »
  • Different Contribution pages for signing up and contributing to a PCP
Pages: [1]

Author Topic: Different Contribution pages for signing up and contributing to a PCP  (Read 949 times)

ehowland

  • I’m new here
  • *
  • Posts: 25
  • Karma: 0
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6
  • MySQL version: various
  • PHP version: various
Different Contribution pages for signing up and contributing to a PCP
March 09, 2011, 04:02:54 pm
I have set up Personal Campaign Pages for a fundraising walk.   That seems to be working fine.  I would like the people who come to the personal pages to get a different contribution page than the walkers.

I have set up a second contribution page that is what I want for the sponsors.  But I do not see how to link them.

My page for walkers is:
http://example.org/civicrm/contribute/transact?id=1&reset=1
If the sponsors go to
http://example.org/civicrm/contribute/pcp/info?reset=1&id=4
The donate button takes them to:
http://example.org/civicrm/contribute/transact?id=1&pcpId=4&reset=1

My contribution page, with PCP enabled is:
http://example.org/civicrm/contribute/transact?reset=1&id=6
But if I go to something like
http://example.org/civicrm/contribute/transact?reset=1&id=6&pcpid=4
I can make a donation but the donation does not get credited to the person who created the page (pcpid=4).
I also sometimes get the message: This contribution page is not related to the Personal Campaign Page you have just visited. However you can still make a contribution here. 
Which is good error reporting.



I also see this post about creating a new template for this, but since I have a good contribution page I like it seems it would be easier to somehow link that contribution page to the new personal pages.
http://wiki.civicrm.org/confluence/display/CRMDOC33/Customize+Built-in%2C+Profile%2C+Contribution+and+Event+Registration+Screens

If I need to go the template route, how do I differentiate the page that is shown to potential walkers and those shown to sponsors.

CiviCRM 3.3.5
Drupal 6.20
« Last Edit: March 10, 2011, 07:25:19 am by ehowland »

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: Different Contribution pages for signing up and contributing to a PCP
March 10, 2011, 02:08:49 pm
Need to use all the same contribution page but edit the template.   Check out the work I did here http://namilouisville.org/walk.  See
How that looks.   More of what u want?   If so u need to edit a few .tpl files.  PM me
Try CiviTeacher: the online video tutorial CiviCRM learning library.

ehowland

  • I’m new here
  • *
  • Posts: 25
  • Karma: 0
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6
  • MySQL version: various
  • PHP version: various
Re: Different Contribution pages for signing up and contributing to a PCP
March 15, 2011, 02:06:59 pm
We looked at making a custom template (a la Stoob's suggestion). But in the end with some help from Quint Jensen I ended up adding a callback to a custom module.

On this site the contribution page for the walkers has an ID 1 and the contribution page for the supporters has an ID of 6. 

function wcadv_custom_civicrm_buildForm( &$formName, &$form ) {
 if ($formName == 'CRM_Contribute_Form_Contribution_ThankYou' && $form->_id == 1) {
   require_once('sites/all/modules/civicrm/CRM/Utils/System.php');
   $form->_pcpInfo['contribution_page_id'] = 6;
   $form->_id = 6;
   $lturl = CRM_Utils_System::url('civicrm/contribute/campaign', 'action=add&reset=1&pageId=6');
   $form->assign('linkTextUrl', $lturl);
  }
 
}


It is a little unclear to me if changing the $form->_id is going to create any problems, but changing the $form->_pcpInfo['contribution_page_id'] was not enough to change the link on the thank you page.  And even that did not change the link on the thankyou page.  We had to override the linkTextUrl variable. So this is not as clean a hack as one might like.

We set the profile on the walker's contribution page to  "Account creation required" to make sure that there was a contact by the time we got to the Personal Campaign Page, but although the walker's name came across to the personal campaign page the address, email etc. did not.

Code review is welcome.

ehowland

  • I’m new here
  • *
  • Posts: 25
  • Karma: 0
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6
  • MySQL version: various
  • PHP version: various
Re: Different Contribution pages for signing up and contributing to a PCP
March 17, 2011, 10:03:06 am
It seems that the forms are being processed in an unusual way.  I was trying to add some standard  text into the titles for the bookkeeper and tried this:

function wcadv_custom_civicrm_postProcess( $formName, &$form ) {
dsm($form);
 if ($formName == 'CRM_Contribute_Form_PCP_Campaign') {
   $form->_submitValues['title'] = "Personal Page: ".$form->_submitValues['title'];
    dsm($form->_submitValues['title'] );
  }   

}


Although the title does change in the form. It is not reflected on the next generated page.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Different Contribution pages for signing up and contributing to a PCP

This forum was archived on 2017-11-26.