Discussions

How I can collapse checkout panes?

Hello everyone!

I have 2 panes in a custom checkout page (one pane is collapsed and one not).
I want that when I click the collapsed pane, this will be visible and the other to collapse automatically.
Is this possible? What property have to change? Can do this using the rules module? What hook can use to do this?

Thanks!

Posted: Dec 12, 2013

Comments

cdaimiel on December 12, 2013

I´m trying use hook_commerce_checkout_pane_info_alter() but I think that It isn´t a good solution for me problem. I´m going to show you my code:

function my_module_commerce_checkout_pane_info_alter(&$checkout_panes) {

foreach ($checkout_panes as $pane_name => & $pane_data)
{
if(($pane_name == 'login_pane')&&($pane_data['collapsed'])){

$checkout_panes['customer_profile_preregistro']['collapsed']=0;

}elseif(($pane_name == 'customer_profile_preregistro')&&($pane_data['collapsed'])){

$checkout_panes['login_pane']['collapsed']=0;
}
}
}

NOTE: "customer_profile_preregistro" and "login_pane" are my pane´s name.

The problem is that the hook is called only one time before the render form (I think hehe), is it correct? When the panes are load if I do click in the title for collapse one pane, the other pane don´t change. I want that only one pane is collapse and the other no.
I don´t know if I explain you correctly.