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

<?php
if (strstr(MODULE_PAYMENT_INSTALLED, "raty_zagiel.php") !== false) {
  ?>
  <script>
  <!--
    function PoliczRate(koszyk)	{
      window.open('https://www.eraty.pl/symulator/oblicz.php?numerSklepu=<? echo MODULE_PAYMENT_RATY_ZAGIEL_NUMER_SKLEPU; ?>&wariantSklepu=<? echo MODULE_PAYMENT_RATY_ZAGIEL_WARIANT_SKLEPU; ?>&typProduktu=0&wartoscTowarow='+koszyk, 'Policz_rate', 'width=630,height=500,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');
    }
  //-->
  </script>
  <?php
}
?>

<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

 <!-- Naglowek BOF -->
 <tr>
  <td>
   <?php
   $info_box_contents = array();
   $info_box_contents[] = array('text' => sprintf(HEADING_TITLE));
   new contentBoxHeading($info_box_contents);
   ?>
  </td>
 </tr>
 <tr>
  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '1'); ?></td>
 </tr>
 <!-- Naglowek EOF -->

 <?php
 if ($cart->count_contents() > 0) {
 ?>
 <tr>
  <td>
	<script type="text/javascript"><!--
	function AktualizujKoszyk() { document.cart_quantity.submit(); }
	function zmienIlosc(i,qty) { document.cart_quantity['qty_'+i].value = Number(document.cart_quantity['qty_'+i].value)+Number(qty); AktualizujKoszyk(); }
	//--></script>
   <?php

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

    $info_box_contents = array();
    $info_box_contents[0][] = array('align' => 'center',
                                    'params' => 'class="productListing-heading"',
                                    'text' => TABLE_HEADING_REMOVE);

    $info_box_contents[0][] = array('params' => 'class="productListing-heading"',
                                    'text' => TABLE_HEADING_PRODUCTS);

    $info_box_contents[0][] = array('align' => 'center',
                                    'params' => 'class="productListing-heading"',
                                    'text' => TABLE_HEADING_QUANTITY);

    $info_box_contents[0][] = array('align' => 'right',
                                    'params' => 'class="productListing-heading"',
                                    'text' => TABLE_HEADING_TOTAL);

    $any_out_of_stock = 0;
    $products = $cart->get_products();
    for ($i=0, $n=sizeof($products); $i<$n; $i++) {

     //MAXIMUM quantity code
     if(MAXIMUM_ORDERS == 'true'){
      $max_order_query = tep_db_query("select p.products_maxorder as max_quant FROM " . TABLE_PRODUCTS . " p where p.products_id = '".$products[$i]['id']."'");
      while ($max_order = tep_db_fetch_array($max_order_query))  {
       $products[$i]['max_quant']=$max_order['max_quant']; // set the cart item max var
       if (!empty($products[$i]['max_quant'])) {//add check account for if max_quant is null or '', if it is you can skip all this stuff can it's umlimited
        // okay if this product already is in basket irregardless of it's attributes selected... keep the old one
        for ($ic = 0; $ic < $i;$ic++) {
         if (tep_get_prid($products[$i]['id']) == tep_get_prid($products[$ic]['id'])) {
          $cart_notice .= sprintf(MAXIMUM_ORDER_DUPLICATE, $products[$i]["name"], $products[$i]["max_quant"]) . '<BR>'; // notify them they can not do that
          $cart_skip_prod = true;
          $cart->remove($products[$i]['id']); // remove this new item from the cart session
          $cart_skip_prod = true; // set a flag so we can bypass output of the item that was already stuck into the products array before we removed it just now
         } else {
          //$cart_notice .= ' - okay no match ';
         }
         $cart_notice .= '<BR>';
        }

        // okay now for products that have no attributes or have identical attributes
        if ($products[$i]['quantity'] > $max_order['max_quant'] ) { //add check account for if max_quant is null or '', if so let it go through.
         $products[$i]['quantity']=$products[$i]['max_quant'];
         $cart->add_cart($products[$i]['id'],$products[$i]['quantity'],$products[$i]['attributes']); // update the qty
         $cart_notice .= sprintf(MAXIMUM_ORDER_NOTICE, $products[$i]["name"], $products[$i]["max_quant"]); // notify them they can not do that
        }
       }
      }
     }

     if ($cart_skip_prod) { // still need to skip displaying the item still stuck in $products array even though we removed it from $cart
      break;
     }
     //End MAXIMUM quantity code

     // Push all attributes information in an array
     if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
      while (list($option, $value) = each($products[$i]['attributes'])) {
       echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);
       $attributes = tep_db_query("select popt.products_options_name, popt.products_options_track_stock, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
                                      from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
                                      where pa.products_id = '" . (int)$products[$i]['id'] . "'
                                      and pa.options_id = '" . (int)$option . "'
                                      and pa.options_id = popt.products_options_id
                                      and pa.options_values_id = '" . (int)$value . "'
                                      and pa.options_values_id = poval.products_options_values_id
                                      and popt.language_id = '" . (int)$languages_id . "'
                                      and poval.language_id = '" . (int)$languages_id . "'");
       $attributes_values = tep_db_fetch_array($attributes);

       $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name'];
       $products[$i][$option]['options_values_id'] = $value;
       $products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name'];
       $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price'];
       $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix'];
       $products[$i][$option]['track_stock'] = $attributes_values['products_options_track_stock'];
      }
     }
    }

    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
     if (($i/2) == floor($i/2)) {
      $info_box_contents[] = array('params' => 'class="productListing-even"');
     } else {
      $info_box_contents[] = array('params' => 'class="productListing-odd"');
     }

     $cur_row = sizeof($info_box_contents) - 1;

     $info_box_contents[$cur_row][] = array('align' => 'center',
                                            'params' => 'class="productListing-data" valign="middle"',
                                            'text' => '<a href="' . tep_href_link(FILENAME_SHOPPING_CART, 'action=remove_product&products_id='.$products[$i]['id'], 'NONSSL') . '">'.tep_image(DIR_WS_TEMPLATES . 'images/misc/kosz.gif').'</a>');



		 $szerokosc = SMALL_IMAGE_WIDTH*0.7;
		 $wysokosc = SMALL_IMAGE_HEIGHT*0.7;

     $products_name = '<table border="0" cellspacing="0" cellpadding="0">' .
                                 ' <tr>' .
                                 '  <td class="productListing-data" align="center">'.
																		(($products[$i]['image'] != '') ?
                                                                        tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], $szerokosc, $wysokosc,'','','','', tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']),true) : '').'
																	 </td><td>' . tep_draw_separator('pixel_trans.gif', '5', '5') .'</td>' .
                                 '  <td class="productListing-data" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><b>' . $products[$i]['name'] . '</b></a>';

     if (STOCK_CHECK == 'true') {
//++++ QT Pro: Begin Changed code
        if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
          $stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity'], $products[$i]['attributes']);
        }else{
          $stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']);
        }
//++++ QT Pro: End Changed Code
      if (tep_not_null($stock_check)) {
       $any_out_of_stock = 1;

       $products_name .= $stock_check;
      }
     }

     if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
      reset($products[$i]['attributes']);
      while (list($option, $value) = each($products[$i]['attributes'])) {
       $products_name .= '<br><small><i> - ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . '</i></small>';
      }
     }


	 // denuz text attr  /////////////////////////////////// DODATKOWE POLA - CECHY TEKSTOWE
     //sprawdza czy klient jest zalogowany, jezeli tak to wpisuje w sesje nr id klienta, jezeli nie to id sesji
	 if (!tep_session_is_registered('customer_id')) {
		$sesja = tep_session_id();
	   } else {
		$sesja = (int)$customer_id;
	 }
     $pid = $products[$i]['id'];
     $attr_q = tep_db_query("select cbta.*, pta.products_text_attributes_name from customers_basket_text_attributes as cbta, products_text_attributes as pta where cbta.products_text_attributes_id = pta.products_text_attributes_id and cbta.products_id = '" . $pid . "' and cbta.session_id = '" .$sesja. "'");
     while ($attr = tep_db_fetch_array($attr_q)) {
          $products_name .= '<br><small><i> - ' . $attr['products_text_attributes_name'] . ' ' . stripslashes($attr['products_text_attributes_text'])  . '</i></small>';
     }
	 // eof denuz text attr /////////////////////////////////// DODATKOWE POLA - CECHY TEKSTOWE

     $products_name .= '  </td>' .
                                  '</tr>' .
                                 '</table>';

     $info_box_contents[$cur_row][] = array('params' => 'class="productListing-data"',
                                             'text' => $products_name);

     $info_box_contents[$cur_row][] = array('align' => 'center',
                                             'params' => 'class="productListing-data" valign="top" nowrap',
                                             'text' => '<a href="javascript:zmienIlosc(\''.($i+1).'\',-1)">'.tep_image(DIR_WS_TEMPLATES.'/images/misc/del.gif','').'</a>&nbsp;'.
											 tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'onChange="AktualizujKoszyk();" maxlength="6" size="6" id="qty_'.($i+1).'"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']).
											 '&nbsp;<a href="javascript:zmienIlosc(\''.($i+1).'\',1)">'.tep_image(DIR_WS_TEMPLATES.'/images/misc/add.gif','').'</a>&nbsp;');

     //TotalB2B start
     $info_box_contents[$cur_row][] = array('align' => 'right',
                                             'params' => 'class="productListing-data" valign="top" nowrap',
                                             'text' => '<b>' . $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) . '</b>');
    }
    //TotalB2B end

    new productListingBox($info_box_contents);
  ?>
  </td>
 </tr>

 <tr>
  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '3'); ?></td>
 </tr>

 <tr>
  <td align="right" class="main"><b><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php

   //TotalB2B start
   global $customer_id;
   $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') {
        echo '<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 {
        echo $currencies->format($cart->show_total());
    }
   } else {
    echo PRICES_LOGGED_IN_TEXT;
   }
   //TotalB2B end

   ?>
   </b>
  </td>
 </tr>
 <?php
 if ($any_out_of_stock == 1) {
  if (STOCK_ALLOW_CHECKOUT == 'true') {
 ?>
 <tr>
  <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></td>
 </tr>
 <?php
  } else {
 ?>
 <tr>
  <td class="stockWarning" align="middle"><br><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></td>
 </tr>
 <?php
  }
 }

 //MAXIMUM quantity code
 if ($cart_notice) {
 ?>
 <tr>
  <td class="stockWarning" align="middle"><br><?php echo $cart_notice; ?></td>
 </tr>
 <?php
 }
 // End MAXIMUM quantity code

 //BOF Minimalne zamowienie
 if (tep_session_is_registered('customer_id')) {
  $query = tep_db_query("select g.customers_groups_min_amount from " . TABLE_CUSTOMERS_GROUPS . " g inner join  " . TABLE_CUSTOMERS  . " c on g.customers_groups_id = c.customers_groups_id and c.customers_id = '" . $customer_id . "'");
  $query_result = tep_db_fetch_array($query);
  $customers_groups_min_amount = $query_result['customers_groups_min_amount'];
  if ($cart->show_total() < $customers_groups_min_amount) {
   ?>
   <tr>
    <td class="stockWarning" align="middle"><br><?php echo sprintf(TEXT_ORDER_UNDER_MIN_AMOUNT, $currencies->format($customers_groups_min_amount)); ?></td>
   </tr>
   <?php
  }
  } else {
  }
 //EOF Minimalne zamowienie
 ?>

 <?php
  if (strstr(MODULE_PAYMENT_INSTALLED, "raty_zagiel.php") !== false) {
    if ($cart->show_total() >= 100 && $language == 'polish') {

      function clean_prod($data) {
      $data = preg_replace ('/[^0-9,.]/', '', $data);
      $data = preg_replace ('/ /', '', $data);
      $data = preg_replace ('/,/', '.', $data);
      return $data;
    }
    ?>
      <tr>
        <td>
          <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
            <tr class="infoBoxContents">
              <td>
                <table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="main" align="center">Jeżeli chciałbyś kupić na <b>raty w systemie Żagiel</b>, <br>możesz wstępnie wybrać dogodne dla siebie warunki...</td>
                  </tr>
                  <tr>
                    <td class="main" align="center">
                      <?php
                      echo '<a OnClick="PoliczRate('. $cart->show_total() .');" style="cursor: pointer;">' . tep_image_button('zagiel_oblicz_rate.gif', ZAGIEL_OBLICZ_RATE) . '</a>';
                      ?>
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <?php
    } else {
      ?>
      <tr>
        <td>
          <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
            <tr class="infoBoxContents">
              <td>
                <table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="main" align="center">Jeżeli chciałbyś wziąć <b>raty w systemie Żagiel</b>, <br>możesz wstępnie wybrać dogodne dla siebie warunki...</td>
                  </tr>
                  <tr>
                     <td class="main" align="center">
                       <b>Raty dostępne są od 100 zł wartości całego zamówienia <br>(nie licząc kosztów przesyłki).</b>
                     </td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <?php
    }
  }
 ?>

   <?php
   if ( MODULE_SHIPPING_FREEAMOUNT_STATUS == 'True' ) {
     ?>
     <tr>
      <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
      <td>
        <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
          <tr class="infoBoxContents">
            <td>
              <table border="0" width="100%" cellspacing="0" cellpadding="2">
                <tr>
                  <?php
                  // dodatkowe dla programu lojalnosciowego
                  if (defined(MODULE_KLUB_INC_SHIPPING)) {
                    if (suma_zamowien() > MODULE_KLUB_KWOTA && MODULE_KLUB_INC_SHIPPING == 'true') {
                      $boxContent .= '<td class="main" align="center">&nbsp;</td>';
                    } else {
                      echo '<td class="main" align="center">'.MODULE_SHIPPING_FREEAMOUNT_TEXT_1.' '. $currencies->format(MODULE_SHIPPING_FREEAMOUNT_AMOUNT). ' '.MODULE_SHIPPING_FREEAMOUNT_TEXT_2.'</td>';
                    }
                  } else {
                    echo '<td class="main" align="center">'.MODULE_SHIPPING_FREEAMOUNT_TEXT_1.' '. $currencies->format(MODULE_SHIPPING_FREEAMOUNT_AMOUNT). ' '.(MODULE_SHIPPING_FREEAMOUNT_WEIGHT_MAX !='0' ? MODULE_SHIPPING_FREEAMOUNT_TEXT_2 : ''). MODULE_SHIPPING_FREEAMOUNT_TEXT_21.'</td>';
                  }

                  echo '</tr>';
                  echo '<tr>';
                  echo '<td class="main" align="center">';
                  if ( $cart->show_weight() < MODULE_SHIPPING_FREEAMOUNT_WEIGHT_MAX || ( MODULE_SHIPPING_FREEAMOUNT_WEIGHT_MAX =='0' ) ) {
                    // dodatkowe dla programu lojalnosciowego
                    if (defined(MODULE_KLUB_INC_SHIPPING)) {
                      if (suma_zamowien() > MODULE_KLUB_KWOTA && MODULE_KLUB_INC_SHIPPING == 'true') {
                        echo '         <b>' . MODULE_SHIPPING_FREEAMOUNT_TEXT_3 . '</b>';
                      } else {
                        if ( $cart->show_total() < MODULE_SHIPPING_FREEAMOUNT_AMOUNT ) {
                          echo '         <b>' . MODULE_SHIPPING_FREEAMOUNT_TEXT.' ' . $currencies->format(MODULE_SHIPPING_FREEAMOUNT_AMOUNT - $cart->show_total()) . '</b>';
                        } else {
                          echo '         <b>' . MODULE_SHIPPING_FREEAMOUNT_TEXT_3 . '</b>';
                        }
                      }
                    } else {
                      if ( $cart->show_total() < MODULE_SHIPPING_FREEAMOUNT_AMOUNT ) {
                        echo '         <b>' . MODULE_SHIPPING_FREEAMOUNT_TEXT.' ' . $currencies->format(MODULE_SHIPPING_FREEAMOUNT_AMOUNT - $cart->show_total()) . '</b>';
                      } else {
                        echo '         <b>' . MODULE_SHIPPING_FREEAMOUNT_TEXT_3 . '</b>';
                      }
                    }
                  } else {
                      echo '<b>' . MODULE_SHIPPING_FREEAMOUNT_TEXT_4 . '</b>';
                  }
                  echo '</td>';
                  ?>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
     </tr>
     <?php
   }
   ?>

 <!-- Przyciski BOF -->
 <tr>
  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '3'); ?></td>
 </tr>
 <tr>
  <td>
	  <table border="0" width="100%" align="left" class="TableFrame">
       <tr>
	    <td align="left" class="main" style="padding-left:10px"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; ?></td>
        <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td>
		<td width="80%" align="right" class="main" style="padding-right:10px">
			<?php echo POBRAC_PDF.' <a class="boxLink" href="' . tep_href_link('pdf_shopping_cart.php') . '" target="_blank"> ' . tep_image(DIR_WS_TEMPLATES.'images/misc/icons/pdf.png') . '</a>'; ?>
	    </td>
       </tr>
      </table>
  </td>
 </tr>
 <!-- Przyciski EOF -->
 <?php
 if ($module_darmo == true) {
	require(DIR_WS_MODULES . 'gratis_products_variables.php');
	require(DIR_WS_MODULES . 'gratis_products_shop.php');
 }
 $initialize_checkout_methods = $payment_modules->checkout_initialization_method();

 if (!empty($initialize_checkout_methods)) {
		?>
    <tr>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>
    <tr>
			<td align="right" class="main" style="padding-right: 50px;"><?php echo TEXT_ALTERNATIVE_CHECKOUT_METHODS; ?></td>
    </tr>
		<?php
      reset($initialize_checkout_methods);
      while (list(, $value) = each($initialize_checkout_methods)) {
				?>
				<tr>
					<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
				</tr>
				<tr>
					<td align="right" class="main"><?php echo $value; ?></td>
				</tr>
 <?php
			}
 }

 if (strstr(MODULE_PAYMENT_INSTALLED, "ppec.php") !== false) {
  require('ppesetup.php');
  $ppesetup = new ppesetup($language);
  ?>
  <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
    <td colspan="2" width="100%">
      <fieldset>
      <legend><?php echo TABLE_PAYPAL_EC_HEADING; ?></legend>
        <table border="0" width="100%" cellspacing="0" cellpadding="2">
          <tr>
            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td>
          </tr>
          <tr>
            <td class="main"><?php echo TABLE_PAYPAL_EC_INTRODUCTION; ?></td>
            <td align="right" valign="bottom" width="20%">
              <?php echo '<a href="'.tep_href_link('ppeb.php', 'shec=a', 'SSL').'">'.$ppesetup->ima.'</a>'; ?>
            </td>
          </tr>
        </table>
      </fieldset>
    </td>
  </tr>
  <?php
 }

 } else {
 ?>

 <tr>
  <td align="center" class="main"><?php new infoBox(array(array('text' => TEXT_CART_EMPTY))); ?></td>
 </tr>

 <!-- Przyciski BOF -->
 <tr>
  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '3'); ?></td>
 </tr>
 <tr>
  <td>
   <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
    <tr class="infoBoxContents">
     <td>
	  <table border="0" width="100%" cellspacing="0" cellpadding="2">
       <tr>
        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
        <td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
       </tr>
      </table>
	 </td>
    </tr>
   </table>
  </td>
 </tr>
 <!-- Przyciski BOF -->

 <?php
 }
 ?>
 </form>
 <?php
 if (CARTSHIP_ONOFF == 'true' && $cart->count_contents() > 0) {
   ?>
   <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
   </tr>
   <tr>
    <td>
      <?php require(DIR_WS_MODULES . 'shipping_estimator.php'); ?>
    </td>
   </tr>
   <?php
 }
 ?>
</table>