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) »
  • Calculating total amount for an event
Pages: [1]

Author Topic: Calculating total amount for an event  (Read 2081 times)

timbit

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
Calculating total amount for an event
January 21, 2010, 11:17:32 am
Our organization is evaluating CiviCRM for enterprise use through a trial of CiviEvent for our upcoming AGM.

The AGM itself is free, however, some of the events that take place have a cost.  As such, I don't feel price sets will work as it doesn't seem feasible to create a price point for each permutation of events that someone may/may not attend.

What I've done is created a set of custom data fields associated with the participant record for attendees.  These custom data fields are exposed using a profile on the event registration page.  What I would like to do is calculate the total cost of the event on the confirmation page.

I have followed this recipe:

http://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in%2C+Profile%2C+Contribution+and+Event+Registration+Screens

and have placed Confirm.php into the following directory:

.../files/civicrm/custom_php/CRM/Event/Form/Registration/1/Confirm.php

I believe the changes I need to make are around line 239.  I started by setting the totalAmount to a constant which is not being picked up by the site.

Code: [Select]
            $this->assign('amount', '100'); //$this->_amount);   <--- line 239
            $this->assign('totalAmount', '100'); //$this->_totalAmount);
            $this->set( 'totalAmount', '100' ); //$this->_totalAmount + 1 );

Refreshing the confirmation page using the following URL does not display the price of $100.

http://agm/civicrm/event/register?_qf_Confirm_display=true&smartyDebug=1&directoryCleanup=1&qfKey=78ce7e9b0a756dda218e675c2a0fb12b

Is this a reasonable approach?  I am using CiviCRM 3.0.3 through drupal 6.15.  I understand that CiviCRM 3.1 has significant improvements to price sets.  Is the above use case covered?

Thank you for your help.

Tim

Canine Coaches

  • Guest
Re: Calculating total amount for an event
January 21, 2010, 10:32:24 pm
Hey,  I was facing a similar issue.  This thread will probably solve your problem unless there are specifics you had not mentioned

http://forum.civicrm.org/index.php/topic,1432.0.html

timbit

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
Re: Calculating total amount for an event
January 22, 2010, 11:19:04 am
Thanks for the input!  I came to the same conclusion myself shortly after I posted.  At first I thought that price sets were the same as the default radio list of prices.  I didn't realise you could use them to build complicated forms.  Price sets offered me more than enough functionality for what I wanted to do.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Calculating total amount for an event

This forum was archived on 2017-11-26.