Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Bit of help with displays


Guest

Recommended Posts

Posted

I just got my new site Business databases

 

I got 2 rows with products on the home page i like it to show

 

4 rows and not just 2 with hte products how do i add the extra 2 rows please.

 

Thank you

Posted

TY for your help

 

 

<?php

/*

$Id: new_products.php,v 1.34 2003/06/09 22:49:58 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

$temp_side = $side ;

 

$side = '_new';

 

?>

<!-- new_products //-->

<TABLE border="0" width="100%" cellspacing="0" cellpadding="0">

<TR>

<TD style="padding-left: 10px;">

 

<TABLE border="0" width="100%" cellspacing="0" cellpadding="0">

<TR>

<TD style="border-top: 1px solid #D0D3D8; border-bottom: 1px solid #D0D3D8; padding-top: 10px; padding-bottom: 10px;">

 

<?php

// $info_box_contents = array();

// $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));

 

// new contentBoxHeading($info_box_contents, $side);

 

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' order by RAND() limit " . MAX_DISPLAY_NEW_PRODUCTS);

} 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 = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by RAND() limit " . MAX_DISPLAY_NEW_PRODUCTS);

}

 

$row = 0;

$col = 0;

$nr = 1;

$info_box_contents = array();

while ($new_products = tep_db_fetch_array($new_products_query)) {

 

if ($nr > 2) {

$style = 'border-top: 1px solid #D0D3D8;';

} else {

$style = '';

}

 

// $new_products['products_name'] = tep_get_products_name($new_products['products_id']);

 

// ADDED BY CLEMENT

$product_query = tep_db_query("select products_name, products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $new_products['products_id'] . "' and language_id = '" . $languages_id . "'");

$product_details = tep_db_fetch_array($product_query);

 

 

$new_products['products_name'] = $product_details['products_name'];

$new_products['products_description'] = substr ($product_details['products_description'],0,40);

 

//**

 

$info_box_contents[$row][$col] = array('align' => 'center',

'params' => 'class="smallText" style="' . $style . '" width="50%" valign="top"',

'text' => '<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>

<TABLE border="0" width="100%" cellspacing="0" cellpadding="0"><TR><TD width="50%" valign="middle" class="smallText"><a class="newProdName" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $new_products['products_description'] . '...</TD>

'. tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $new_products['products_id'])).'

<TD width="50%" align="right" valign="top" class="smallText"><SPAN class="newPrice">' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) . ' </SPAN><br>'.tep_draw_hidden_field('products_id', $new_products['products_id']). tep_image_submit('button_add_cart.gif', IMAGE_BUTTON_IN_CART).'</TD>

</FORM>

</TR></TABLE>');

 

$nr ++;

$col ++;

if ($col > 1) {

$col = 0;

$row ++;

}

}

 

new contentBox($info_box_contents, $side);

 

$side = $temp_side;

 

?>

 

</TD>

</TR>

</TABLE>

 

</TD>

</TR>

</TABLE>

<!-- new_products_eof //-->

Posted

try this but remember to backup before

 

<?php
/*
$Id: new_products.php,v 1.34 2003/06/09 22:49:58 hpdl Exp $

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

Copyright © 2003 osCommerce

Released under the GNU General Public License
*/

$temp_side = $side;

$side = '_new';

?>
<!-- new_products //-->
<TABLE border="0" width="100%" cellspacing="0" cellpadding="0">
<TR>
<TD style="padding-left: 10px;">

<TABLE border="0" width="100%" cellspacing="0" cellpadding="0">
<TR>
<TD style="border-top: 1px solid #D0D3D8; border-bottom: 1px solid #D0D3D8; padding-top: 10px; padding-bottom: 10px;">

<?php
// $info_box_contents = array();
// $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));

// new contentBoxHeading($info_box_contents, $side);

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' order by RAND() limit " . MAX_DISPLAY_NEW_PRODUCTS);
} 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 = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by RAND() limit " . MAX_DISPLAY_NEW_PRODUCTS);
}

$row = 0;
$col = 0;
$nr = 1;
$info_box_contents = array();
while ($new_products = tep_db_fetch_array($new_products_query)) {

if ($nr > 2) {
$style = 'border-top: 1px solid #D0D3D8;';
} else {
$style = '';
}

// $new_products['products_name'] = tep_get_products_name($new_products['products_id']);

// ADDED BY CLEMENT
$product_query = tep_db_query("select products_name, products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $new_products['products_id'] . "' and language_id = '" . $languages_id . "'");
$product_details = tep_db_fetch_array($product_query);


$new_products['products_name'] = $product_details['products_name'];
$new_products['products_description'] = substr ($product_details['products_description'],0,40);

//**

$info_box_contents[$row][$col] = array('align' => 'center',
'params' => 'class="smallText" style="' . $style . '" width="25%" valign="top"',
'text' => '<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>
<TABLE border="0" width="100%" cellspacing="0" cellpadding="0"><TR><TD width="25%" valign="middle" class="smallText"><a class="newProdName" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $new_products['products_description'] . '...</TD>
'. tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $new_products['products_id'])).'
<TD width="25%" align="right" valign="top" class="smallText"><SPAN class="newPrice">' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) . ' </SPAN><br>'.tep_draw_hidden_field('products_id', $new_products['products_id']). tep_image_submit('button_add_cart.gif', IMAGE_BUTTON_IN_CART).'</TD>
</FORM>
</TR></TABLE>');

$nr ++;
$col ++;
if ($col > 2) {
$col = 0;
$row ++;
}
}

new contentBox($info_box_contents, $side);

$side = $temp_side;

?>

</TD>
</TR>
</TABLE>

</TD>
</TR>
</TABLE>
<!-- new_products_eof //-->

Posted

Also 1 more quick question when i add the extra boxes i like to add google adsence under the contact us can you help me there please.

 

Thank you

Posted

do you want to add that under the contact us link on the left column? if so please paste the column_left.php from the includes folder here

Posted
<?php

/*

$Id: column_left.php,v 1.15 2003/07/01 14:34:54 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

// ADDED BY CLEMENT for side column handleing

$side = '_left';

 

?>

 

<TD width="<?php echo COLUMN_LEFT_WIDTH; ?>" valign="top"><TABLE border="0" width="<?php echo COLUMN_LEFT_WIDTH; ?>" cellspacing="0" cellpadding="0">

 

 

<?php

if ((USE_CACHE == 'true') && empty($SID)) {

echo tep_cache_categories_box();

} else {

include(DIR_WS_BOXES . 'categories.php');

}

 

// require(DIR_WS_BOXES . 'whats_new.php');

 

require(DIR_WS_BOXES . 'search.php');

 

if ((USE_CACHE == 'true') && empty($SID)) {

echo tep_cache_manufacturers_box();

} else {

include(DIR_WS_BOXES . 'manufacturers.php');

}

 

require(DIR_WS_BOXES . 'affiliate.php');

 

require(DIR_WS_BOXES . 'information.php');

?>

</TABLE></TD>

Posted

you can create a new file named adsense.php , add your adsense there, and put it in the includes/boxes folder

then at the end of your left_column.php file after

require(DIR_WS_BOXES . 'information.php');

 

add

 

require(DIR_WS_BOXES . 'adsense.php');

Posted

ty got the other bit done how does this look to you.

 

Thank you

Archived

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

×
×
  • Create New...