Adding AJAX to drupal commerce checkout pane I need to add dependable fields to Drupal Commerce checkout. I wrote my own module to do this but AJAX seems to not work.
Here is the code of my module:

function moje_panele_pane_checkout_form($form, &amp;$form_state) {
  //parent item
  $form['sposob_dostawy'] = array(
    '#type' =&gt; 'select',
    '#title' =&gt; t('Wybierz sposób dostawy'),
    '#options' =&gt; array(
      0 =&gt; t('Kurier'),
      1 =&gt; t('Odbiór osobisty'),
    ),
    '#ajax' =&gt; array(
    'callback' =&gt; 'my_checkout_ajax_callback',
    'wrapper' =&gt; 'dane-do-odbioru',
      'method' =&gt; 'replace',
      'effect' =&gt; 'fade',
    ),
  );
  //child markup
  $form['dane_do_odbioru'] = array(
    '#title' =&gt; t("Dane do odbioru"),
    '#prefix' =&gt; '&lt;div id="dane-do-odbioru"&gt;',
    '#suffix' =&gt; '&lt;/div&gt;',
    '#type' =&gt; 'markup',
  );
  //dependent field
  if ($form_state['values']['moje_panele_pane']['sposob_dostawy'] == 1) {
    $form['dane_do_odbioru'] = array(
      '#title' =&gt; t("Dane do odbioru"),
      '#prefix' =&gt; '&lt;div id="dane-do-odbioru"&gt;',
      '#suffix' =&gt; '&lt;/div&gt;',
      '#type' =&gt; 'fieldset',
    );
    $form['dane_do_odbioru']['imie'] = array(
      '#type' =&gt; 'textfield', 
      '#title' =&gt; t('Imię'), 
      '#size' =&gt; 60, 
      '#maxlength' =&gt; 128, 
      '#required' =&gt; TRUE,
    );
  return $form;
}

//my AJAX callback
function my_checkout_ajax_callback($form, $form_state) {
  return $form['dane_do_odbioru'];
}


The above code works fine on normal Drupal page, but I cannot make it work on checkout page as a pane.

What am I doing wrong?
I think it might have to be related with the classes on the checkout form, if you check the commerce shipping module - it has a good ajax example on replacements - you can see how it does:

// Add a radios element to let the customer select a shipping service.
$pane_form['shipping_service'] = array(
  '#type' =&gt; 'radios',
  '#options' =&gt; $options,
  '#ajax' =&gt; array(
    'callback' =&gt; 'commerce_shipping_pane_service_details_refresh',
    'wrapper' =&gt; 'commerce-shipping-service-details',
  ),
);


And then it forces the class with a prefix:

$pane_form['service_details']['#prefix'] = '&lt;div id="commerce-shipping-service-details"&gt;';
$pane_form['service_details']['#suffix'] = '&lt;/div&gt;';


The ajax callback is the usual one:

/**
 * Ajax callback: Returns the shipping details form elements that match the
 * currently selected shipping service.
 */
function commerce_shipping_pane_service_details_refresh($form, $form_state) {
  return $form['commerce_shipping']['service_details'];
}


So definitely possible, check the css classes you're dealing with.