Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How Can I Make My Whats New Box Centred?


swiftmed

Recommended Posts

Posted

Hey Guys,

 

Below i have attached the coding from my whats_new.php from the includes/boxes/ directory of oscommerce. bascially i am looking for somebody to either please tell me which part of this code i need to change, or somebody could make the change and repost this code on this thread for me id appreciate it. at the moment the conects of my whats_new.php box is left aligned, and i would like it to be centre aligned if that is possible please?

 

Thank you very much in advance for your help.

<?php
/*
 $Id: whats_new.php,v 1.31 2003/02/10 22:31:09 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2003 osCommerce

 Released under the GNU General Public License
*/

 if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) {
?>
<!-- whats_new //-->

<?php
   $random_product['products_name'] = tep_get_products_name($random_product['products_id']);
   $random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']);

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

   new infoBoxHeading($info_box_contents, true, true, tep_href_link(FILENAME_PRODUCTS_NEW));
?>
<div style=" border:1px solid #A6B3BA; border-width:0px 1px;">
<?php
   if (tep_not_null($random_product['specials_new_products_price'])) {
     //$whats_new_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br>';
     $whats_new_price = '<span >' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';
   } else {
     $whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
   }
$sql = 'SELECT `products_description` FROM `products_description` WHERE products_id ='.$random_product['products_id'].' && language_id='.(int)$languages_id;
$description_query = tep_db_query($sql);
$description = mysql_fetch_array($description_query, MYSQL_ASSOC);        
$description['products_description'] = substr($description['products_description'], 0, 45);
$desc_len = strlen($description['products_description']);
$description['products_description'][$desc_len-1] = '.';
$description['products_description'][$desc_len-2] = '.';
$description['products_description'][$desc_len-3] = '.';
   $info_box_contents = array();
   $info_box_contents[] = array('align' => 'center',
                                'text' => '<table border="0" cellpadding="0" cellspacing="1" width="100%">
							 				<tr>	
												<td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>
											</tr>
											<tr>
												<td height="28"><a class="productName" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a></td>
											</tr>
											<tr>
												<td valign=top ><b>Our price: <span style="color:#BD1700;">'. $whats_new_price.'</b></td>
											</tr>
										</table>');

   new infoBox($info_box_contents);

?>
</div>

<!-- whats_new_eof //-->
<?php
  new infoBoxFooter('');      
 }
?>

Archived

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

×
×
  • Create New...