I am creating a new order through the admin interface, admin/commerce/orders/%/edit. When I add an event to the order an empty REGISTRATION SETTINGS fieldset appears with no way to enter the registration details.

Comments

Tyler the Creator’s picture

I've run into this exact problem. My client would like to be able to physically add registrations into the orders list so that they can keep track of all registrants (those who registered themselves, and those who called in to register) in one spot.

fullsaildan’s picture

Did anyone find a solution to this? I see that there's a Registration Setting's tab that pops up when you try to add an order but it doesn't seem functional. Can we just create a custom page that allows adding a registration without an order id, or does this module need one?

ponies’s picture

Our workaround has been to check out as the user on the front end and make adjustments as needed through the admin interface.

rurri’s picture

This has been an issue for us as well. The case for us is a user signed up for the wrong product.

It stands that we should be able to remove the old line item on the order and add the correct line item, and pay the difference or refund the difference.

There is a Registration Settings fieldset, but it is blank.

scottcielo’s picture

I am building a large site right now and have all of the above issues. The admins need to be able to manually register somebody who emails or calls, and also to remove somebody from one event and add them to another when a mistake has been made.

Any progress being made?

pcorbett’s picture

This seems like the current issue we're experiencing with a new COD site for a Drupal camp in Boston. It would be ideal to add registrations outside of the payment process for sponsors who get complimentary registrations.

markwk’s picture

One solution is to offer a coupon to those users (like sponsors) and then use free payment option when total amount is zero. This keys the current setup but allows registrations like normal.

I totally agree though that we need some admin option to add registrations.

pcorbett’s picture

I don't necessarily condone this particular method, but it has worked for us since the site needed to go live ASAP:

(These instructions are for a D7 COD site, but it should give you a good idea of how to do this in other scenarios)

  1. Click "Register"
  2. Click "Add to Cart"
  3. Click "Checkout"
  4. Choose This Registration is for: "Other Account" (***make sure the user already has an account on the site before proceeding***)
  5. Enter user's name into the autocomplete field
  6. Click "Continue to next step"
  7. Enter the user's info for bookkeeping purposes. You may not have their address, so you'll need to make one up. Let's use "1 Main St., Boston, MA 00000"
  8. Click "Continue to next step"
  9. This is where it gets a bit weird. You should now be able to leave this page and click on Store > Orders > Shopping Cart and see the order you just 1/2 completed with your username in the "User" column.
  10. Click "Edit" next to the cart you created. Make sure this is, in fact, your cart.
  11. Change The "Order Status" toward the bottom to "Completed."
  12. Click "Save Order" at the bottom of page
  13. Now change the "Unit Price" to 0. (not necessary but keeps the books clean)
  14. Click "Save Order" at the bottom of the page again.
  15. Now you should be done. Visit http://yoursite.com/node/1/registrations and make sure the person you just registered is, in fact, registered. It should show that your account in the "created by" column.
svn7svn’s picture

has there really been no progress on this issue in two years?!

sbectol’s picture

Issue summary: View changes

It seems not, it's a big requirement for the project that I'm working on now, the client would like to add registrations from the admin interface when taking telephone orders, which is not an unreasonable request.

Looking at the code of the module there seems to have been an attempt to do this. I'm working my way through the code at the moment.

This is the code that attempts to place the registration forms on the edit/add order page.

From commerce_registration.module line 732

function commerce_registration_form_commerce_order_ui_order_form_alter(&$form, &$form_state, $form_id) {
  $form['registration_settings'] = array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#title' => t('Registration Settings'),
    '#weight' => -6,
    '#collapsed' => TRUE,
  );
 
  if (isset($form_state['values']['commerce_line_items'])) {
    $form['registration_settings']['#collapsed'] = FALSE;
    $products = array();
    foreach ($form_state['values']['commerce_line_items'] as $lang => $items) {
      foreach ($items as $index => $data) {
        $line_item = commerce_line_item_load((int) $data['line_item_id']);
        $line_item_wrapper = entity_metadata_wrapper('commerce_line_item', $line_item);
        if ($line_item_wrapper->type->value() != 'product') {
          continue;
        }
        $product_id = $line_item_wrapper->commerce_product->product_id->value();
        if (in_array($product_id, array_keys($products))) {
          $products[$product_id]++;
        }
        else {
          $products[$product_id] = 1;
        }
      }
    }
    $override_title = variable_get('commerce_registration_product_title', NULL);
    $settings_form = array();
    $show_settings = TRUE;
    $label = 1;
    foreach ($products as $product_id => $quantity) {
      if (registration_status('commerce_product', $product_id, TRUE) == 1) {
        $product = commerce_product_load((int) $product_id);
        $product = entity_metadata_wrapper('commerce_product', $product);
        $show_settings = TRUE;
        $title = check_plain($product->title->value() . ' - Registrant #' . $label++);
        for ($i = 0; $i < $quantity; $i++) {
          if (isset($override_title)) {
            $label = $i + 1;
            $title = str_replace('[title]', $product->title->value(), $override_title);
            $title = str_replace('[index]', $label, $title);
          }
          $form['registration_settings']['prod-' . $product_id . '-' . $i] = array(
            '#markup' => t('Tester'),
          );
          /*$form['registration_settings']['prod-' . $product_id . '-' . $i] = array(
            '#type' => 'fieldset',
            '#collapsible' => TRUE,
            '#collapsed' => TRUE,
            '#title' => $title,
            '#tree' => TRUE,
            '#description' => variable_get('commerce_registration_registrant_help', ''),
          );*/
          $bundle = registration_get_entity_registration_type('commerce_product',
            $product->value());
          if (!function_exists('commerce_registration_create_product_registration')) {
            module_load_include('inc', 'commerce_registration', 'includes/commerce_registration.checkout_pane');
          }
          $entity = commerce_registration_create_product_registration(
            $product_id,
            $bundle,
            0
          );
          /*
          field_attach_form(
            'registration',
            $entity,
            $form['registration_settings']['prod-' . $product_id . '-' . $i],
            $form_state
          );
          */
        }
      }
    }
    if (!$show_settings) {
      unset($form['registration_settings']);
    }
    $form_state['rebuild'] = TRUE;
  }
}

The (isset($form_state['values']['commerce_line_items'])) condition never seems to be met and the code to actually add the form fields to the page are commented out.

I'll post if I make any progress on this.

svn7svn’s picture

best of luck on this!

blacklabel_tom’s picture

Category: Bug report » Feature request

Hi Guys,

This does seem to be a big requirement for a lot of people.

I don't have time myself to implement this, but patches are welcome!

Cheers

Tom

choicelildice’s picture

StatusFileSize
new1.95 KB

Hey everyone,

I also had a client that needed to be able to create registrations for customers (aka via a "cash sale" or over the phone). I created a simple module that allows this action. It creates a page that loads the registration form and allows access and shows a link on the add to cart form if the user has the permission "administer registration". I can either release this module as a standalone module, or if it is preferred, it could be added to the commerce_registration module.

blacklabel_tom’s picture

Status: Active » Needs review

Hi Choicelildice,

Firstly thanks for the effort you've put in!

I think this could be a sub-module of commerce registration as it very tightly related.

I'm going to set this issue to needs review to allow other users of this module to take a look.

Cheers

Tom

svn7svn’s picture

where are we on this? Should I use the .zip file provided by choicelildice or will it be included as a sub-module soon?

choicelildice’s picture

StatusFileSize
new1.3 KB

Svn7svn,

It would be a great help if you wanted to download the zip and give it a try. I think blacklabel_tom is waiting to have the submodule tested by a few more members of the community before adding it to his project.

I also have updated the submodule to make sure we are checking that there are products available for registration before setting the link. I have included the updated code in this new .zip file.

Thanks.

choicelildice’s picture

StatusFileSize
new1.31 KB

Hi all,

1 more fix to not show the link as well as deny access to the page if the user does not have the "administer registration" permission.

Thanks!

blacklabel_tom’s picture

Hi Guys,

If this can be tested I'm happy to roll it in as a sub-module as it would be a great addition.

Cheers

Tom

blacklabel_tom’s picture

Status: Needs review » Fixed

I've rolled this into 2.x dev as a sub module, the people who need it can test it in the next release

choicelildice’s picture

Thanks blacklabel_tom, let me know if you hear of any issues, I'm more than happy to help get them resolved (it's a pretty simple module). For what it's worth, it has been running on a live site for several months now with no reported problems.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

drasgardian’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new18.08 KB

I think finishing the code referenced in #10 would be a better approach here.

In our scenario we had a few orders that were started by customers, but then finished by staff from the admin interface. The staff had no way to create the registrations.

The attached patch adds the registration create form into the order edit form, or if registrations already exist it lists them on the order edit form.

jbabiak’s picture

Patch from #23 worked great. I did however notice I was getting some warnings on create a new order page, so I added a check to make sure it needed a registration form before it tried to load one, I also hid the registration form on the same page, until it there is a order that needs a registration. New patch here (this includes the one from #23)

Edit: Oops, Stick with #23

Status: Needs review » Needs work

The last submitted patch, 24: commerce_registration-admin-add-1781626-24.patch, failed testing.

mgifford’s picture

Sometimes it's useful to post an interdiff if you're modifying a patch - https://www.drupal.org/documentation/git/interdiff

I don't know if hiding the registration form fits within "Add registration from the admin interface" but there's also sometimes a tendency to expand patches when you see other stuff that needs to be taken care of. It's usually better to start a new issue and post it there.

blacklabel_tom’s picture

Hi Guys,

As the 'add a completely new registration through the admin UI' approach has been committed, would someone mind creating a new issue for the 'finish off a partially completed registration' approach please?

They feel like separate issues to me so should have separate issues in the queue. We can then close this ticket down.

Cheers

Tom

acrazyanimal’s picture

Status: Needs work » Fixed

@blacklabel_tom I have done exactly that. Here is the issue for adding a wildly wicked UI for managing registrations through the order admin UI: #2653784: Manage registrations from order edit UI.

Putting this issue back to fixed as the original code here was fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.