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) »
  • Number of nights - multiply the online resgitration price by a custom field
Pages: [1]

Author Topic: Number of nights - multiply the online resgitration price by a custom field  (Read 1234 times)

frinaldi

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 3.3.6
  • CMS version: Drupal 6.17
  • MySQL version: 5.1.48
  • PHP version: 5.2.10
Number of nights - multiply the online resgitration price by a custom field
August 25, 2011, 07:37:29 am
Dear all,

At first, I wish you had a great summer :-).

I'm looking for a solution to multiply the total for my online registration by the number of night the user will stay at the event.

So, I create 3 html fields and the corresponding query under the REGISTER template (or the corresponding subcontent). But now, I don't know how to :
  • handle the control and repopulate of the field (when the user click on register with a business error on the page - ie : the arrival date is higher then the departure one
  • transmit those fields to the confirm screen (and how to use them in the confirm template to display the real amout)

I don't know if my question is clear but, basically I need to know :
  • how to add a custom field in a template from the code
  • how to handle integrity control of those fields on submit
  • how to re-populate those fields when the user come back to this screen (error or previous from the confirm screen)
  • how to transfer and handle the values of those fields in the previous template of the online process (confirm screen for example)

Many thanks for your help,
Fred

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Number of nights - multiply the online resgitration price by a custom field
August 28, 2011, 04:06:08 pm
You might want to search for "Price Sets' and "events' in the documention/forum - it may give you what you are looking for
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

frinaldi

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 3.3.6
  • CMS version: Drupal 6.17
  • MySQL version: 5.1.48
  • PHP version: 5.2.10
Re: Number of nights - multiply the online resgitration price by a custom field
August 28, 2011, 11:55:35 pm
Dear Pete,

Thank you for your answer but...I don't know where to find the interesting links under the forum or the document section.
So can you please send me the links.

Many thanks,
Fred

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Number of nights - multiply the online resgitration price by a custom field
August 29, 2011, 02:57:20 am
Quote
Price sets allow you to break event fees into smaller pieces, and set a fee for each piece. Using a price set you can offer optional programs and event features (e.g., an optional post-conference dinner or a book). Examples and steps for creating price sets are covered later in this section. Please take time to review their functionality and understand how they can benefit your event management process.
http://en.flossmanuals.net/civicrm/ch032_configuring/
might help you understand the possibilities otherwise try setting one up and seeing what it can do civicrm/admin/price?reset=1&action=add
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

frinaldi

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 3.3.6
  • CMS version: Drupal 6.17
  • MySQL version: 5.1.48
  • PHP version: 5.2.10
Re: Number of nights - multiply the online resgitration price by a custom field
August 29, 2011, 05:08:49 am
Thank you ; I've already read this documentation but it doesn't answer to my question.

My need is to multiplicate, by the number of night, the total fee for each subscriber.

So I really need to know how I can extend, in a programmatic way, the register form to add those field and how to collect those information in the confirm screen.

Or maybe I'm totally wrong and there's a way to do this without dev with my CiviCRM 3.3 (with Drupal).

Many thanks,

frinaldi

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 3.3.6
  • CMS version: Drupal 6.17
  • MySQL version: 5.1.48
  • PHP version: 5.2.10
Re: Number of nights - multiply the online resgitration price by a custom field
August 31, 2011, 05:09:22 am
up....

Nobody can help me ?
I just want to now how I can create with code a new fields directly from a template and how handle this new fields (error, repopulate and submit)...

Many thanks,
Fred

KarinG

  • I post frequently
  • ***
  • Posts: 134
  • Karma: 9
  • CiviCRM version: 4+
  • CMS version: Drupal 6 / 7
  • MySQL version: MariaDB
  • PHP version: 5.3/5.4/5.5
Re: Number of nights - multiply the online resgitration price by a custom field
February 28, 2012, 08:28:51 pm
Hi Fred,

In case you are still looking for this - or in case others are - you're looking to modify the calculation in:
/templates/CRM/Price/Form/Calculate.tpl (copy it -> put it in a CiviCRM custom templates folder so that modifications will not be lost upon upgrade).

If you are not working with price sets you can also look into using hook_civicrm_buildAmount().
http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviCRM+hook+specification

-- Karin

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Number of nights - multiply the online resgitration price by a custom field

This forum was archived on 2017-11-26.