this is "productling.php" page for show product list.I customized some thing to change the listing form.Everything seems going on well.But problem is the price which can not show the normal price just only show the special price.And I don't know why.
<?php
/*
$Id: product_listing_col.php,v 1.00 2002/05/06 20:28:07 icw_ Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright © 2002 osCommerce
Released under the GNU General Public License*/
function tep_get_products_name($product_id) {
global $languages_id;
$product_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $product_id . "' and language_id = '" . $languages_id . "'");
$product = tep_db_fetch_array($product_query);
return $product['products_name'];
}
?>
<!-- product_listing_col //-->
<table width="100%">
<?php
$listing_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $listing_sql, $listing_numrows);
?>
<?php
$count=0;
$listing = tep_db_query($listing_sql);
while ($listing_values = tep_db_fetch_array($listing)) {
$listing_values['products_image']=
$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . ($HTTP_GET_VARS['cPath'] ? $HTTP_GET_VARS['cPath'] : tep_get_product_path($listing_values['products_id']) ) . '&products_id=' . $listing_values['products_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . $listing_values['products_image'], $listing_values['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';
$listing_values['products_name'] = tep_get_products_name($listing_values['products_id']);
if ($listing_values['specials_new_products_price']) {
$products_price = '<s>' . $currencies->display_price($listing_values['products_price'], $listing_values['products_tax_class_id']) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($listing_values['specials_new_products_price'], $listing_values['products_tax_class_id']) . '</span>';
} else {
$products_price = $currencies->display_price($listing_values['products_price'], $listing_values['products_tax_class_id']);
}
?>
<tr>
<td align="center" width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo $listing_values['products_image']; ?></td>
<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' .
$listing_values['products_id']) . '"><b><u>' .
$listing_values['products_name'] . '</u></b></a><br>' .
$listing_values['products_short_description'] . '<br>' .
$listing_values['specials_new_products_price'];
?><br><?php echo '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' .$listing_values['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif') . '</a> '; ?>
<br><hr size=1>
</td>
</tr>
<?php
$count++;
}
?>
<table width="100%">
<tr>
<td class="smallText"> <?php echo $listing_split->display_count($listing_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?> </td>
<td align="right" class="smallText"> <?php echo TEXT_RESULT_PAGE; ?> <?php echo $listing_split->display_links($listing_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?> </td>
</tr>
</table>