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) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • Two CiviDiscount Issues
Pages: [1]

Author Topic: Two CiviDiscount Issues  (Read 847 times)

mneimeyer

  • I’m new here
  • *
  • Posts: 20
  • Karma: 1
Two CiviDiscount Issues
April 12, 2013, 02:49:48 am
If this is the wrong place to post this jumble of thoughts... I apologize in advance and blame the "gosh darnit I'm going to plow through until I solve this even though it's 5 hours past my bedtime" and beg humble forgiveness... :)

This is utilizing the CiviDiscount 2.1 on CiviCRM 4.2.6 on Joomla 2.5.6.

1. Is it by intention that CiviDiscount extension allows you to apply discounts only to events that are Active AND Current/Future AND Public? The New/Edit Discount screen only says Active and Current/Future BUT the extension seems to rely on CRM_Event_BAO_Event::getCompleteInfo() which has a hard coded "is_public=1" in the query to fetch the list of Events?

1b. "By intention" meaning "We designed it that way on purpose" as opposed to "We used the getCompleteInfo function because it was easy and everyone that tested it makes all their events public" :)

2. With regards to stacking discounts... (which doesn't seem to work out of the box)... In the org.civicrm.module.cividiscount/cividiscount.php file I added the following line at/near line 386:

   while(count($discounts)) {

This is right before the line that reads:

   $discount = array_shift($discounts);

Then I added a matching } right before the line that reads:

   $form-set('_discountInfo', array(

2b. It seems to work on the front end but I'm wondering if this will do evil things that I have missed? ...I'm concerned because I'm too tired to figure out what the $form->set is trying to do and I can see it would only get the last discount.

2c. If that is harmless where/to whom do I submit a patch?

Thanks in advance!

Matt

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Two CiviDiscount Issues
April 12, 2013, 09:21:01 am

1. I fixed the help text to include the word public. The folks who sponsored this work cared about public events only

1b. We had a nice convenient function to reuse which we did :)

2. Dont know whether the below is harmless or not, but stackable discounts should be an option that people need to enable (or disable). Would be a good addition for the 3.0 version of cividiscount

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

mneimeyer

  • I’m new here
  • *
  • Posts: 20
  • Karma: 1
Re: Two CiviDiscount Issues
April 13, 2013, 01:21:15 pm
Thanks!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • Two CiviDiscount Issues

This forum was archived on 2017-11-26.