Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

My Right Coloum Has Shifted Down After The Product Info.


kunal247

Recommended Posts

The page uploaded that is causing this to happen is below. Page name xsell_products.php

 

Here is the page:

<?php

$xsell_array = array();

 

$xsell_query_raw = "SELECT p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, xp.xsell_id, m.manufacturers_name, m.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_XSELL . " xp, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' AND p.manufacturers_id = m.manufacturers_id AND p.products_id = xp.xsell_id AND xp.products_id = '" . $HTTP_GET_VARS['products_id'] . "' AND p.products_id = pd.products_id ORDER BY pd.products_name";

 

$xsell_split = new splitPageResults($xsell_query_raw, MAX_DISPLAY_PRODUCTS_NEW);

if ($xsell_split->number_of_rows > 0) { ;?>

<table class="productListing" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="85" align="center" class="productListing-heading">Add

</td>

<td class="productListing-heading">

<?php echo tep_draw_separator('pixel_trans.gif', '150', '10'); ?>

</td>

<td width="100%" class="productListing-heading">

Recommended with this Product

</td>

</tr>

<?php

$xsell_query = tep_db_query($xsell_split->sql_query);

while ($xsell = tep_db_fetch_array($xsell_query)) {

if ($xsell_price = tep_get_products_special_price($xsell['products_id'])) {

$products_price = '<s>' . $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($xsell_price, tep_get_tax_rate($xsell['products_tax_class_id'])) . '</span>';

} else {

$products_price = $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id']));

}

?>

<tr>

<td class="main" align="center">

<?php

echo tep_draw_checkbox_field('add_recommended[]',$xsell['products_id']);

?>

</td>

<td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" align="center" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>

<td valign="middle" class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '"><b><u>' . $xsell['products_name'] . '</u></b></a><br>

Manufacturer: <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $xsell['manufacturers_id']) . '" target="_blank">' . $xsell['manufacturers_name'] . '</a><br>Price: ' . $products_price; ?></td>

</tr>

 

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

}

} else {

?>

<table>

<tr>

<td>

<?php echo tep_draw_separator('pixel_trans.gif', '100%', '10');?>

</td>

</tr>

<?php

}

/* obtain the xsell product */

 

$xsell_query = tep_db_query("select distinct p.products_id,

p.products_image,

pd.products_name

from " . TABLE_PRODUCTS_XSELL . " xp,

" . TABLE_PRODUCTS . " p,

" . TABLE_PRODUCTS_DESCRIPTION . " pd

where xp.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and

xp.xsell_id = p.products_id and

p.products_id = pd.products_id and

pd.language_id = '" . $languages_id . "' and

p.products_status = '1'

order by xp.products_id asc

limit " . MAX_DISPLAY_ALSO_PURCHASED);

 

$num_products_xsell = tep_db_num_rows($xsell_query);

 

/* if we equal or exceed the minimal amount of products */

 

 

 

/* there are no xsell products registered at all for this product */

 

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left', 'text' => TEXT_XSELL_PRODUCTS);

new contentBoxHeading($info_box_contents);

 

$row = 0;

$col = 0;

$info_box_contents = array();

 

 

/* fill the box with all random products from the same category */

 

$mtm= rand();

$xsell_cat_query = tep_db_query("select categories_id

from " . TABLE_PRODUCTS_TO_CATEGORIES . "

where products_id = '" . $HTTP_GET_VARS['products_id'] . "'");

 

$xsell_cat_array = tep_db_fetch_array($xsell_cat_query);

$xsell_category = $xsell_cat_array['categories_id'];

$new_limit = MAX_DISPLAY_ALSO_PURCHASED - $num_products_xsell;

$xsell_prod_query = tep_db_query("select distinct p.products_id,

p.products_image,

pd.products_name

from " . TABLE_PRODUCTS . " p,

" . TABLE_PRODUCTS_TO_CATEGORIES . " pc,

" . TABLE_PRODUCTS_DESCRIPTION . " pd

where pc.categories_id = '" . $xsell_category . "' and

pc.products_id = p.products_id and

p.products_id != '" . $HTTP_GET_VARS['products_id'] . "' and

p.products_id = pd.products_id and

pd.language_id = '" . $languages_id . "' and

p.products_status = '1'

order by rand($mtm) desc

limit " . MAX_DISPLAY_ALSO_PURCHASED);

 

while ($xsell = tep_db_fetch_array($xsell_prod_query)) {

$xsell['products_name'] = tep_get_products_name($xsell['products_id']);

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

'params' => 'class="smallText" width="33%" valign="top"',

'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] . '</a>');

$col ++;

if ($col > 2) {

$col = 0;

$row ++;

}

}

new contentBox($info_box_contents);

 

?>

</tr>

</table>

Appreciate your help to get this fixed and up and running ASAP.

Thanks in advance.

Kunal

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...