function commerce_gc_product_pane_checkout_form_validate in Commerce GC 7
File
- modules/
commerce_gc_product/ includes/ commerce_gc_product.checkout_pane.inc, line 55 - Provides Commerce Checkout pane functionality for giftcards.
Code
function commerce_gc_product_pane_checkout_form_validate($form, &$form_state, $checkout_pane, $order) {
$order_wrapper = entity_metadata_wrapper('commerce_order', $order);
// Validate the line item form(s).
foreach ($order_wrapper->commerce_line_items as $line_item_wrapper) {
if (in_array($line_item_wrapper->type
->value(), commerce_gc_product_giftcard_line_item_types())) {
$line_item = $line_item_wrapper
->value();
$line_item_id = $line_item->line_item_id;
field_attach_form_validate('commerce_line_item', $line_item, $form['commerce_gc_product'][$line_item_id]['line_item_fields'], $form_state);
}
}
return form_get_errors() ? FALSE : TRUE;
}