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) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Create a priceset via the API
Pages: [1]

Author Topic: Create a priceset via the API  (Read 337 times)

CatorgHans

  • I post frequently
  • ***
  • Posts: 157
  • Karma: 5
  • CiviCRM version: 4.4
  • CMS version: drupal
Create a priceset via the API
March 29, 2015, 06:25:06 am
I want to create a priceset for an event via the API.

This is a print_r of the $params var.
Code: [Select]
Array
(
    [name] => country_inside_29
    [title] => Country Inside
    [is_active] => 1
    [extends] => 1
    [financial_type_id] => 4
    [is_quick_config] => 1
    [is_reserved] => 0
    [entity] => Array
        (
            [civicrm_event] => Array
                (
                    [0] => 29
                )

        )

)

The problem is that the civicrm_price_set_entity is not filled and it seems that that table does not have an api.

Is there a way to create a priceset for an event via the api?

CatorgHans

  • I post frequently
  • ***
  • Posts: 157
  • Karma: 5
  • CiviCRM version: 4.4
  • CMS version: drupal
Re: Create a priceset via the API
March 31, 2015, 12:09:56 am
Found the solution:

        $pricesetparams["entity_table"] = "civicrm_event";
        $pricesetparams["entity_id"] = $neweventid;

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Create a priceset via the API
March 31, 2015, 12:32:49 am
Thanks for sharing :-)
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Create a priceset via the API

This forum was archived on 2017-11-26.