<?php
/*
  www.oscGold.com (C) Kamelia-Net Jacek Krysiak
  modul oscGold wer 4.0
*/
    global $customer_id;

    $boxHeading = BOX_HEADING_SHOPPING_CART;
    $corner_left = 'rounded';
    $corner_right = 'rounded';
    $boxContent_attributes = ' align="center"';
    $box_base_name = 'shopping_cart';
    $box_id = $box_base_name . 'Box'; 

	$boxContent = '<div class="shop_kont">';
	if ($cart->count_contents() > 0) {

		if (DISPLAY_PRICE_BRUTTO_NETTO == 'true') {
			$display_nb = 1;
		} else {
			$display_nb = 0;
		}

		$products = $cart->get_products();
		for ($i=0, $n=sizeof($products); $i<$n; $i++) {
			$boxContent .= '<div class="shop_poz">';

			if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
				$boxContent .= '<span class="newItemInCart"><b>';
			} else {
				$boxContent .= '<span class="newItemInCart"><b>';
			}

			$products_tax = tep_get_tax_rate($products[$i]['tax_class_id']);

			//$cost = $currencies->display_price_nodiscount($products[$i]['id'], $products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity'], $display_nb, false);
            $cost = $currencies->display_price_nodiscount($products[$i]['id'], $products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), 1, $display_nb, false);

			$boxContent .= $products[$i]['quantity'] . '&nbsp;x&nbsp;';

			$query_price_to_guest_result = ALLOW_GUEST_TO_SEE_PRICES;
			if ((($query_price_to_guest_result=='true') && !(tep_session_is_registered('customer_id'))) || ((tep_session_is_registered('customer_id')))) {
				$boxContent .= $cost;
			} else {
				$boxContent .= '';
			}
			$boxContent .= '</b></span><br><a class="newItemInCart" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
			$boxContent .= $products[$i]['name'] ;
			$boxContent .= '</a></div>';				

			if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
				tep_session_unregister('new_products_id_in_cart');
			}
		}
	  } else {
		$boxContent .= '<div class="boxContents" align="center">'.BOX_SHOPPING_CART_EMPTY.'</div>';
    }

	$query_price_to_guest_result = ALLOW_GUEST_TO_SEE_PRICES;
	if ((($query_price_to_guest_result=='true') && !(tep_session_is_registered('customer_id'))) || ((tep_session_is_registered('customer_id')))) {
		if (DISPLAY_PRICE_BRUTTO_NETTO == 'true') {
            $box_text = '<span class="kwot_netto">'.$currencies->format($cart->show_total_netto()).'</span><span class="netbru_text">'.TEXT_NETTO.'</span><br><span class="kwot_brutto">' . $currencies->format($cart->show_total()).'</span><span class="netbru_text">'.TEXT_BRUTTO.'</span>';
		} else {
			$box_text = $currencies->format($cart->show_total()); 
		}    
	} else {
		$box_text = PRICES_LOGGED_IN_TEXT;
	}

	if ($cart->count_contents() > 0) {
		$boxContent .= '<div align="center" class="shop_line">'.tep_draw_separator('pixel_black.gif', '100%', '1').'</div>';
		$boxContent .= '<div align="center" class="shop_suma"><b><span class="boxText">'.(($query_price_to_guest_result=='true') ? BOX_SHOPPING_CART_TOTAL.':&nbsp;' : '');
		$boxContent .= '' . $box_text . '';
		$boxContent .= '</span></b></div>';
		if ((($query_price_to_guest_result=='true') && !(tep_session_is_registered('customer_id'))) || ((tep_session_is_registered('customer_id')))) {
			$boxContent .= '<div align="center" class="shop_img">';
			$boxContent .= '<a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . tep_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '</a>&nbsp;
							<a href="' . tep_href_link(FILENAME_CHECKOUT, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>
							</div>';
		}
	}
	$boxContent .= '</div>';
	
    if (USE_REDEEM_SYSTEM == 'true') {
	  $has_points = tep_get_shopping_points($customer_id);
	  if ($has_points > 0) {
		  $boxContent .= '<div class="shop_kont">
							<div align="center" class="shop_line"><br>'.tep_draw_separator('pixel_black.gif', '100%', '1').'</div>
							<div class="shop_pkt" align="center"><a class="newItemInCart" href="' . tep_href_link(FILENAME_MY_POINTS, '', 'SSL') . '"><b>'. TEXT_POINTS_BALANCE . '</b></a></div>
							<div class="shop_pkt"><span class="newItemInCart">' . TEXT_POINTS .'&nbsp;'. number_format($has_points,POINTS_DECIMAL_PLACES) .'<br>
							' .  TEXT_VALUE . $currencies->format(tep_calc_shopping_pvalue($has_points)) . '</span></div>
						 </div>';
	  }
    }

    include (bts_select('boxes', $box_base_name)); // BTS 1.5
    $boxLink = '';

?>