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) »
  • CiviDiscount Module Extension
Pages: 1 2 3 [4] 5 6 ... 8

Author Topic: CiviDiscount Module Extension  (Read 24794 times)

joshathedone

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 0
  • CiviCRM version: Civicrm4
  • CMS version: Drupal 7
  • MySQL version: 5.1.41
  • PHP version: 5
Re: CiviDiscount Module Extension
September 29, 2012, 06:41:30 pm
Is anyone else having the problem that counts are not incrementing in 4.2?  it was working before.

joshathedone

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 0
  • CiviCRM version: Civicrm4
  • CMS version: Drupal 7
  • MySQL version: 5.1.41
  • PHP version: 5
Re: CiviDiscount Module Extension
September 29, 2012, 07:30:26 pm
My company would also be willing to donate to the completion of this extension

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: CiviDiscount Module Extension
September 30, 2012, 07:26:29 am

have you tried doing a git pull from master last week? quite a few bug fixes were committed last week

Our current bug list is here:

https://github.com/dlobo/org.civicrm.module.cividiscount/blob/master/README

if you company can sponsor 15-25 hours to get some / all of these fixed that would be great :) Consulting rates are on the civicrm wiki

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

joshathedone

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 0
  • CiviCRM version: Civicrm4
  • CMS version: Drupal 7
  • MySQL version: 5.1.41
  • PHP version: 5
Re: CiviDiscount Module Extension
September 30, 2012, 07:34:33 am
I pulled git yesterday.  Not incrementing, and getting a WSOD of death after confirming event registration (only when applying discounts).  Running civicrm 4.2.2.  I would appreciate if anyone could tell me if they are having the same problems or if it is just my setup.

Is anyone else interested in helping to contribute to get this module done?  I have a small company and we are willing to pitch in, but would need a couple of other sponsors. 

 

 

joshathedone

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 0
  • CiviCRM version: Civicrm4
  • CMS version: Drupal 7
  • MySQL version: 5.1.41
  • PHP version: 5
Re: CiviDiscount Module Extension
September 30, 2012, 03:43:38 pm
I was able to identify the WSOD / non-incrementing problem (both are related).  It turns out something in the current setup of this module is messing up dompdf.  This is causing execution time errors which is breaking the process before it completes.

The easy solution? Use wkhtmltopdf.  It fixed it for me.

cognoscento

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 1
  • CiviCRM version: 4.2
  • CMS version: Drupal 7.17
  • MySQL version: 5.1.65
  • PHP version: 5.3.17
Re: CiviDiscount Module Extension
October 16, 2012, 12:24:09 pm
I've added a couple of comments/suggestions over in another thread. it'd be nice to have one place to discuss features and issues... GitHub isn't friendly for that, really...

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

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: CiviDiscount Module Extension
October 16, 2012, 01:02:07 pm

the github issue queue is not that bad :)

however a bigger question is for one or more folks to take over the extension and help push it forward and/or for a group of orgs to fund continue development of the module. That person(s) in turn can decide where to discuss features/issues

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

joshathedone

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 0
  • CiviCRM version: Civicrm4
  • CMS version: Drupal 7
  • MySQL version: 5.1.41
  • PHP version: 5
Re: CiviDiscount Module Extension
October 20, 2012, 11:43:30 pm
So, along the pushing it forward line, I have a feature I am attempting to add/contribute to CiviDiscount.  I think it would be great if you could set a contact to be added to a certain group upon using a code.  In our use case, this would allow event staff to be added to the mailing list for their team after registering for the event using the appropriate code.  The are countless other uses for this feature.

I am working on this in steps (and you will have to excuse my ignorance, this is my first attempt at developing anything for Civi).  The first step I am trying to accomplish is simply adding the option to the CiviDiscount add/edit screen.  (I will then work on storing the selection in SQL, and then on assigning the groups to the contact on code use.)  So far I have added the following code:

To Utils.php:
Code: [Select]
    static function getGroups( ) {
        $groupList = civicrm_api("Group","get", array (version => '3','sequential' =>'1'));
        if ( ! empty( $groupList) ) {
            $groups    = array( );
            foreach ( $groupList as $list ) {
                $groups[$list['id']] = $list['title'];
            }
            return $groups;
        }
        return null;
    }

To Add.php:
Code: [Select]
        require_once 'CDM/Utils.php';
        $groups = CDM_Utils::getGroups( );
        if ( ! empty( $groups ) ) {
            $this->_multiValued['groups'] = $groups;
            $this->addElement( 'advmultiselect',
                               'events',
                               ts( 'Groups' ),
                               $events,
                               array('size' => 5,
                                     'style' => 'width:200px',
                                     'class' => 'advmultiselect')
                               );
        }

To Add.tpl:
Code: [Select]
{if $form.groups}
      <tr class="crm-discount-item-form-block-groups">
          <td class="label">{$form.groups.label}</td>
          <td>{$form.groups.html}<br />
            <span class="description">{ts}Test{/ts}
          </td>
      </tr>
{/if}

I am not getting the select box, so the code is breaking down somewhere.  I am suspecting it is in the Utils.php portion.  Does anyone see what I am doing wrong?

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: CiviDiscount Module Extension
October 21, 2012, 07:30:32 am

Check if you have any groups in your $groups array. You can do:

CRM_Core_Error::debug( $groups );

and see what is in that array. I'd ensure that you have that array populated before checking the tpl etc

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

joshathedone

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 0
  • CiviCRM version: Civicrm4
  • CMS version: Drupal 7
  • MySQL version: 5.1.41
  • PHP version: 5
Re: CiviDiscount Module Extension
October 22, 2012, 08:04:07 am
Ah. Thanks Lobo. $groups was empty. Should have been
Code: [Select]
foreach($groupList[values] as $list)
Now off to figure out why the box is still not showing up...

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: CiviDiscount Module Extension
October 22, 2012, 01:02:35 pm

We'll be announcing the CiviDiscount improvements as a Make It Happen later today or so. In the meantime, you can help get the ball rolling by making a contribution here:

http://civicrm.org/civicrm/contribute/transact?reset=1&id=27

Any amount large or small helps us get towards our goal.

We hope to have a better functioning discount module in the next 2-3 weeks if we make good progress with the MIH. A list of things to be addressed and fixed can be found on github here:

https://github.com/dlobo/org.civicrm.module.cividiscount/blob/master/README

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

joshathedone

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 0
  • CiviCRM version: Civicrm4
  • CMS version: Drupal 7
  • MySQL version: 5.1.41
  • PHP version: 5
Re: CiviDiscount Module Extension
October 31, 2012, 09:48:00 pm
As described above, I am attempting to add a couple of features to Cividiscount which I plan on contributing.  Specifically, I am attempting to modify the module so that groups and roles can be selected to apply to a participant when they use the code.  For example, using a specific code might set your participant role to "staff" and add you to the "Registration Desk" mailing list.

I have done most of the work needed to make this happen.  I have modified the module to add a "groups" column and a "roles" column to the Cividiscount_Item table.  The groups and roles can be selected on the add screen and the values are being saved to the database.  I have also modified the code view screen to show what groups and roles are assigned to the code.

So, I am finally attempting to get the groups and roles to actually apply when the code is used.  I have added the following right after the //events section in cividiscount.php's  cividiscount_civicrm_postProcess():

Code: [Select]
require_once 'api/api.php';
CRM_Core_Error::debug(contactid, $contactid );
if ( !empty( $params['groups'] ) ) {
      $groups = $params['groups'];
      CRM_Core_Error::debug(groups, $groups );
      foreach ($groups as $gadd){
      CRM_Core_Error::debug(gadd, $gadd );
     civicrm_api("group_contact","create", array (version => '3','sequential' =>'1', 'group_id' => $gadd, 'contact_id' => $contactid));
    }
}

Registration is going through and the discount is applying, but the groups are not being added. I'm getting the following error in my logs, but I am unsure if it is related:

Code: [Select]
Warning: Invalid argument supplied for foreach() in CRM_Event_Form_Registration_Register->setDefaultValues() (line 268 of /home/eros/public_html/hedone.us/public/sites/all/modules/civicrm/CRM/Event/Form/Registration/Register.php).
If anyone can offer any guidance so I can complete this project I would greatly appreciate it.  Also, is there a way to use CRM_Core_Error::debug in the base extension php file?  It's working fine everywhere else in the module, but am not getting anything coming back when I use it in cividiscount.php.

Thanks!!

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
Re: CiviDiscount Module Extension
November 28, 2012, 08:31:04 pm
I am not using cividiscount but get the same erorr:
Warning: Invalid argument supplied for foreach() in CRM_Event_Form_Registration_Register->setDefaultValues()

no explanation thus far.

mclyde

  • I post frequently
  • ***
  • Posts: 171
  • Karma: 3
    • International Society for Bayesian Analysis
  • CiviCRM version: 4.2.7
  • CMS version: Drupal 6.x
  • MySQL version: 5.136
  • PHP version: 5.2.16
Re: CiviDiscount Module Extension
November 29, 2012, 08:42:06 pm
I am testing on D6/Civi4.2.6 and noticed that in the list of memberships for automatic discounts that it includes only memberships that have visibility public.

We have two membership types that have to be added offline, so visibility is admin so that they do not show up on any membership signup pages.  These two are not showing up on in the block of memberships available for automatic discounts.

Perhaps I am missing something, but I would like to be able to provide an automatic discount to any membership (public or admin) for a discount on an event registration, so these memberships should be selectable as well.

I did notice that the automatic member discount appears on membership pages, but is not appearing on event pages. 

cheers,
Merlise


Merlise Clyde

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: CiviDiscount Module Extension
November 30, 2012, 04:05:42 pm
Hi Merlise - you should be able to set those memberships as public not admin and just not select them to show on forms via the Membership Tab on the configuration for Contrib Page
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

Pages: 1 2 3 [4] 5 6 ... 8
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • CiviDiscount Module Extension

This forum was archived on 2017-11-26.