You are here

function template_preprocess_commerce_worldpay_bg_cancel in Commerce Worldpay 7

Template preprocess for the cancel page.

File

includes/commerce_worldpay_bg.theme.inc, line 93
Theme and pre/process functions.

Code

function template_preprocess_commerce_worldpay_bg_cancel(&$variables) {
  $order = $variables['order'];
  $variables['title'] = t('The transaction has been canceled');
  _template_common_variables_worldpay_bg($variables);
  $url_options = array();
  if ($variables['settings']['payment_urls']['force_non_ssl_links']) {
    $url_options['https'] = FALSE;
  }

  // Return to the previous page when payment is canceled.
  $variables['return_url'] = url('checkout/' . $order->order_id . '/payment/back/' . $order->data['payment_redirect_key'], array(
    'absolute' => TRUE,
  ) + $url_options);
}