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) »
  • using a price set field for discounts
Pages: [1]

Author Topic: using a price set field for discounts  (Read 1480 times)

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
using a price set field for discounts
August 28, 2009, 06:27:27 am
I have a scenario where the organization offers a discount if the registrant agrees to provide assistance with the event (basically a volunteer discount). So there's no need for a discount coupon or any admin oversight -- the discount is fully the option of any registrant.

So I created a price set field for the discount (checkbox), and for the fee value I wanted to put a negative value. But the interface does not allow a negative value (throws an error that I need to put a valid monetary value).

However, if I modify the option_value field in the db to change the value to a negative, then everything seems to work perfectly. The price calculation reflects the negative value on the form and in the confirmation page.

I think this could be a very useful and easily implemented feature. Can we modify the interface so that it allows a negative value?
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

martinb1

  • Guest
Re: using a price set field for discounts
August 30, 2009, 04:20:26 am
Hi there

That sounds like something that I could use, can you advise in a little more about the "modify the option_value field in the db to change the value to a negative" - can I ask what you did to achieve that ?

Cheers

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: using a price set field for discounts
August 30, 2009, 08:36:42 pm
first create the price set field with a positive value.
then get into the db. the price sets are defined in civicrm_price_set, and the corresponding fields are in civicrm_price_fields. if you've chosen a checkbox, radio, select type of field, there will be a corresponding entry in civicrm_option_group and the list of options will be in civcrm_option_value. if you've just created the field, you can probably just skip to this last table and track down the appropriate entry toward the end of the list. the fee value will be in the 'name' field. just change it to a negative and save.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Yashodha Chaku

  • Forum Godess / God
  • Ask me questions
  • *****
  • Posts: 755
  • Karma: 57
    • CiviCRM
Re: using a price set field for discounts
August 30, 2009, 10:48:17 pm
I think we could make changes so that the price set interface allows negative values for price set field,
(that is the individual price set item values need not be positive)
but the total amount for the price set event fees  SHOULD be positive.

Thoughts?
-Yashodha
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

martinb1

  • Guest
Re: using a price set field for discounts
August 31, 2009, 02:57:40 am
Quote from: lcdweb on August 30, 2009, 08:36:42 pm
first create the price set field with a positive value.
then get into the db. the price sets are defined in civicrm_price_set, and the corresponding fields are in civicrm_price_fields. if you've chosen a checkbox, radio, select type of field, there will be a corresponding entry in civicrm_option_group and the list of options will be in civcrm_option_value. if you've just created the field, you can probably just skip to this last table and track down the appropriate entry toward the end of the list. the fee value will be in the 'name' field. just change it to a negative and save.

Thanks !

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: using a price set field for discounts
August 31, 2009, 05:47:44 am
I definitely would like to see that option available (negative values for the price set fields). There should be some corresponding help text that explains the possible use of a negative value as a discount option.

I think for now you're right, that the total amount should be required positive. At least from a frontend event registration form.

However, eventually there is a use case for negative amounts via the backend --
Since event registrations that include payment (contrib record) are not editable, I sometimes have users process a second registration for a participant if they need to modify the registration options. This is not ideal, but gets the job done for situations where the participant is adding a registration option -- if they are removing an option, it's less useful. But I could see a situation where it would be helpful to process a negative value as a sort of discount on a previous registration.

That use case is a workaround situation. But definitely a "real" use until the event registration tools allow greater flexibility with editing an existing registration.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: using a price set field for discounts
August 31, 2009, 04:52:40 pm
I've added an issue for this scheduled for 3.0.1:
http://issues.civicrm.org/jira/browse/CRM-4978
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • using a price set field for discounts

This forum was archived on 2017-11-26.