Quantity Discount Levels For Separate Categories:

SWGuy: I have seen this question posted 4 times in this thread, (and it is a long one) with no real answer.
ZC version 1.3.8 - your Quantity Discounts module 1.10 installed and working.
The Admin/Order Totals/Quantity Discounts is installed, no tax or tax calculations, discount units by percentage, Discount basis by category, counting method = Items.

There are no standard Zen Cart discount structures applied in the whole shop. The only other mods are Purchase Order (a payment mod encountered only after Order Totals) and Columns.

The discount structure applied in the Admin/Order Totals/Quantity Discounts module is: 5 to 10 items=5% discount, 10+ is 10%. The rest are blank. This works OK, and discounts are excluded on the "Excluded Categories" in the modules/order_totals/ot_quantity_discount file.

The basic problem is that the user exit for categories with separate discount policies will NOT override the default discount listed in the Admin section.

Here is the code from that section of ot_quantity_discount.php

// Add categories with special discounting policies to this list.
// Note that 99999, 99998 and 99997 are just given as examples.
// Note that the Discounting Units you specified in Admin
// (percentage, currency, currency/item) are also used here.



function apply_special_category_discount($category, $count, &$disc_amount) {
switch($category) {
case 29:
if ($count > 10) {
$disc_amount = 5;
}
break;
case 99997:
$disc_amount = 75;
break;
}
}


Here's the deal: If I order 9 of the units in Category 29, I should get no discount. But I get the standard 5% as entered in Admin. I will eventually expand this to have different discount rates on about 5 other categories, and order and install most of your commercial mods, but I have to get this working first.

Yes, this the correct parent category for the products listed under it. I am also required to make the discount for the same category go to 10% if 25 items are purchased. I tried it various ways, but syntax errors on my end crashed the page when trying to add the next level into this code section. Let's keep it simple and get a single one working first........

Any advice would be appreciated.