I really the idea of this module - the UX concept is a far more appropriate flow of activities: the user registers, then pays to confirm place. So thank you for putting something concrete online.

It would be nice if this was on DEV... although it can be grabbed via Git through http://drupalcode.org/project/registration_commerce.git/commit/b172549. Are you going to persist, or is the concept abandoned?

I can't get the module to work at all (trying out with the 'Kickstart' distro). I create a Registration Type for a registrant (at /admin/structure/registration/registration_types). As soon as I add a 'Registration' field to my content type, I hit a white screen.

Drupal generates the following errors:

  • Notice: Undefined index: entity_type in registration_commerce_registration_entity_settings() (line 39 of .../sites/all/modules/registration_commerce/registration_commerce.module).
  • Notice: Undefined index: entity_id in registration_commerce_registration_entity_settings() (line 39 of .../sites/all/modules/registration_commerce/registration_commerce.module).
  • Notice: Undefined index: controller class in entity_get_controller() (line 7678 of .../includes/common.inc).

And PHP has the error logged as Fatal. PHP Fatal error: Class name must be a valid object or a string in /Users/rgcarr/Sites/kickstart/includes/common.inc on line 7679

Looking at the hook_registration_entity_settings() implementation, you only have one paramater being passed ($settings), whereas in the Registration module (using 7.x-1.0-beta3), the values $entity_type and $entity_id are passed in function registration_entity_settings($entity_type, $entity_id) .

/**
 * Implements hook_registration_entity_settings().
 */
function registration_commerce_registration_entity_settings($settings) {
  $form = array();

  $entity = entity_load_single($settings['entity_type'], $settings['entity_id']);
  $registration_bundle = registration_get_entity_registration_type($settings['entity_type'], $entity);

  $product_field = NULL;
  $instances = field_info_instances('registration', $registration_bundle);
  foreach (commerce_info_fields('commerce_product_reference', 'registration') as $field_name => $field) {
    if (isset($instances[$field_name])) {
      $product_field = $field;
      break;
    }
  }

  $form['settings']['commerce'] = array(
    '#type' => 'fieldset',
    '#title' => t('Registration Commerce Settings')
  );

  if ($product_field) {
    $form['settings']['commerce']['commerce_enable'] = array(
      '#type' => 'checkbox',
      '#title' => t('Enable paid registrations'),
      '#default_value' => isset($settings['settings']['commerce_enable']) ? $settings['settings']['commerce_enable'] : 0
    );

    $form['settings']['commerce']['commerce_products'] = array(
      '#type' => 'select',
      '#title' => t('Products'),
      '#options' => commerce_product_reference_options_list($product_field),
      '#multiple' => TRUE,
      '#default_value' => isset($settings['settings']['commerce_products']) ? $settings['settings']['commerce_products'] : 0,
      '#description' => t('Select which products should be available to this registration. If only one is selected, the product field will be hidden.')
    );
  }
  else {
    $form['settings']['commerce']['message'] = array(
      '#markup' => t('Registration commerce is enabled, but you must add a product field to the registration bundle used for this event to accept paid registrations.')
    );
  }

  return $form;
}

Am I barking up the wrong tree here? Hope you can help...

Comments

robcarr’s picture

And for info, the error generated in common.inc (line 7679) is in function entity_get_controller($entity_type) $controllers[$entity_type] = new $class($entity_type);

This function isn't called directly by registration_commerce, so not sure where this problem comes from.

lsolesen’s picture

robcarr’s picture

I have... and it's a 90% solution for what I'm currently working on, so I'll have to run with Commerce Registration for the moment. I wanted to make a distinction between registrations and payments, and Registration Commerce 2 potentially offered that. Guess I'll never know...

tauno’s picture

Version: » 7.x-1.0-alpha1
Status: Active » Closed (won't fix)

Closing out very old issues.