You are here

function uc_coupon_theme_uc_cart_block_content in Ubercart Discount Coupons 7.3

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

Theme override for the default cart block content. Removes coupons from the total number of items.

1 string reference to 'uc_coupon_theme_uc_cart_block_content'
uc_coupon_theme_registry_alter in ./uc_coupon.module
Implements hook_theme_registry_alter().

File

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

Code

function uc_coupon_theme_uc_cart_block_content($variables) {
  if (variable_get('uc_coupon_show_in_cart', TRUE) && !empty($variables['items'])) {
    foreach ($variables['items'] as &$item) {
      if ($item['nid'] == 0 && $item['price'] <= 0) {
        $item['qty'] = '';
        $variables['item_count']--;
      }
    }
    $variables['item_text'] = format_plural($variables['item_count'], '<span class="num-items">1</span> Item', '<span class="num-items">@count</span> Items');
  }
  return theme_uc_cart_block_content($variables);
}