Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Remove border from ONE info box. NOT ALL.


maz

Recommended Posts

Posted

How can I remove the border from JUST the categories info box and the information box.

Changing the stylesheet .infoBox changes every info box throughout the site.

 

Any help woulr be appreciated

 

Thanks.

Posted
How can I remove the border from JUST the categories info box and the information box.

Changing the stylesheet .infoBox changes every info box throughout the site.

 

Any help woulr be appreciated

 

Thanks.

 

 

Two choices, you can install the contribution that gives each infobox its own class or you can manually change the two boxes you want to change their own class so you can make seperate changes to them.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Posted
Two choices, you can install the contribution that gives each infobox its own class or you can manually change the two boxes you want to change their own class so you can make seperate changes to them.

 

Hi

This is the class I put in class/boxes.php.

 

 

//New ShoppingCartBox Class
 class ShoppingCartBox extends tableBox {
function ShoppingCartBox($contents) {
  $info_box_contents = array();
  $info_box_contents[] = array('text' => $this->ShoppingCartBoxContents($contents));
  $this->table_cellpadding = '1';
  $this->table_parameters = 'class="ShoppingCartBox"';
  $this->tableBox($info_box_contents, true);
}

function ShoppingCartBoxContents($contents) {
  $this->table_cellpadding = '3';
  $this->table_parameters = 'class="ShoppingCartBoxContents"';
  $info_box_contents = array();
  $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
  for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
	$info_box_contents[] = array(array('align' => $contents[$i]['align'],
									   'form' => $contents[$i]['form'],
									   'params' => 'class="ShoppingCartBoxContents"',
									   'text' => $contents[$i]['text']));
  }
  $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
  return $this->tableBox($info_box_contents);
}
 }

 class ShoppingCartBoxHeading extends tableBox {
function ShoppingCartBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
  $this->table_cellpadding = '0';

  if ($left_corner == true) {
	$left_corner = tep_image(DIR_WS_IMAGES . 'ShoppingCartBox/corner_left.gif');
  } else {
	$left_corner = tep_image(DIR_WS_IMAGES . 'ShoppingCartBox/corner_right_left.gif');
  }
  if ($right_arrow == true) {
	$right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'ShoppingCartBox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
  } else {
	$right_arrow = '';
  }
  if ($right_corner == true) {
	$right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . 'ShoppingCartBox/corner_right.gif');
  } else {
	$right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14');
  }

  $info_box_contents = array();
  $info_box_contents[] = array(array('params' => 'height="14" class="ShoppingCartBoxHeading"',
									 'text' => $left_corner),
							   array('params' => 'width="100%" height="14" class="ShoppingCartBoxHeading"',
									 'text' => $contents[0]['text']),
							   array('params' => 'height="14" class="ShoppingCartBoxHeading" nowrap',
									 'text' => $right_corner));

  $this->tableBox($info_box_contents, true);
}
 }

 

This is my code in Shopping cart.php

(PS just ignore the points rewards stuff. Just need to hide the border.)

 

<!-- shopping_cart //-->
	  <tr>
		<td><img src="images/shopping_cart.gif" />  <br />
		<?php
 $info_box_contents = array(); 
 $info_box_contents[] = array('text' => BOX_HEADING_SHOPPING_CART);

 new infoBoxHeading($info_box_contents, false, true, tep_href_link(FILENAME_SHOPPING_CART));

 $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="ShoppingCartBoxContents">'; //  FOR INDIVIDUAL INFO BOXES REPLACED CLASS. was 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="ShoppingCartBoxContents">'; //  FOR INDIVIDUAL INFO BOXES REPLACED CLASS. was class="infoBoxContents"
  }

  $cart_contents_string .=  $products[$i]['quantity'] . '</td>??</span></td><td valign="top" class="ShoppingCartBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">'; //  FOR INDIVIDUAL INFO BOXES REPLACED CLASS. was 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="ShoppingCartBoxContents">'; // FOR INDIVIDUAL INFO BOXES REPLACED CLASS. was 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()));
 }

#### MAZ BOF POINTS REWARDS Points/Rewards Module V1.60 BOF ADDITION####

//MAZ BOF ADDED THIS PART TO GET CUSTOMER HIDE POINTS STATUS. First part gets query.  second part hide the actula box. (dont forget bracket)
 $hide_points_query = tep_db_query("select hide_points from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "' ");
  $hide_points = tep_db_fetch_array($hide_points_query); 
//MAZ EOF ADDITION FOR STATUS  - ALSO ADDED second part which comes next PLUS a closing bracket marked xxy frther down page
//MAZ BOF added THIS PART TO HIDE POINTS --- ALSO A CLOSING BRACKET SEE BELOW xxy
		 if ($hide_points = $hide_points['hide_points']){   //must close this bracket too
//MAZ EOF added THIS PART TO HIDE POINTS --- ALSO A CLOSING BRACKET SEE BELOW xxy 

//NEXT LINE IS STANDARD from points rewards system	
 if (tep_session_is_registered('customer_id')) {
$shopping_points = tep_get_shopping_points($customer_id);
if ($shopping_points > 0) {
  $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
  $info_box_contents[] = array('align' => 'center','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td align="center" class="smalltext"><b><a href="' . tep_href_link(FILENAME_MY_POINTS) . '">'. TEXT_POINTS_BALANCE . '</a></b></tr></td><tr><td class="smalltext" align="right" valign="bottom">' . TEXT_POINTS .'?'. number_format($shopping_points) .'</tr></td><tr><td class="smalltext" align="right" valign="bottom">' .  TEXT_VALUE . $currencies->format(tep_calc_shopping_pvalue($shopping_points)) . '</td></tr></table>');
}
 }
} // MAZ DDED CLOSING BRACKET TO HIDE AND SHOW info  xxy
#### MAZ EOF POINTS REWARDS  Module V1.60 EOF ADDITION ####
 new infoBox($info_box_contents);
?></td>
	  </tr>
<!-- shopping_cart_eof //-->

 

and this is the style sheet

.ShoppingCartBox {
 background: white; /* THIS SHOULD HIDE THE INFOBOX BORDER WITH THE SAME COLOUR AS THE BACKGORUND  */
}
TD.ShoppingCartBoxHeading {
 font-family: Verdana, Arial, sans-serif;
 font-size: 10px;
 font-weight: bold;
 background: #b6b7cb;
 color: #ffffff;
 display: none;  /* THIS SHOULD HIDE THE INFOBOX HEADER   display: none;	 */
}
.ShoppingCartBoxContents {
 background: #FFFFFF;
 font-family: Verdana, Arial, sans-serif;
 font-size: 10px;

}

 

I can hide the headers, but cant get rid of the border around the shopping cart.

Posted
How can I remove the border from JUST the categories info box and the information box.

Changing the stylesheet .infoBox changes every info box throughout the site.

 

Any help woulr be appreciated

 

Thanks.

create a new class and associate it with categories.php.

 

This might look bit tricky as you read.

 

But if you go into categories.php and just use a new class plus use the code of existing class to create a new class and then modify the border code in this new class.Also take care of changing the constructor name to the new class name.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Archived

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

×
×
  • Create New...