You are here

function uc_cart_continue_shopping_url in Ubercart 7.3

Same name and namespace in other branches
  1. 6.2 uc_cart/uc_cart.module \uc_cart_continue_shopping_url()

Returns the URL redirect for the continue shopping element on the cart page.

Parameters

bool $unset: TRUE or FALSE indicating whether or not to unset the last URL variable.

Return value

string The URL or Drupal path that will be used for the continue shopping element.

2 calls to uc_cart_continue_shopping_url()
uc_cart_view_form in uc_cart/uc_cart.module
Displays the contents of the customer's cart.
uc_cart_view_form_continue_shopping in uc_cart/uc_cart.module
Continue shopping redirect for uc_cart_view_form().

File

uc_cart/uc_cart.module, line 822

Code

function uc_cart_continue_shopping_url($unset = TRUE) {
  $url = '';

  // Use the last URL if enabled and available.
  if (variable_get('uc_continue_shopping_use_last_url', TRUE) && isset($_SESSION['uc_cart_last_url'])) {
    $url = $_SESSION['uc_cart_last_url'];
  }

  // If the URL is still empty, fall back to the default.
  if (empty($url)) {
    $url = variable_get('uc_continue_shopping_url', '');
  }

  // Unset the last URL if specified.
  if ($unset) {
    unset($_SESSION['uc_cart_last_url']);
  }
  return $url;
}