drupal commerce conditional checkout panes I have used the following module to add a custom checkout pane to get some additional information from the user regarding the order.

https://drupal.org/project/commerce_fieldgroup_panes

I now need to apply a condition that if the order contain a product of specific product type then display this pane else hide it.

Can some one please guide me how can I do this.

I have found the following code from https://drupal.org/node/1807092 but I don't know how to modify it according my need. Looking for some help on how to modify &amp; use this code.

&lt;?php function commerce_conditional_panes_commerce_checkout_pane_info_alter(&amp;$checkout_panes, $form, &amp;$form_state) {
global $user;
foreach($checkout_panes as $pane_name =&gt; &amp;$pane_data) {
    // load current order
    $order = commerce_cart_order_load($user-&gt;uid);
    // retrieve the value of controlling field
    $order_wrapper = entity_metadata_wrapper('commerce_order', $order);
    $control = $order-&gt;field_make['und']['0']['value'];
    // Perform switch to see what to do with each aircraft make
    switch ($control)
    {
       case "value1":
         break;
       case "value2":
         break;
       case "value3":
         break;
       case "value4":
         break;
       case "value5":
         break;
       case "value6":
         // ...we only need to override one of them
         if($pane_name == 'commerce_fieldgroup_pane__conditional_pane' &amp;&amp; $pane_data['enabled']) {
           // the pane is enabled by default, so we need to disable it
           $pane_data['enabled'] = 0;
         }
         break;
       case "value6":
         break;
       case "value7":
         break;
       case "value8":
         break;
       default:
         break;
       }
    }
}
?&gt;
It's surely too late for your project... Anyway, you may use Commerce Rules Extra,  it adds the exact features you need :


  
  Rules conditions : Total product of type quantity comparison : Total
  of products of specified type and with a specified quantity
  Rules actions : Change pane properties : Change visibility, page,
  weight of a pane
  


Once you installed it, in checkout settings , set your pane as disabled by default and create a new rule


event: Process checkout pane
conditions: Total product of type quantity comparison 

Parameter: Order: [commerce_order] 
Product Type: YOUR PRODUCT TYPE
Operator: >, Quantity: 0

action : Change pane properties

Parameter: Id of pane to change: YOUR PANE
Enabled: true
move to : checkout