Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

a few quick formatting questions.


iceblood

Recommended Posts

Hello,

 

the website is surryseafoodc.com/index.php Ive been working on this website for a few days now and have added some contribs and edited some of the content. I have used joomla for CMS sites but this is my first time with a shopping cart and OSC so theres a bit of a learning curve here. Thank you for your patience.

 

My first question:

 

I added a contrib to create graphic headers for the boxes, this is easy enough it seemed to just add a table around the box code with a img link. One thing I didnt like about this contrib is that the grey header bar was still in place so in effect there were two headers for the boxes. I found the "new *heading()" line in the boxes and removed it which removed those grey bars, however some of the boxes such as the shoppng cart had a little white arrow as a link which really is needed to keep functionality. I worked around this with the new products box by adding a more... link to the new products page. I would like to have the total price on the shopping cart box to link to the whole cart but I cant seem to find a way to do this. The code for the cart is here.

<?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
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_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">';

  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">';
  }

  $cart_contents_string .= $products[$i]['quantity'] . ' x </span></td><td valign="top" class="ShoppingCartBoxContents"><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="ShoppingCartBoxContents">';
  }

  $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()));
 }

 new ShoppingCartBox($info_box_contents);
?>
		  </td>
		</tr>
	  </table>
	</td>
  </tr>
</table>
 </td>
</tr>
<!-- shopping_cart_eof //-->

 

I also had an issue with the boxes included in the contrib. I had to cut and paste the script in the normal boxes between the <Td> tags because I couldnt figure out what was causing it. the issue is similar to the catalog text where the td is actually split in two one side white and one side grey. To see the contrast between the boxes Ive corrected and the files direct from the contrib click the new product image, you will see a few of the offending boxes there. Does anyone have an idea what could be causing this? I will include the code of one of those broken boxes.

 

<?php
/*
 $Id: product_notifications.php,v 1.6 2003/02/12 20:27:32 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 if (isset($HTTP_GET_VARS['products_id'])) {
?>
<!-- notifications //-->
<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_product_notifications.jpg"></td>
		</tr>
		<tr> 
		  <td> 
			<?php
 if (tep_session_is_registered('customer_id')) {
  $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
  $check = tep_db_fetch_array($check_query);

  $notification_exists = (($check['count'] > 0) ? true : false);
} else {
  $notification_exists = false;
}

$info_box_contents = array();
if ($notification_exists == true) {
  $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', IMAGE_BUTTON_REMOVE_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table>');
} else {
  $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table>');
}

new infoBox($info_box_contents);
?>
		  </td>
		</tr>
	  </table>
	</td>
  </tr>
</table>
 </td>
</tr>
<?php
 }
?>

 

thank you for any help you can provide.

Link to comment
Share on other sites

I found what the issue was, to some degree anyway. The 'new infobox()' function for whatever reason divides the tr into two td's, the left side being grey and having all the content, the right side being white with no content. if you use another function such as 'ReviewBox()' it looks normal. I believe these functions are created and can be modified in the boxes.php file.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...