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 ... 8

Author Topic: CiviDiscount Module Extension  (Read 24793 times)

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Re: CiviDiscount Module Extension
July 29, 2012, 01:30:21 pm
I am just curious when this will be usable? I'd help find the problem in the code, but unfortunately my skills in that area are extremely limited.

Thanks!

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
July 29, 2012, 01:38:57 pm

There was an MIH to fund this module which did not get any funding :(

So basically this is dependent on someone either sponsoring it and/or a developer taking it and fixing the various issues for 4.2 including the price set change

I suspect its a 15-25 hour project

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
August 05, 2012, 12:18:10 pm
Ive been trying to debug why the extension will not allow you to select an event when adding a code.

In Add.php there is this code:

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

Directing the box not to show up if  "$events"  coming from CDM_Utils::getEvents( ); is empty.  I checked in Utils.php and saw the following call to core:

Code: [Select]
class CDM_Utils {
   
    static function getEvents( ) {
        require_once 'CRM/Event/BAO/Event.php';
        $eventInfo = CRM_Event_BAO_Event::getCompleteInfo( );
        if ( ! empty( $eventInfo ) ) {
            $events    = array( );
            foreach ( $eventInfo as $info ) {
                $events[$info['event_id']] = $info['title'];
            }
            return $events;
        }
        return null;
    }

I wrote a simple block of code to call CRM_Event_BAO_Event::getCompleteInfo( ); into a variable and output the array, and it appears the array is empty:

Code: [Select]
<?php

echo "test\n";
 require_once 
'CRM/Event/BAO/Event.php';
        
$eventInfo = CRM_Event_BAO_Event::getCompleteInfo( );
print_r($eventInfo);

I also tried changing the variable to $all to match the return in the getCompleteInfo function in core, also with no results:

Code: [Select]
<?php

echo "test\n";
 require_once 
'CRM/Event/BAO/Event.php';
        
$all = CRM_Event_BAO_Event::getCompleteInfo( );
print_r($all);

Is seems the oprion is not being given because the call to core is returning null.  Anyone have any idea as to why this might be???

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
August 06, 2012, 08:14:37 am

Do you have any events that are currently open for online registration?

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

GinkgoDOB

  • I post occasionally
  • **
  • Posts: 54
  • Karma: 1
  • Dir. of Product Development, Ginkgo Street Labs
    • Ginkgo Street Labs
  • CiviCRM version: v4.5-4.7
  • CMS version: Drupal
Re: CiviDiscount Module Extension
August 09, 2012, 06:41:41 am
Got the latest CiviDiscount last night (Aug 8 ) and installed. I'm using CiviCRM 4.2beta4 on Drupal 7. No errors as described here (although I did have to do a little wiggling to get it installed - it would not install from the Manage Extensions page automatically.)

I have created an automatic discount, which is given to people who are registering for an event and who have an active membership.

The discount is displayed correctly in the listing, but when I register for an event, the discount is given as a percentage of the base amount, not as a dollar amount discount.

Will try to muddle through the code and see what I can find.
« Last Edit: August 09, 2012, 07:24:53 am by axon-obriend »

GinkgoDOB

  • I post occasionally
  • **
  • Posts: 54
  • Karma: 1
  • Dir. of Product Development, Ginkgo Street Labs
    • Ginkgo Street Labs
  • CiviCRM version: v4.5-4.7
  • CMS version: Drupal
Re: CiviDiscount Module Extension
August 09, 2012, 07:16:58 am
I found it. On line 809 of cividiscount.php:

if ( $code['amount_type'] == 'M' ) {

should be

if ( $code['amount_type'] == '2' ) {

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
August 12, 2012, 10:18:27 am
axon's fix seems to work for the dollar vs. percentage

lobo- yes, there is an event configured for online registration, but the option box still does not show in the discount code configuration; presumably because of the problem above.  I would be curious to know if anyone else is seeing this problem or if it is just my setup

totolabs

  • I’m new here
  • *
  • Posts: 22
  • Karma: 0
  • CiviCRM version: 4.2.0
  • CMS version: Joomla 2.5.6
  • MySQL version: 5.1.61-0ubuntu0.10.04.1
  • PHP version: 5.3.2-1ubuntu4.14
Re: CiviDiscount Module Extension
September 06, 2012, 03:07:20 am
I'm trying to install this module on a joomla civicrm installation but without success.  :(

After I have set CiviCRM Extensions Directory, when I try to install cividiscount module I obtain the message "Unable to extract the extension. Extension has been installed."

Where am I wrong?  ???

P.S. What's the latest on the project for 4.2 civicrm version?  ;D

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 06, 2012, 06:03:47 am

That projects needs some love and care from a developer and/or someone to help fund improvements to it. We suspect it is a 20-25 hour project

Currently no one is working on improving / ensuring it works on all CMS's for 4.2. If you can help with it, that would be awesome

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

totolabs

  • I’m new here
  • *
  • Posts: 22
  • Karma: 0
  • CiviCRM version: 4.2.0
  • CMS version: Joomla 2.5.6
  • MySQL version: 5.1.61-0ubuntu0.10.04.1
  • PHP version: 5.3.2-1ubuntu4.14
Re: CiviDiscount Module Extension
September 06, 2012, 08:43:10 am
I could try to help with this project... but not how developer... I could try to found some funds!  ;D
If you know a developer that could help us with this project, send me a pm with the amount of funds that he needs.

Thx a lot  ;)

ChrisChinchilla

  • I post occasionally
  • **
  • Posts: 104
  • Karma: 3
  • CiviCRM version: 4.1.2
  • CMS version: Drupal 6 & 7
Re: CiviDiscount Module Extension
September 11, 2012, 10:00:22 pm
I'd be interested in helping with this and Green Renters might possibly be intersted in part sponsoring, but to begin with I need to have play with and see where you're at, whenever I try to install I get this error…

Fatal error: Uncaught exception 'Exception' with message 'A fatal error was triggered' in /Library/WebServer/Documents/greenrenters.org/sites/all/modules/civicrm/CRM/Core/ManagedEntities.php:107 Stack trace: #0 /Library/WebServer/Documents/greenrenters.org/sites/all/modules/civicrm/CRM/Core/ManagedEntities.php(81): CRM_Core_ManagedEntities->reconcileEnabledModule(Object(CRM_Core_Module), Array) #1 /Library/WebServer/Documents/greenrenters.org/sites/all/modules/civicrm/CRM/Core/ManagedEntities.php(67): CRM_Core_ManagedEntities->reconcileEnabledModules() #2 /Library/WebServer/Documents/greenrenters.org/sites/all/modules/civicrm/CRM/Core/Invoke.php(397): CRM_Core_ManagedEntities->reconcile() #3 /Library/WebServer/Documents/greenrenters.org/sites/default/extensions/org.civicrm.module.cividiscount/cividiscount.php(20): CRM_Core_Invoke::rebuildMenuAndCaches() #4 /Library/WebServer/Documents/greenrenters.org/sites/all/modules/civicrm/CRM/Core/Extensions/Module.php(52): cividiscount_civicrm_install() #5 /Library/WebServer/Documen in /Library/WebServer/Documents/greenrenters.org/sites/all/modules/civicrm/CRM/Core/ManagedEntities.php on line 107

Any help with that is appreciated and then I'll how else I can help!
Melbourne CiviCRM meetup group - http://www.meetup.com/MelbourneCiviCRM/

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 12, 2012, 09:15:14 am

hey chris:

wanna ping us on IRC and we can get you started on the exploration. When i tried it out the last time, it did install quite nicely

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

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Re: CiviDiscount Module Extension
September 12, 2012, 09:42:22 pm
Mine seemed to install fine - I didn't see any errors or anything. But it doesn't seem to actually do anything.

I did get the % and $ issue fixed with the fix above - now my monetary discounts show with a $ instead of a %. But still the discount code doesn't seem to do anything. Nothing is ever subtracted from the total.

ChrisChinchilla

  • I post occasionally
  • **
  • Posts: 104
  • Karma: 3
  • CiviCRM version: 4.1.2
  • CMS version: Drupal 6 & 7
Re: CiviDiscount Module Extension
September 26, 2012, 10:46:32 pm
Seemed to work that time… I'll have a play, see if I can help at all.
Melbourne CiviCRM meetup group - http://www.meetup.com/MelbourneCiviCRM/

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, 03:16:37 pm
@totolabs  -Disable openbasedir and safe mode in php.ini

Pages: 1 2 [3] 4 5 ... 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.