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) »
  • How do I output the contributor name in the "offline receipt template"? [SOLVED]
Pages: [1]

Author Topic: How do I output the contributor name in the "offline receipt template"? [SOLVED]  (Read 603 times)

Boom I.T.

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 4.3.5
  • CMS version: WordPress 3.7.1
  • MySQL version: 5.1.70-cll
  • PHP version: 5.3.27
How do I output the contributor name in the "offline receipt template"? [SOLVED]
November 13, 2013, 11:24:33 am
Hi folks!

This is my first post on these forums, and I am hoping one of you can help me achieve a certain effect with CiviCRM + WordPress.

I am modifying the offline template for receipts, and I need to output the name of the contributor on the receipt that gets emailed to said contributor..
I am not sure how to reference this field and output it in the template.
I know that the SMARTY template engine is being used, but I am new to SMARTY.

EXAMPLE:
     <tr>
      <td {$labelStyle}>
       {ts}Financial Type{/ts}
      </td>
      <td {$valueStyle}>
       {$formValues.contributionType_name}
      </td>
     </tr>

The above example works for the contribution type, and outputs the correct information.
How do I do the same for the person who made the donation?

Any help would be appreciated.
Cheers!
« Last Edit: November 14, 2013, 05:25:24 am by Boom I.T. »

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: How do I output the contributor name in the "offline receipt template"?
November 14, 2013, 01:16:37 am
For offline contribution receipts we use default system template,  check http://drupal.demo.civicrm.org/civicrm/admin/messageTemplates?reset=1

Administer >> Communication >> Message Templates > System Workflow Message >Contributions - Receipt (off-line)

So you will have to modify above template. I think it should already have contributors name.

HTh
Kurund
Found this reply helpful? Support CiviCRM

Boom I.T.

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 4.3.5
  • CMS version: WordPress 3.7.1
  • MySQL version: 5.1.70-cll
  • PHP version: 5.3.27
Re: How do I output the contributor name in the "offline receipt template"?
November 14, 2013, 05:10:46 am
Thank-you for your reply Kurund Jalmi.

I am editing the correct message template, but I can only call the contributor ID ($contactID).
I know I could use $contactID to obtain the contributor name from the "civicrm_contact" table in the database.
How would I go about obtaining the value I require using CiviCRM syntax?

I believe the changes would have to be applied to "civicrm/CRM/Contribute/Form/Contribution/Confirm.php"
I'm just not sure how to implement the modifications I require.

Boom I.T.

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 4.3.5
  • CMS version: WordPress 3.7.1
  • MySQL version: 5.1.70-cll
  • PHP version: 5.3.27
Re: How do I output the contributor name in the "offline receipt template"?
November 14, 2013, 05:24:46 am
Solution:
Call {contact.display_name} in the template, this will output the contributor name.

Cheers!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • How do I output the contributor name in the "offline receipt template"? [SOLVED]

This forum was archived on 2017-11-26.