You are here

function commerce_cp_builder_form_save_submit in Commerce Cart Pane 7

Submit handler for the cart builder form's save button.

1 string reference to 'commerce_cp_builder_form_save_submit'
commerce_cp_builder_form in ./commerce_cp.admin.inc
Build the cart form builder, adding in data for the cart pages and the appropriate fields to enable tabledrag on the cart panes.

File

./commerce_cp.admin.inc, line 120
Administrative callbacks for the Checkout module.

Code

function commerce_cp_builder_form_save_submit($form, &$form_state) {
  $panes_by_weight = array();

  // Loop through each of the cart panes.
  if (!empty($form_state['values']['panes'])) {
    foreach ($form_state['values']['panes'] as $pane_id => $data) {
      if ($data['page'] == 'cart') {
        $panes_by_weight[$pane_id] = $data['weight'];
      }
    }
  }
  variable_set('commerce_cp_panes_weight', $panes_by_weight);
}