You are here

function commerce_cart_expiration_page_explanation in Commerce Cart Expiration 7

Callback for cart/expired.

1 string reference to 'commerce_cart_expiration_page_explanation'
commerce_cart_expiration_menu in ./commerce_cart_expiration.module
Implements hook_menu().

File

./commerce_cart_expiration.module, line 311
Provides a time-based cart expiration feature.

Code

function commerce_cart_expiration_page_explanation() {
  global $user;

  // Return prerendered content if available.
  if (isset($_SESSION['commerce_cart_expiration_text'])) {
    $text = $_SESSION['commerce_cart_expiration_text'];
    unset($_SESSION['commerce_cart_expiration_text']);
    return $text;
  }

  // Otherwhise create content here without replacing commerce_order tokens.
  $text = variable_get('commerce_cart_expiration_explanation_page', '<p>' . t('Sorry, you took too much time in the checkout process.') . '</p><p>' . t('<a href="[site:url]">Return to the front page.</a>') . '</p>');
  if (is_array($text)) {
    $text = check_markup($text['value'], $text['format']);
  }
  return token_replace($text, array(
    'site' => NULL,
    'user' => $user,
  ));
}