Drupal 主题化ubercart地址窗格

Drupal 主题化ubercart地址窗格,drupal,ubercart,Drupal,Ubercart,我正在尝试使用form alter设置结帐地址窗格的主题 function mymodule_theme() { return array( 'billing_pane_theme' =>array( 'render element' => 'form', 'path'=> drupal_get_path('theme', 'twitter_bootstrap').'/templates/checkout'

我正在尝试使用form alter设置结帐地址窗格的主题

function mymodule_theme() {
    return array(
        'billing_pane_theme' =>array(
            'render element' => 'form',
            'path'=> drupal_get_path('theme', 'twitter_bootstrap').'/templates/checkout',
            'template' => 'checkout-billing-fields',

        ),

        'delivery_pane_theme' => array(
            'render element' => 'form',
            'path'=> drupal_get_path('theme', 'twitter_bootstrap').'/templates/checkout',
            'template' => 'checkout-delivery-fields',

        ),

    );
}


function mymodule_form_alter(&$form, &$form_state, $form_id) {

    if($form_id == 'uc_cart_checkout_form') {
        $form['panes']['billing']['#theme'] = 'billing_pane_theme';
        $form['panes']['delivery']['#theme'] = 'delivery_pane_theme';


    }
}

当用户第一次单击“签出”按钮或刷新签出页面时,一切都很顺利,但如果用户选择“保存的地址”或“我的账单信息与我的递送信息相同”(通过ajax请求呈现窗格)然后主题不适用,默认地址字段窗格显示

尝试查看#ahah回调属性,并检查返回的表单是否触发alter,我猜它只返回跳过主题的完整表单的一个“片段”。

是的,muka您是正确的,当处理ajax请求时,它只返回签出地址窗格的字段。嗨,我已经更新了ajax请求前后的屏幕截图。是否有任何方法可以应用主题。对此不确定,但您不能通过ajax返回一个已经呈现的表单,比如主题('your___主题',$form,$form_状态)[语法完全是虚构的:]