Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Merging Cart & Languages/Currency Box


mark27uk3

Recommended Posts

Posted

Hi Guys,

 

I have changed my languages box so it displays flags and when clicked changes the currency then what I did was merge the code from the languages box into the shopping cart infobox.

 

Everything works fine except for an annoying grey line that seperates the checkout info from the flags. What I need to know is how to remove the grey line.

 

I know it is the result of two infoboxes in one, have looked at it all afternoon and still can not see which bit I need to change.

 

Here is the code of the merged infoboxes, if someone could take a look for me please.

 

<?php
/*
 $Id: shopping_cart.php,v 1.18 2003/02/10 22:31:06 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- shopping_cart //-->
<tr>
 <td> 
   <table width="144" border="0" cellspacing="0" cellpadding="1" class="infoboxborder">
     <tr>
       <td>          <table width=100% border=0 cellpadding=0 cellspacing=0 class="infoBoxContents">
           <tr> 
             <td colspan=3 width="100%"> <img src="images/boxes/table_shopping_cart.jpg"></td>
           </tr>
           <tr> 
             <td> 
               <?php
 $cart_contents_string = '';
 if ($cart->count_contents() > 0) {
   $cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
   $products = $cart->get_products();
   for ($i=0, $n=sizeof($products); $i<$n; $i++) {
     $cart_contents_string .= '<tr><td align="right" valign="top" class="infoBoxContents">';

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

     $cart_contents_string .= $products[$i]['quantity'] . ' x </span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';

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

     $cart_contents_string .= $products[$i]['name'] . '</span></a></td></tr>';

     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');
     }
   }
   $cart_contents_string .= '</table>';
 } else {
   $cart_contents_string .= BOX_SHOPPING_CART_EMPTY;
 }

 $info_box_contents = array();
 $info_box_contents[] = array('text' => $cart_contents_string);

 if ($cart->count_contents() > 0) {
   $info_box_contents[] = array('text' => tep_draw_separator());
   $info_box_contents[] = array('align' => 'right',
                                'text' => $currencies->format($cart->show_total()));
 }
///start free shipping text  
if ((FREE_POSTAGE_ON_OFF == "on")&&($cart->count_contents() != 0)) { 
     if (($cart->show_total()) < FREE_POSTAGE_TOTAL) { 
         $cart_show_text = "Spend " . $currencies->format(FREE_POSTAGE_TOTAL - ($cart->show_total())) . " more and we pay for shipping!"; 
     } 
     else { 
         $cart_show_text = "You have qualified for free shipping."; 
     } 
     $info_box_contents[] = array('text' => '<br>' . $cart_show_text); 
 } 
///end free shipping text 
 new infoBox($info_box_contents);

 $info_box_contents = array();
 //$info_box_contents[] = array('text' => BOX_HEADING_LANGUAGES);

 //new infoBoxHeading($info_box_contents, false, false);

 if (!isset($lng) && !is_object($lng)) {
   include(DIR_WS_CLASSES . 'language.php');
   $lng = new language;
 }

 $languages_string = '';
 reset($lng->catalog_languages);
 while (list($key, $value) = each($lng->catalog_languages)) {
   $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
 }

 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'center',
                              'text' => $languages_string);

 new infoBox($info_box_contents);

?>

             </td>
           </tr>

             </td>
           </tr>
         </table>
       </td>
     </tr>
   </table>
 </td>
</tr>
<!-- shopping_cart_eof //-->

 

Thanks

 

Mark

Lifes a bitch, then you marry one, then you die!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...