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) »
  • Stop new Price Set creation when Event is created/copied.
Pages: [1]

Author Topic: Stop new Price Set creation when Event is created/copied.  (Read 5626 times)

Klyntone

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • is this thing on...
    • clinton.tech
  • CiviCRM version: var 3.2 to 4.3
  • CMS version: drupal 6 and 7
  • MySQL version: 5.1.68-cll
  • PHP version: 5.3.13
Stop new Price Set creation when Event is created/copied.
May 27, 2013, 09:03:32 pm
Hello we just updated to CiviCRM 4.3.3

As far as I can tell it is now the case that: copying of event template to event template, copying of event template to event, copying of event to event will will result in the creation on a unique Price Set e.g. Price Set [Copy id 157]

Our initial registrations only require a deposit so we use the price set to do that, letter we direct customers to a not public event to pay the balance.

Is there any way to turn off this Price Set creation/replication with every new event that is created/copied?

Thank you for any assistance.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Stop new Price Set creation when Event is created/copied.
May 27, 2013, 10:11:56 pm
Quote
Is there any way to turn off this Price Set creation/replication with every new event that is created/copied?

I can't think of any other way beside hacking / modifying core code.

Kurund
Found this reply helpful? Support CiviCRM

Klyntone

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • is this thing on...
    • clinton.tech
  • CiviCRM version: var 3.2 to 4.3
  • CMS version: drupal 6 and 7
  • MySQL version: 5.1.68-cll
  • PHP version: 5.3.13
Re: Stop new Price Set creation when Event is created/copied.
May 28, 2013, 02:09:19 am
Thanks Kurund,

I thought that might be the case having not found anything in the settings.

Do you have any idea of the file and path where the offending lines might be found?

I would be grateful for any clues, I find the CiviCRM folder structure a bit of a maze, so many identical folder names down different paths.

Thanks again.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Stop new Price Set creation when Event is created/copied.
May 28, 2013, 03:26:52 am
You should check CRM_Event_BAO_Event::copy()  ( file: CRM/Event/BAO/Event.php )

Kurund
« Last Edit: May 28, 2013, 03:30:18 am by Kurund Jalmi »
Found this reply helpful? Support CiviCRM

Klyntone

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • is this thing on...
    • clinton.tech
  • CiviCRM version: var 3.2 to 4.3
  • CMS version: drupal 6 and 7
  • MySQL version: 5.1.68-cll
  • PHP version: 5.3.13
Re: Stop new Price Set creation when Event is created/copied.
May 28, 2013, 06:08:22 pm
Thanks for the tip,I will have a look see and let you know how it goes, cheers.

Solved:
Look for  $priceSetId = CRM_Price_BAO_Set::getFor('civicrm_event', $id)  in file: CRM/Event/BAO/Event.php

it was at line 869 in my Event.php

    $priceSetId = CRM_Price_BAO_Set::getFor('civicrm_event', $id);
    if ($priceSetId) {
    /*  $isQuickConfig = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $priceSetId, 'is_quick_config');
      if(!$isQuickConfig) {
        $copyPriceSet = &CRM_Price_BAO_Set::copy($priceSetId);
        CRM_Price_BAO_Set::addTo('civicrm_event', $copyEvent->id, $copyPriceSet->id);
      } else {*/
        $copyPriceSet = &CRM_Core_DAO::copyGeneric('CRM_Price_DAO_SetEntity',
          array(
            'entity_id' => $id,
            'entity_table' => 'civicrm_event',
          ),
          array('entity_id' => $copyEvent->id)
        );
      }
   /* }*/

commenting out the whole section worked but there was no price set assigned to newly created/copied courses.

commenting out from 3rd line to 7th line and last } makes new courses be created with the original price set that the copied course was using.

Thank you for your help Kurund
« Last Edit: May 28, 2013, 09:26:38 pm by Klyntone »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Stop new Price Set creation when Event is created/copied.

This forum was archived on 2017-11-26.