Disconnect registration number from product quantity

Created on 4 September 2013, over 11 years ago
Updated 28 February 2025, about 1 month ago

Good afternoon.

Is it possible to suggest a hook based method to compute the nmber of registration per line item?
For the time being, we have

+++ b/sites/all/modules/commerce_registration/includes/commerce_registration.checkout_pane.inc
@@ -30,6 +30,10 @@ function commerce_registration_information_checkout_form($form, &$form_state, $c
       $product = $line_item_wrapper->commerce_product;
       $quantity = (int) $line_item_wrapper->quantity->value();

but if we could have

+      $bundle_single_type = registration_get_entity_registration_type('commerce_product', $product->value());
+      $quantity = module_invoke_all("registration_information_checkout_quantity", $bundle_single_type,$quantity);

Then we would be able to control that with a hook_registration_information_checkout_quantity.
Per default, registration_information_checkout_quantity would return $quantity.

Example of usage being product that requires only one registration (several attendees for the same events, one registration required).

This updates have to applied as

  • commerce_registration_information_checkout_form
  • commerce_registration_information_checkout_form_validate
  • commerce_registration_information_checkout_form_submit
  • commerce_registration_information_review
✨ Feature request
Status

Closed: outdated

Component

Code

Created by

πŸ‡«πŸ‡·France JulienThomas

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024