You are here

function commerce_cart_expiration_rules_action_info in Commerce Cart Expiration 7

Implements hook_rules_action_info().

File

./commerce_cart_expiration.rules.inc, line 14
Rules integration for Commerce Cart Expiration.

Code

function commerce_cart_expiration_rules_action_info() {
  $actions = array();
  $actions['commerce_cart_expiration_delete_orders'] = array(
    'label' => t('Remove all expired cart orders'),
    'parameter' => array(
      'interval' => array(
        'type' => 'duration',
        'label' => t('Cart expiration interval'),
        'description' => t('Time span until shopping carts are considered expired.'),
      ),
      'limit' => array(
        'type' => 'integer',
        'label' => t('Number of shopping carts to process'),
        'description' => t('Number of shopping carts to process at a time. Useful for sites having a considerable amount of orders. Set to 0 for unlimited.'),
      ),
    ),
    'group' => t('Commerce Cart'),
    'callbacks' => array(
      'execute' => 'commerce_cart_expiration_delete_orders',
    ),
  );
  $actions['commerce_cart_expiration_reset_orders'] = array(
    'label' => t('Resets status of all expired cart orders'),
    'parameter' => array(
      'interval' => array(
        'type' => 'duration',
        'label' => t('Cart expiration interval'),
        'description' => t('Time span until shopping carts are considered expired.'),
      ),
      'limit' => array(
        'type' => 'integer',
        'label' => t('Number of shopping carts to process'),
        'description' => t('Number of shopping carts to process at a time. Useful for sites having a considerable amount of orders. Set to 0 for unlimited.'),
      ),
      'status' => array(
        'label' => t('Status'),
        'type' => 'text',
        'options list' => 'commerce_order_status_options_list',
        'description' => t('Expired orders will be reset to this order status.'),
      ),
    ),
    'group' => t('Commerce Cart'),
    'callbacks' => array(
      'execute' => 'commerce_cart_expiration_reset_orders',
    ),
  );
  return $actions;
}