List all machine name values for permissions in drupal 7

// Render permission overview:
$options = array();
foreach (module_list(FALSE, FALSE, TRUE) as $module) {
  if ($permissions = module_invoke($module, 'permission')) {
    // List only the modules that have permissions.
    dsm($module);
    dsm($permissions);
  }
}

Drupal commerce - change order status when order is locked

This is a helper function when order is locked, validation fails and status cant be changes.

$order = commerce_order_load('219215');
commerce_order_status_update($order, 'pending', FALSE, FALSE);
commerce_order_save($order);

Drupal commerce - change order status when order is locked

This is a helper function when order is locked, validation fails and status cant be changes.

$order = commerce_order_load('219215');
commerce_order_status_update($order, 'pending', FALSE, FALSE);
commerce_order_save($order);

An overview of Drupal's cache_clear_all uses

Drupal has a very simple, yet powerful (low level) caching system. It provides 3 functions that should please all you caching needs: cache_get, cache_set and cache_clear_all. The first two are pretty straight forward to use, but the third one might take some time to wrap your head around.