function commerce_checkout_panes
file /commerce/modules/checkout/commerce_checkout.module

drupal_alter('commerce_checkout_pane_info', $checkout_panes); is called too early so “merge in defaults” code overrides every custom value set previously with hook_commerce_checkout_pane_info_alter
See also: http://www.drupalcommerce.org/specification/info-hooks/checkout#checkout...

Sample code for: http://drupal.org/node/1122386

function mymodule_commerce_checkout_pane_info_alter(&$checkout_panes){
If (my_condition) $checkout_panes['cart_contents']['enabled']=FALSE;
/**
 or $checkout_panes['cart_contents']['page']='disabled';
cart_contents or other pane you want to disable
*/
}	

Comments

Drupa1ish’s picture

This patch should fix the issue

rszrama’s picture

It appears we're setting default values inconsistently across our various info structures, however I think the checkout pane process is correct... gather info from modules, allow other modules to fiddle with the data, and then set default values after the fact. This ensures that alteration doesn't wipe out a necessary default value, for example. In your alter hook implementation, why can't you just set $checkout_pane['page'] = 'disabled'? That should do exactly what you're looking for, and it won't be reset by the default values since we use an array merge that preserves the initial values. Does this make sense?

rszrama’s picture

Status: Active » Closed (works as designed)

Just cleaning the queue to prepare for a 1.0.

scoff’s picture

Is there a way to hide 'shipping info' pane if certain shipping method is selected? I can disable it globally using mymodule_commerce_checkout_pane_info_alter but it's not really useful.

rszrama’s picture

That question would be better suited as a feature request in the Shipping module.