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) »
  • Automation of the creation of a contribution page
Pages: [1]

Author Topic: Automation of the creation of a contribution page  (Read 1000 times)

dlwilson007

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
    • Rio Coco Kids
Automation of the creation of a contribution page
November 12, 2010, 09:21:08 am
Hi,

I am helping my developer automate our contribution page creation.  We are using Joomla 1.5.22 and it looks like CiviCRM 3.2.2.  We have all the data needed to populate the _contribution_page table and the _tell_friend table.  There are only one piece left that I can't seem to figure out.  My developer can probably figure it out, but he's not available for a while and I'm trying to get ahead.

For our standard contribution page we are creating, one feature we want is the fixed contribution amounts to be set with a default to the first amount.

I found the default_amount_id field in the _contribution_page table that ties to the _option_value table to get the default amount.  However, this is the only _contribution_page field that appears to relate to the fixed amounts, yet when I insert a row of data into the table manually, the new contribution page does not list the fixed amount options.  Apparently there is some kind of function or trigger that is populating another table to make it happen, but I can't figure out what is happening.

Can someone shed some light and either explain how the page is formed, or point me to the documentation that might help me best?

Also, there may be one modification I would need to make this work best.  I notice that for each new contribution page created, the _options_value table adds new fixed payment amount options.  For our automation, each contribution page that is created would need to have the same fixed values for payment options, so we would therefore want to reuse the same group data for those fixed values.

Thanks in advance for anyone that can help or point me in the right direction!

David
« Last Edit: November 12, 2010, 10:31:12 am by dlwilson007 »

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Automation of the creation of a contribution page
November 12, 2010, 10:44:08 am
Hi - I hit this too creating events - I wanted to fix up the API so it could do it but I think I decided price sets would be an easier route
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

dlwilson007

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
    • Rio Coco Kids
Re: Automation of the creation of a contribution page
November 12, 2010, 11:02:21 am
Understood, and that makes sense.  Only problem is that is not the only lookup or association that we'll need to control going forward, so we're still running down the API path.

For anyone reading the thread, what we are doing is creating a list of children that are going to be available for sponsorship, and then for each child, we'll create a contribution page through CiviCRM.  We built an app using Ruby on Rails for managing the children and their sponsorship status, and then let CiviCRM handle the presentation and the accounting.

The added functionality we include is the ability to associate a child to a sponsor.  So when a child is sponsored, they are no long in the pool of available children.  When sponsorship ends (expires, or is terminated by sponsor or administratively by our staff) then the child goes back in the pool of available children.

We are on the last step of integration, so as soon as I get this question answered, we'll have a functional and integrated system that we'll be able to test and deploy.

Did I write too much?  Ha...I'm excited, and therefore sometimes get wordy.  :)

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: Automation of the creation of a contribution page
November 12, 2010, 11:53:14 am

hey

the contribution and event pages create a "hidden" option group (civicrm_option_group, civicrm_option_value) which holds all the amounts (and the labels/values etc).

the name of the option group is: civicrm_contribution_page.amount.CONTRIBUTION_PAGE_ID

not sure why we did it that way rather than including the option_group_id key in the _page table (pretty brain dead, IMO)

but to defend this "awful" decision, i think we had a different structure and we transitioned it to the current scheme and tried to make the migration easy (or some reason like that)

the corresponding event option group is named: "civicrm_event.amount.{$eventID}"

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

dlwilson007

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
    • Rio Coco Kids
Re: Automation of the creation of a contribution page
November 12, 2010, 12:01:23 pm
Thanks Lobo!

I did see the option groups, and my developer can probably work with that (I'm not savvy enough to know exactly how that gets tied in).

However, my other question is this...for our automation, do you know of any negative impact if rather than using the CONTRIBUTION_PAGE_ID, we made it static to a single ID...so all contribution pages created through our API would then have the same options available?

If I sound in over my head, then I may toss this over the fence to my developer.

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: Automation of the creation of a contribution page
November 12, 2010, 12:09:29 pm

Will be hard to do that without hacking the code :(

ideally we should move that option group id to the contribution_page table. that way multiple contribution pages can share the same amount(s)

if u'd like to help make this change, contact us on IRC and we can potentially get this done for 3.4

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

dlwilson007

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
    • Rio Coco Kids
Re: Automation of the creation of a contribution page
November 12, 2010, 12:17:23 pm
I would love to...problem is, I'm basically just a BA and I've never used IRC before...so all this is pretty new to me (not BA work...10+ years there).

Is there some kind of documented process to guide me along if I were to attempt to help out?  How to developers figure all this out?

Getting a little off topic...sorry for anyone reading the thread!

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Automation of the creation of a contribution page
November 12, 2010, 07:12:34 pm
This wiki page might help:
http://wiki.civicrm.org/confluence/display/CRM/Developing+with+the+CiviCRM+team
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Automation of the creation of a contribution page

This forum was archived on 2017-11-26.