Score:1

How can I programmatically configure commerce checkout pane settings?

us flag

In Commerce, we have custom pane and checkout configuration that applies to all orders. Per this d.o issue in commerce_features, this is supposedly doable. However, Commerce's default configuration always comes over.

In my feature that Feature creates, it generates the following code:

/**
 * @file
 * my_module_config.features.commerce_checkout_panes.inc
 * 
*/

/**
 * Implements hook_commerce_checkout_panes_default()
 * /
function my_module_commerce_checkout_panes_default() {
  $panes = array();
  $panes = ['account'] = array(
    'page' => 'checkout',
  etc.....
}

All of my panes are there, but they contain Commerce's default configuration, not my custom.

Either the module doesn't work as designed or I'm not using it correctly, either way, I feel this can be done a lot faster / easier programmatically.

All the info I'm finding around .. hook_ .. pane_info_alter() has to deal with changing panes for a particular order or using hook_form_alter to do it on the fly.

I don't want that. In my module.install I want to implement the custom configuration there so that it can still be overridden if needed in the future.

How can I set the global settings rather than have to do it on hook_form_alter for each order?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.