This repository has been archived by the owner on Apr 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCRMPfix.patch
84 lines (84 loc) · 4.57 KB
/
CRMPfix.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
diff --git a/sites/all/modules/commerce_registration/includes/commerce_registration.checkout_pane.inc b/sites/all/modules/commerce_registration/includes/commerce_registration.checkout_pane.inc
old mode 100755
new mode 100644
index 266ad0b..0bb6e48
--- a/sites/all/modules/commerce_registration/includes/commerce_registration.checkout_pane.inc
+++ b/sites/all/modules/commerce_registration/includes/commerce_registration.checkout_pane.inc
@@ -19,7 +19,6 @@ function commerce_registration_information_checkout_form($form, &$form_state, $c
$order_values = isset($order->data['register_entities']);
$override_title = variable_get('commerce_registration_product_title', NULL);
$hide_email = variable_get('commerce_registration_hide_email_logged_in', FALSE);
- $i = 0; // Main counter for all the registrations
foreach ($order_wrapper->commerce_line_items as $delta => $line_item_wrapper) {
if (!in_array($line_item_wrapper->type->value(), commerce_product_line_item_types())) {
continue;
@@ -32,7 +31,7 @@ function commerce_registration_information_checkout_form($form, &$form_state, $c
$line_item_id = $line_item_wrapper->line_item_id->value();
$quantity = (int) $line_item_wrapper->quantity->value();
$prodkey = $line_item_id . 'prod-' . $product->sku->value();
- for ($k = 0; $k < $quantity; $k++) {
+ for ($i = 0; $i < $quantity; $i++) {
// We add a single registration for the quantity of the product being
// purchased/registered for.
$label = $i + 1;
@@ -135,8 +134,6 @@ function commerce_registration_information_checkout_form($form, &$form_state, $c
'#type' => 'value',
'#value' => $entity,
);
- // Update the total registration counter
- $i++;
}
}
}
@@ -160,7 +157,6 @@ function commerce_registration_information_checkout_form($form, &$form_state, $c
function commerce_registration_information_checkout_form_validate($form, &$form_state, $checkout_pane, $order) {
$order_wrapper = entity_metadata_wrapper('commerce_order', $order);
$ret = TRUE;
- $i = 0; // Main counter for all the registrations
foreach ($order_wrapper->commerce_line_items as $delta => $line_item_wrapper) {
if (!in_array($line_item_wrapper->type->value(), commerce_product_line_item_types())) {
continue;
@@ -173,7 +169,7 @@ function commerce_registration_information_checkout_form_validate($form, &$form_
$quantity = (int) $line_item_wrapper->quantity->value();
$emails = array();
$self_products = array();
- for ($k = 0; $k < $quantity; $k++) {
+ for ($i = 0; $i < $quantity; $i++) {
$prodkey = $line_item_id . 'prod-' . $product->sku->value();
// Delete the following when we use ER's validation handler.
if (isset($form_state['values']['registration_information'][$prodkey][$prodkey . '-reg-' . $i]['no_reg_permission'])) {
@@ -271,8 +267,6 @@ function commerce_registration_information_checkout_form_validate($form, &$form_
$form['registration_information'][$prodkey][$prodkey . '-reg-' . $i],
$form_state
);
- // Update the total registration counter
- $i++;
}
}
}
@@ -339,7 +333,6 @@ function commerce_registration_information_checkout_form_submit($form, &$form_st
function commerce_registration_information_review($form, $form_state, $checkout_pane, $order) {
$msg = '';
$order_wrapper = entity_metadata_wrapper('commerce_order', $order);
- $i = 0; // Main counter for all the registrations
foreach ($order_wrapper->commerce_line_items as $delta => $line_item_wrapper) {
if (!in_array($line_item_wrapper->type->value(), commerce_product_line_item_types())) {
continue;
@@ -353,7 +346,7 @@ function commerce_registration_information_review($form, $form_state, $checkout_
$msg .= '<em>' . $product->title->value() . ' ('
. format_plural($quantity, '1 registration', '@count registrations')
. '):</em><br />';
- for ($k = 0; $k < $quantity; $k++) {
+ for ($i = 0; $i < $quantity; $i++) {
$prodkey = $line_item_id . 'prod-' . $product->sku->value();
$entity = $order->data['register_entities'][$prodkey][$i];
$l = $i + 1;
@@ -363,8 +356,6 @@ function commerce_registration_information_review($form, $form_state, $checkout_
$msg .= "<strong>" . t("Email") . "</strong>: " . check_plain($email) . "<br />";
$field_view = field_attach_view('registration', $entity, 'review_pane');
$msg .= drupal_render($field_view);
- // Update the total registration counter
- $i++;
}
}
}