主题ubercart地址窗格

问题描述 投票:0回答:1

我正在使用form alter尝试使用checkout地址窗格。

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请求呈现)则主题不适用,默认地址字段窗格正在显示

drupal ubercart
1个回答
0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.