Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

trying to add separate borders...


anne1

Recommended Posts

hey evryone,

 

i am desperately trying to get the new_products on the mainpage in separate boxes like with the origenal 32-look. I already did it with the specials box. But i can't seem to get it right with new_products. When i make a standard table and put the html in the source of new_products it works fine but with the table structure i use now , i get a double top and bottom row. Hope that there is somebody that can tell me where it's going wrong. I use the following code:

 if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
? ? ? ? ? ? ? ?$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' and products_date_added > SUBDATE( now( ?) , ?INTERVAL " . $days . " ?DAY ?) limit " . MAX_DISPLAY_NEW_PRODUCTS);
? ? ? ? ? ? ? ?$check_products_query = tep_db_query("select count(products_id) as count from " . TABLE_PRODUCTS . " where products_status = '1' and products_date_added > SUBDATE( now( ?) , ?INTERVAL " . $days . " ?DAY ?)");
? ? ? ? ?} else {
? ? ? ? ? ?$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $new_products_category_id . "' and p.products_status = '1' and products_date_added > SUBDATE( now( ?) , ?INTERVAL " . $days . " ?DAY ?)");
? ? ? ? ? ?$check_products_query = tep_db_query("select count(p.products_id) as count from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $new_products_category_id . "' and p.products_status = '1' and products_date_added > SUBDATE( now( ?) , ?INTERVAL " . $days . " ?DAY ?) limit " . MAX_DISPLAY_NEW_PRODUCTS);
? ? ? ? ?}
$check = tep_db_fetch_array($check_products_query);
if ($check['count'] <= 0 && $box_show_option == 1) {
echo "
<!-- new_products //-->
<!-- new_products_disabled //-->
<!-- new_products_eof //-->";
} elseif ($check['count'] <= 0 && $box_show_option == 2) {
?>
<!-- new_products //-->
<?php
?$info_box_contents = array();
?$info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));

?new contentBoxHeading($info_box_contents);
?$row = 0;
?$col = 0;
?$info_box_contents = array();
? ?$new_products['products_name'] = tep_get_products_name($new_products['products_id']);
? ?$info_box_contents[$row][$col] = array('align' => 'left',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'params' => 'class="smallText" width="33%" valign="top"',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'text' => MAIN_NO_NEW_PRODUCTS);
new contentBox($info_box_contents);
?>
<!-- new_products_eof //-->
<?php } else { ?>
<!-- new_products //-->
<?php

?$row = 0;
?$col = 0;
?$info_box_contents = array();
?while ($new_products = tep_db_fetch_array($new_products_query)) {
? ?$new_products['products_name'] = tep_get_products_name($new_products['products_id']);
? ?$info_box_contents[$row][$col] = array('align' => 'center',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'params' => 'class="smallText" width="33%" valign="top"',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'text' => '<TABLE cellSpacing=0 cellPadding=0 border=0>
? ? ? ? ? ? ?<TBODY>
? ? ? ? ? ? ?<TR>
? ? ? ? ? ? ? ?<TD><IMG height=9 alt="" src="templates/New look/images/t_11.gif"
? ? ? ? ? ? ? ? ?width=10 border=0></TD>
? ? ? ? ? ? ? ?<TD background="templates/New look/images/t_13.gif"><IMG height=9
? ? ? ? ? ? ? ? ?alt="" src="templates/New look/images/t_12.gif" width=6
? ? ? ? ? ? ? ?border=0></TD>
? ? ? ? ? ? ? ?<TD align=right
? ? ? ? ? ? ? ? ?background="templates/New look/images/t_13.gif"><IMG height=9
? ? ? ? ? ? ? ? ?alt="" src="templates/New look/images/t_14.gif" width=6
? ? ? ? ? ? ? ?border=0></TD>
? ? ? ? ? ? ? ?<TD><IMG height=9 alt="" src="templates/New look/images/t_15.gif"
? ? ? ? ? ? ? ? ?width=10 border=0></TD></TR>
? ? ? ? ? ? ?<TR vAlign=top>
? ? ? ? ? ? ? ?<TD background="templates/New look/images/t_fon_left.gif"><IMG
? ? ? ? ? ? ? ? ?height=6 alt="" src="templates/New look/images/t_21.gif" width=10
? ? ? ? ? ? ? ? ?border=0></TD>

? ?<TD colSpan=2 rowSpan=2 valign="middle">
? ? ?<div align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) .
? ? ? ? ? '</div>
? ?</TD>
? ? ? ? ? ? ? ?<TD background="templates/New look/images/t_fon_right.gif"><IMG
? ? ? ? ? ? ? ? ?height=6 alt="" src="templates/New look/images/t_23.gif" width=10
? ? ? ? ? ? ? ? ?border=0></TD></TR>
? ? ? ? ? ? ?<TR vAlign=bottom>
? ? ? ? ? ? ? ?<TD background="templates/New look/images/t_fon_left.gif"><IMG
? ? ? ? ? ? ? ? ?height=7 alt="" src="templates/New look/images/t_31.gif" width=10
? ? ? ? ? ? ? ? ?border=0></TD>
? ? ? ? ? ? ? ?<TD background="templates/New look/images/t_fon_right.gif"><IMG
? ? ? ? ? ? ? ? ?height=7 alt="" src="templates/New look/images/t_33.gif" width=10
? ? ? ? ? ? ? ? ?border=0></TD></TR>
? ? ? ? ? ? ?<TR>
? ? ? ? ? ? ? ?<TD><IMG height=10 alt=""
? ? ? ? ? ? ? ? ?src="templates/New look/images/t_41.gif" width=10 border=0></TD>
? ? ? ? ? ? ? ?<TD background="templates/New look/images/t_fon_bot.gif"><IMG
? ? ? ? ? ? ? ? ?height=10 alt="" src="templates/New look/images/t_42.gif" width=6
? ? ? ? ? ? ? ? ?border=0></TD>
? ? ? ? ? ? ? ?<TD align=right
? ? ? ? ? ? ? ?background="templates/New look/images/t_fon_bot.gif"><IMG
? ? ? ? ? ? ? ? ?height=10 alt="" src="templates/New look/images/t_44.gif" width=6
? ? ? ? ? ? ? ? ?border=0></TD>
? ? ? ? ? ? ? ?<TD><IMG height=10 alt=""
? ? ? ? ? ? ? ? ?src="templates/New look/images/t_45.gif" width=10
? ? ? ? ? ? ?border=0></TD></TR></TBODY></TABLE>');



? ?$col ++;
? ?if ($col > 2) {
? ? ?$col = 0;
? ? $row ++;
? ?}
?}
? ? ?new contentBox($info_box_contents);

?>
<!-- new_products_eof //-->
<?php } ?>

 

I really hope that there is someone that knows where i go wrong.

You can see what it looks like at the moment at testsite

 

:'(

 

thanks in advance.....btw sorry for the bad englisch.....i'am dutch...

 

Anne

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...