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 CiviContribute (Moderator: Donald Lobo) »
  • Fixed Contribution Options
Pages: [1] 2

Author Topic: Fixed Contribution Options  (Read 4481 times)

mixxmedia

  • Guest
Fixed Contribution Options
November 20, 2007, 06:32:52 am
We need to have 12 fixed fee options. Currently the system only allows for 10. Can this be changed? Also can the order of the fees be stipulated or is it random? It seems everytime we save a new list of fees with their corresponding labels and then preview in our Joomla front end, the order changes.

Thanks

joomla - 1.0.12
civicrm - 1.8.11536

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: Fixed Contribution Options
November 20, 2007, 08:38:34 am

yes, you'll need to hack the code to make the change.

CRM/Event/Form/ManageEvent/Fee.php, line 49 or so (const NUM_OPTION)

regarding the ordering, i suspect we order it based on ids which probably is not the best thing (but in general works for most cases if u create those amounts just once). If you can reproduce a scenario where the ordering is quite messed up, can you please file an issue and we'll take a look and fix in the 2.x series

thanx

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

mixxmedia

  • Guest
Re: Fixed Contribution Options
November 20, 2007, 08:43:24 am
Would I be able to edit the IDs in phpmyAdmin ?

mxm

mixxmedia

  • Guest
Re: Fixed Contribution Options
November 20, 2007, 08:51:18 am
Actually I think the page I was looking for is:

CRM/Contribute/Form/ContributionPage/Amount.php, line 49 or so (const NUM_OPTION)

Thanks for pointing me in the right direction though.

mxm

mixxmedia

  • Guest
Re: Fixed Contribution Options
November 20, 2007, 09:12:40 am
Lobo

I changed the const NUM_OPTION to =12 in  both the CRM/Event/Form/ManageEvent/Fee.php file as well as the CRM/Contribute/Form/ContributionPage/Amount.php file. When we log into the admin >> CiviContibute >> Manage Contribution Page ... we still only get 10 options for the Fixed Contribution Fields.

Is there a cache I should be dumping?

Thanks

mxm

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Fixed Contribution Options
November 20, 2007, 06:02:00 pm
I'm assuming you're trying to make this change on a Online Contribution Page (rather than an Event Registration page). If so, you also need to change the loop counter in the associated template file:

templates/CRM/Contribute/Form/ContributionPage/Amount.tpl

Modify line 51:
Code: [Select]
{section name=loop start=1 loop=11}
Protect your investment in CiviCRM by  becoming a Member!

mixxmedia

  • Guest
Re: Fixed Contribution Options
November 21, 2007, 07:01:06 am
Thanks Dave.. that worked. So in order to get 12 Fixed Contribution Amounts, I needed to set the following:

CRM/Contribute/Form/ContributionPage/Amount.php, line 49 or so (const NUM_OPTION) set to =13

and

templates/CRM/Contribute/Form/ContributionPage/Amount.tpl  - ( line 51 {section name=loop start=1 loop=11} also set to 13 )

----

My other questions regarding the order of the Contribution labels. Lobo mentioned that they might be recorded by IDs, and therefore sort themselves accordingly. Since we have made some edits and may make more in the future, is there a way to ensure the list of Contribution labels stays in our preferred ordering system? I can't seem to find any record of them using phpmyadmin (thought maybe that would be a way).

mxm

phel0049

  • Guest
Re: Fixed Contribution Options
November 21, 2007, 02:02:50 pm
I have this problem, too.  No matter how I change the amounts, even just leaving them as-is, they are always out of order.  I'd love to fix this.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Fixed Contribution Options
November 21, 2007, 02:56:50 pm
We are fixing this issue in 2.0.

For 1.9, you'll have to do a code hack and some edits in the the database as follows:

1. Code hack - add the following line just below line 353 in CRM/Core/BAO/CustomOption.php
Code: [Select]
$dao->orderBy('weight');
(this is above the $dao->find(); line)

2. Review and modify the "weight" column values in the civicrm_custom_option table as needed to get the sort you want. Look for the records where entity_table is 'civicrm_contribution_page' and you'll find your amount options.

(note that if you modify the amounts in Configure Online Contribution Page >> Amounts ... you may need to repeat step 2 - as the update doesn't necessarily set the weights in the order you see the options listed on your screen)
Protect your investment in CiviCRM by  becoming a Member!

mixxmedia

  • Guest
Re: Fixed Contribution Options
November 21, 2007, 03:12:21 pm
We're using civicrm - 1.8.11536

Can we try the same hack?

Thanks

mxm

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: Fixed Contribution Options
November 21, 2007, 04:12:05 pm

yes, the same hack should work in 1.8

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

mixxmedia

  • Guest
Re: Fixed Contribution Options
November 22, 2007, 07:26:27 am
Thanks, the hack worked perfectly.

cheers

mxm

mixxmedia

  • Guest
Re: Fixed Contribution Options
November 22, 2007, 10:55:16 am
Back again.. Sorry

Anyway of aligning the list of Fixed Contributions in a table? We have 12 fees and would like to place them in a 2 column table. Is this possible?

Thanks

mxm

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Fixed Contribution Options
November 22, 2007, 11:08:50 am
You might be able to do this by add a <table> surrounding $form.amount.html in Contribute/Form/Contribution/Main.tpl  and then playing with the way the radio button elements are generated in buildAmount() function of Contribute/Form/Contribution/Main.php.

If looks like you can prepend '<tr><td>' in front of the amount, and '</td><td>' between amount and label etc. Note that all the radio button options are "assembled" into the actual form field a bit lower down, and that a line break is inserted between each option (last parameter) - which you'll probably want to eliminate.

Code: [Select]
$this->addGroup( $elements, 'amount', ts('Contribution Amount'), '<br />' );
Protect your investment in CiviCRM by  becoming a Member!

mixxmedia

  • Guest
Re: Fixed Contribution Options
November 22, 2007, 11:25:56 am
Sounds intimidating. Will give it a go.

Thanks

mxm

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Fixed Contribution Options

This forum was archived on 2017-11-26.