You are here

function uc_checkout_pane_coupon_automatic in Ubercart Discount Coupons 7.3

Same name and namespace in other branches
  1. 7.2 uc_coupon.module \uc_checkout_pane_coupon_automatic()

A checkout pane listing any automatic discounts.

1 string reference to 'uc_checkout_pane_coupon_automatic'
uc_coupon_uc_checkout_pane in ./uc_coupon.module
Implements hook_uc_checkout_pane().

File

./uc_coupon.module, line 1551
Provides discount codes and gift certificates for Ubercart.

Code

function uc_checkout_pane_coupon_automatic($op, &$order, $form = NULL, &$form_state = NULL) {
  if ($op == 'view') {
    $discounts = _uc_coupon_options_list(uc_coupon_session_validate(), FALSE);
    if (empty($discounts)) {
      $inner_contents = array(
        '#markup' => t('None.'),
      );
    }
    else {
      $inner_contents = array(
        '#theme' => 'item_list',
        '#items' => _uc_coupon_options_list(uc_coupon_session_validate(), FALSE),
      );
    }
    return array(
      'theme' => 'uc_coupon_automatic_discounts',
      'contents' => array(
        'discounts' => $inner_contents,
      ),
    );
  }
}