function commerce_registration_commerce_checkout_complete in Commerce Registration 7.3
Same name and namespace in other branches
- 7.2 commerce_registration.module \commerce_registration_commerce_checkout_complete()
Implements hook_commerce_checkout_complete().
File
- ./
commerce_registration.module, line 603 - Commerce Registration module code.
Code
function commerce_registration_commerce_checkout_complete($order) {
$order_wrapper = entity_metadata_wrapper('commerce_order', $order);
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;
}
$id = (int) $line_item_wrapper->commerce_product->product_id
->value();
if (commerce_registration_product_has_registration_field($id)) {
commerce_registration_update_line_item_registrations($line_item_wrapper);
}
}
}