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 CiviEvent (Moderator: Yashodha Chaku) »
  • ParticipantID showing on Thank you screen
Pages: [1]

Author Topic: ParticipantID showing on Thank you screen  (Read 1399 times)

khsu2315

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.1.1
  • CMS version: Joomla 2.5.3
  • MySQL version: 5.1
  • PHP version: 5.3
ParticipantID showing on Thank you screen
March 23, 2012, 02:04:05 pm
Hi,
I have a Joomla 2.5.3 and civiCRM 4.1.0 installed on a non-profit web site. I was trying to include participant ID as a confirmation number on Thank You Screen. I added "Confirmation No: {$participantID}" in the Thankyou.tpl, the result came out blank "Confirmation No:".
I read some previous threads, they indicated that starting on version 4.1, the {$participantID} was exposed to the Thankyou.tpl. However, it doesn't seem to be the case. I even went to the civiCRM.org demo site created a test event and tested; it came out blank on the Thank You Screen as well. I may be missing something on my end. Could anybody help?

Thank you in advance.

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: ParticipantID showing on Thank you screen
March 23, 2012, 02:43:16 pm

Curious how u tested this on the demo site? since u dont have access to customized templates

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

khsu2315

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.1.1
  • CMS version: Joomla 2.5.3
  • MySQL version: 5.1
  • PHP version: 5.3
Re: ParticipantID showing on Thank you screen
March 23, 2012, 10:51:12 pm
Lobo,
  I am sorry. On the demo site, I added the variable to the introduction text area, the result is {$participantID}
I just add another Joomla 2.5.3 + civiCRM 4.1.1, and add {$participantID} to the Thanyou.tpl, the result is blank.
Do I need to do anything else besides adding {$participantID} to the Thanyou.tpl?

Thanks,

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: ParticipantID showing on Thank you screen
March 24, 2012, 08:09:22 am

intro text is also  smarty variable and that will not work (even if participantID is exposed to the template)

u might want to try debugging. Seems like we might be exposing an array of participants: participantIDs to the template.

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

khsu2315

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.1.1
  • CMS version: Joomla 2.5.3
  • MySQL version: 5.1
  • PHP version: 5.3
Re: ParticipantID showing on Thank you screen
March 28, 2012, 08:41:15 am
Hi Lobo,
  I am using {debug}, you are right the {$participantIDs} was exposed to the ThankYou.tpl. However, it alway show null.

Questions:
  1) I am wondering where the variable got assigned.
  2) If setting up "Register multiple participants? => No", whether the {$participantIDs} gets assigned or {$participantID}?

 Thanks,

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: ParticipantID showing on Thank you screen
March 28, 2012, 09:06:30 am

1. Check: CRM/Event/Form/Registration.php, approx line 623:

Code: [Select]
        $this->assign( 'participantIDs',
                       $this->_participantIDS );

2. Pretty sure it does not

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

khsu2315

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.1.1
  • CMS version: Joomla 2.5.3
  • MySQL version: 5.1
  • PHP version: 5.3
Re: ParticipantID showing on Thank you screen
March 29, 2012, 09:03:09 am
Hi Lobo,

I am little frastrated, I have been trying these:

A. Your solution:

1. u will need to expose this in the php code.

CRM/Event/Form/Registration.php, line 544

$this->assign( 'registerByID', $participant->id );

2. In the smarty templates you can use $registerByID
-----------------------------------------------------------------------------------
B. Rahul's solution:

1. Index: CRM/Event/Form/Registration/Confirm.php
--- CRM/Event/Form/Registration/Confirm.php   (revision 29557)
+++ CRM/Event/Form/Registration/Confirm.php   (working copy)
@@ -787,7 +787,7 @@
             }
         
          }   
+        $this->set( 'participantNumber', $participantID );
     } //end of function

2. Index: CRM/Event/Form/Registration/ThankYou.php
--- CRM/Event/Form/Registration/ThankYou.php   (revision 29557)
+++ CRM/Event/Form/Registration/ThankYou.php   (working copy)
@@ -65,6 +65,8 @@         $customGroup = $this->get('customProfile');
         $this->assign( 'customProfile',$customGroup );
         CRM_Utils_System::setTitle(CRM_Utils_Array::value('thankyou_title',$this->_values['event']));
+        $participantNumber = $this->get( 'participantNumber' );
+        $this->assign( 'participantNumber', $participantNumber );
     }

3. templates/CRM/Event/Form/Registration/ThankYou.tpl
p>{ts 1=$participantNumber}Confirmation Number: %1{/ts}</p>
---------------------------------------------------------------------------------------------------
C. The current version (4.1.1) appeared to be the participantIDs was exposed:

1. templates/CRM/Event/Form/Registration/ThankYou.tpl
{foreach from= $participantIDs item=code key=no}
       p>{ts 1=$code}Confirmation Number: %1 {/ts}</p>
{/foreach}

Based on {debug} result, all of these variables returned "null" from ThankYou.tpl. The function assignToTemplate( ) in the Registration.php supposed to capture participantID or participantIDs, but it seems did not capture these variables correctly.

Any suggestion?

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: ParticipantID showing on Thank you screen
March 29, 2012, 08:50:16 pm

Sorry, not sure what is happening with your code and why. I think a few people have done the below successfully

We are quite slammed for the next few weeks primarily due to CiviCon and the sprints after that. However if u r in the bay area / CA, u should attend CiviCon and the sprints and we can help you with the below :)

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

khsu2315

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.1.1
  • CMS version: Joomla 2.5.3
  • MySQL version: 5.1
  • PHP version: 5.3
Re: ParticipantID showing on Thank you screen
April 11, 2012, 09:14:31 am
Hi Lobo,

Thanks for the info. Unfortunely I couldn't attend the event.
I finally use timestamp as an alternative, here is my code, hopefully others can benefit from it if they have same issue as I do.

<img style="display: block; float: left;" src="http://www.MYSITE.org/barcodegen/html/image.php?code=code39&o=1&dpi=&t=20&r=2&rot=0&text={$smarty.now|date_format:'%y%m%d%H%M%S'}&f1=Arial.ttf&f2=14&a1=&a2=&a3=">

Thanks to JCM55's contribution.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • ParticipantID showing on Thank you screen

This forum was archived on 2017-11-26.