Category discount
for osCommerce Online Merchant v2.2
Discounts in money or quantity per category.
Legend: 
Download

Report
correct version of includes/functions/category_discount.php
correct version of tep_get_cat_path function
add this function to general.php:
function tep_get_cat_path ($current_category_id = '') {
$last_category_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . $current_category_id . "'");
$last_category = tep_db_fetch_array($last_category_query);
if ($last_category['parent_id'] != 0) {
$cat_string = $last_category['parent_id'] . '_' . $current_category_id;
while ($last_category['parent_id'] != 0) {
$last_category_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . $last_category['parent_id'] . "'");
$last_category = tep_db_fetch_array($last_category_query);
$cat_string .= $last_category['parent_id'] . '_' . $cat_string;
}
return $cat_string;
} else {
return $current_category_id;
}
}
Discounts in money or quantity per category tree.
With this version you can enter a top category id and all products which fall under that tree
will be part of the discount you give.
Another discount type "p" has been added:
34:10:20:p
which means buy 10 from category 34 or its possible subcategories and we give a discount of 20 per ordered item i.e. 20 off.
You can ofcourse add your own discount types as you like.
Discounts in money or quantity per category.