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) »
  • How to add custom fields on THANK YOU page ?
Pages: [1]

Author Topic: How to add custom fields on THANK YOU page ?  (Read 622 times)

zafar

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.12
  • MySQL version: 5.0.7
  • PHP version: 5.3.5
How to add custom fields on THANK YOU page ?
September 07, 2012, 04:35:29 am
Hello,

I want to add some custom fields on (Thank You) page, which come after successful contribution,
Fields like (How did you hear about us ?).
How can i add these fields ?

Here you can see the fields and page design :
http://4acetechnologies.com/projects/devzaf/thankyou.png
« Last Edit: September 07, 2012, 06:07:12 am by zafar »

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: How to add custom fields on THANK YOU page ?
September 07, 2012, 07:44:07 am

This feature is not built in. You will either need to:

1. redirect to a profile / webform after the contribution has been made

2. Use hooks to add the needed form elements to the thankyou page

either way, some code would be required. option 1 seems a bit easier

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

zafar

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.12
  • MySQL version: 5.0.7
  • PHP version: 5.3.5
Re: How to add custom fields to the (THANK YOU) page ?
September 12, 2012, 03:47:31 am
Thanks lobo,

1 - I create a form with needed elements using WEBFORM module for (THANK YOU) page.
2 - I use HOOK to redirect to the (THANK  YOU) page after successful contribution.
The Wrong thing is :
After validating the contribution form if all required fields are filled, it goes directly to newly created        ( THANK YOU ) form.
NO Payment.
NO email sent
NO newsletter subscription is done

I use this hook in my code =>
function HOOK_civicrm_post($op, $objectName, $objectId, &$objectRef) {
          drupal_goto('node/1'); // path for (THANK YOU) form/page.
}

What i wan't is :
1 - Once i click on (Confirm Contribution) button it should go to Confirmation page.(Which is happening)

2 - When i click on (Make Contribution) button everything should be normal.ie donation form should be submitted ,header & footer profile should be submitted and payment should be done.

Finally when it's going to thank you page.it should be redirected to custom created (THANK YOU) page.
 
Can  you please guide me.which HOOK i've to use to achieve my goal.

« Last Edit: September 12, 2012, 04:23:39 am by zafar »

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: How to add custom fields on THANK YOU page ?
September 12, 2012, 09:01:51 am

1. Please read: http://book.civicrm.org/developer/

2. Please read: http://wiki.civicrm.org/confluence/display/CRMDOC42/Hook+Reference and the examples.

You will need to implement the postProcess hook on the confirm page to do the redirection

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) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • How to add custom fields on THANK YOU page ?

This forum was archived on 2017-11-26.