In the instructions at this point is where I came acoss my discount by category modification.
3.6) includes/modules/product_listing.php
1. Change This:
case 'PRODUCT_LIST_PRICE':
$lc_align = 'right';
if (tep_not_null($listing['specials_new_products_price'])) {
To This:
case 'PRODUCT_LIST_PRICE':
$lc_align = 'right';
if ($listing['products_price'] < $listing['products_map'])
{
$lc_text = ' ' . MAP_WARNING;
}
else if (tep_not_null($listing['specials_new_products_price'])) {
I basically need to have the site show retail when an item is searched and when the customer views the item detail or adds it to the cart they see the discount price. Both would be cool but add to cart is enough.
Here is the relevant code from my file:
case 'PRODUCT_LIST_PRICE':
if (($current_category_id == NULL) && ($temp_category_id != $listing[categories_id])) {
#get the discount for this category
#echo 'listing:', $listing[categories_id];
#exit;
$discount_sql = "SELECT amount FROM discount WHERE category_id = '$listing[categories_id]' LIMIT 1";
$discount_query = tep_db_query($discount_sql);
$discount = mysql_fetch_array($discount_query);
$temp_category_id = $listing[categories_id];
#echo 'xx: ', $listing;
}
$lc_align = 'right';
if (tep_not_null($listing['specials_new_products_price'])) {
$lc_text = ' <s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';
} else {
# if there has been a discount found for this category, display the 'retail price' and 'our price';
if (($discount[amount] != NULL) && ($discount[amount] != '0')) {
$lc_text = ' Retail Price:' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' <br>';
$lc_text .= ' Our Price:' . $currencies->display_price_w_discount($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id']), $discount[amount]) . ' ';
}
else {
$lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' <br>';
}
}
break;
Thanks in advance for any help you can offer. Let me know if you need any files etc.
Eric














