Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-6902

Implement the functionality to add "max" option for a price set field

    Details

    • Type: New Feature
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.2.3
    • Fix Version/s: 3.3.beta
    • Component/s: CiviEvent
    • Labels:
      None

      Description

      Implement the functionality to add "max" option for a price set field

      ===================
      Database design
      ===================

      • Currently price set field values are stored in civicrm_option_value table. We should migrate it to separate table "civicrm_price_field_value".
        Create new table with following fields:
        id primary key auto-increment
        price_field_id foreign key to civicrm_price_field
        label varchar 255
        name varchar 255
        amount varchar 512
        description text
        weight int
        is_active tinyint
        count int
        max_value int
      • Changes to civicrm_line_item

      Drop option_group_id
      Add price_field_value_id foreign key to civicrm_price_field_value

      ===============
      Upgrade Issues
      ===============

      • migrate existing data from civicrm_option_value table to civicrm_price_field_value
      • move count column from civicrm_price_field to civicrm_price_field_value table. Also migrate the data.

      ==================
      Code Changes
      ==================

      • modify the admin UI to add count and max option at value level for checkbox / select / radio
      • update / fix the code to save price field data in new table.
      • fix participant count functionality according to db changes.
      • fix code base ( reports / searches / etc... ) accordingly.

      ===================
      New Functionality
      ===================

      • Implement "max" functionality for price set field at value level. Basically admin should be able to define how many times a field can be selected / user is allowed to entered based on max value. For eg:
        1-3pm Sessions
        ( ) Training 1 :: max 45 :: $15
        ( ) Training 2 :: max 35 :: $30
        ( ) Training 3 :: max 60 :: $0

      Here if "Training 1" has reached max, then it will appear frozen. Also add a formrule to respect max limit in case of price field of type text.
      If max is defined modify the display as above.

      ------------- Original post -------------------------
      Purpose: Many organizations running conferences will hold concurrent sessions at various times which have space limitations and may involve additional fees. Price sets will be extended to provide this functionality.

      When configuring an event price set, one may create a field that represents a time slot, e.g. 1-3pm concurrent sessions. The options defined within this field will have an additional option of setting a max participants value. For example:

      1-3pm Sessions
      ( ) Training 1 :: max 45 :: $15
      ( ) Training 2 :: max 35 :: $30
      ( ) Training 3 :: max 60 :: $0

      As is currently the case, the field options may be required, and may also support a $0 value. The option to hide/display the amount can be configurable at the field level (to hide completely if all session options are free). Additionally, the option values will support a description field.

      If a session has reached capacity, the option will appear frozen on event registration form load (visible but not selectable). The field options will be searchable through the Find Participants tools.

      In order to achieve this the price sets structure will require its own option value table (currently uses the primary option value table) which has the additional extended fields.

        Attachments

          Activity

            People

            • Assignee:
              rahulbile Rahul Bile
              Reporter:
              lcdweb Brian Shaughnessy
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: