You are here

function commerce_checkout_complete_rules in Commerce Core 7

Builds the checkout completion Rules Overview page.

1 string reference to 'commerce_checkout_complete_rules'
commerce_checkout_menu in modules/checkout/commerce_checkout.module
Implements hook_menu().

File

modules/checkout/includes/commerce_checkout.admin.inc, line 379
Administrative callbacks for the Checkout module.

Code

function commerce_checkout_complete_rules() {
  RulesPluginUI::$basePath = 'admin/commerce/config/checkout/rules';
  $options = array(
    'show plugin' => FALSE,
  );
  $content['enabled']['title']['#markup'] = '<h3>' . t('Enabled checkout completion rules') . '</h3>';
  $conditions = array(
    'event' => 'commerce_checkout_complete',
    'plugin' => 'reaction rule',
    'active' => TRUE,
  );
  $content['enabled']['rules'] = RulesPluginUI::overviewTable($conditions, $options);
  $content['enabled']['rules']['#empty'] = t('There are no active checkout completion rules.');
  $content['disabled']['title']['#markup'] = '<h3>' . t('Disabled checkout completion rules') . '</h3>';
  $conditions['active'] = FALSE;
  $content['disabled']['rules'] = RulesPluginUI::overviewTable($conditions, $options);
  $content['disabled']['rules']['#empty'] = t('There are no disabled checkout rules.');

  // Store the function name in the content array to make it easy to alter the
  // contents of this page.
  $content['#page_callback'] = 'commerce_checkout_complete_rules';
  return $content;
}