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) »
  • Searching by contribution ID
Pages: [1]

Author Topic: Searching by contribution ID  (Read 421 times)

RachelWright

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 3
  • CiviCRM version: 4.2.7
  • CMS version: Joomla 2.5.17
  • MySQL version: 5.5.37
  • PHP version: 5.4.26
Searching by contribution ID
July 14, 2014, 06:43:51 pm
I've been hoping for a little more functionality in regards to Contribution IDs as civi has upgraded. While I was able to add references in a few places (on the contribution dashboard, on the contribution edit screen, in donation receipts) I'd love to be able to search by contribution ID. I found this post:

http://forum.civicrm.org/index.php/topic,32022.msg136998.html#msg136998

and as Joanne says those methods are not really ideal.

I've been poking around the Contribute>BAO>Query.php file and it would seem there has to be a way to add it but have yet to puzzle out how to do it. 

I tried something as simple as swapping the 'contribution_transaction_id' variable for 'contribution_id' on line 887
Code: [Select]
$form->addElement('text', 'contribution_transaction_id', ts("Transaction ID"));
// swapped to - just for testing purposes
$form->addElement('text', 'contribution_id', ts("Transaction ID"));
but it did not work.

I went a little more in depth and tried to replicate other portions of the code I thought it might need to make "contribution_id' searchable but had not luck. I'm kinda guessing (emphasize guessing) that it has something to do with the manner the file interacts with the contribution variable. (I noticed it references it differently than the others in the beginning of the file.)

Any thoughts or suggestions on how I could make this work?

pthopson

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.4
  • CMS version: Wordpress 4.1
  • MySQL version: not sure as done by admin
  • PHP version: not sure as done by admin
Re: Searching by contribution ID
January 19, 2015, 01:56:54 pm
Hi Rachel, I am really new to civiCRM and trying to get my head around how to do things in the software. I have been trying to make use of the Contribution ID which is very useful but seems to be hard to access!

I was intrigued by your post, especially "I've been hoping for a little more functionality in regards to Contribution IDs as civi has upgraded. While I was able to add references in a few places (on the contribution dashboard, on the contribution edit screen, in donation receipts" as I have spent 2 days so far trying to do these things but no luck, especially getting the donation receipts to show contribution ID.

Can you give us a few tips on how you achieved this?

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Re: Searching by contribution ID
January 19, 2015, 02:31:03 pm
You should be able to edit the system workflow message templates to include contribution Id in the receipts. 

In 4.4 you need to include {$contributionID} I think it was the same in 4.2.
« Last Edit: January 21, 2015, 03:11:12 am by joanne »

RachelWright

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 3
  • CiviCRM version: 4.2.7
  • CMS version: Joomla 2.5.17
  • MySQL version: 5.5.37
  • PHP version: 5.4.26
Re: Searching by contribution ID
January 21, 2015, 02:57:09 pm
I added some code to the core file: CRM/Contribute/Form/Contribution.php because I had trouble getting the {contributionID} id to work in the Selector template.

I know it's not the best practice but we use the CID a lot -

around line 870, after the trnx_id element is added - keep in mind I'm in 4.2

//#rw add cid to page for display in backend
   $element = $this->add('text', 'id', ts('Contribution ID'),
      $attributes['id']
    );

then later around line 1441, again after the trnx_id assign:
$this->assign('id', $result['id']);//#rw

After that I used the {$row.contribution_id} in the custom template folder Contribute>Form>Selector.tpl. (I just added another column so that I could see the CID in lists.)

Did that help? Just hit me up if not!

As Joanne pointed out, I did see the {$contributionID} in the email receipts for easy reference.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Searching by contribution ID

This forum was archived on 2017-11-26.