Which credit card integration are you using?
Printable View
Which credit card integration are you using?
I'm using the Authorize.net (AIM) module.
Are you using the official one from Zen Cart? This is the first time I have heard of this problem in Zen Cart. In osCommerce it was a huge problem because people would grow their own payment modules without taking into account order totals.
Yes, I am using the one that came with the Zen Cart software. I downloaded the full version of the software from the Zen Cart site and installed it myself (not using my hosting company's automated install).
In case it's relevant, I am also using the TaxCloud module to calculate in-state sales tax, though this customer was out of state so there was no sales tax charged.
I would be grateful for any help with trying to display the right marketing text for two parent categories which uses the function apply_special_category_discount. I've read and re-read the detailed documentation and still don't know how to add logic to the get_discount_parms() method I'm using from Quantity Discounts to reflect my category exceptions.
All my other products use Total By Item discount basis as follows:
Quantity Discount
2 - 9 10%
10 - 39 15%
40 + 20%
Parent categories 16 & 22 uses the following discount basis
2 - 9 10%
10 + 15%
This is what I've done:
1. Apply_special_category_discount() in includes/modules/order_total/ot_quantity_discount.php
2. As many of my products are linked and I've made the two changes to includes/templates/MYTEMPLATE/templates/tpl_product_info_display.php as advised in http://www.thatsoftwareguy.com/zenca...issues.html#mtCode:function apply_special_category_discount($category, $count, &$disc_amount) {
switch($category) {
case 16:
case 22:
if ($count >= 10) {
$disc_amount = 15;
} else if ($count >= 2) {
$disc_amount = 10;
}
break;
}
}
Has anyone managed to get this working?
You have to hardcode the marketing text for these exception cases. The get_* functions can't reverse engineer your logic in the apply_special functions.
The help page has been updated with an example of this.
Thank you so much Scott! I appreciate the example which worked when I cut and paste.
Scott, I realised that my apply_special_category_discount isn't working. I've checked and checked to see if I've got my syntax wrong or missed something but don't seem to. All I've done for this is ammend includes/modules/order_total/ot_quantity_discount.php to
I've tested it by adding my basket with 50 products and the discount is showing as 20% (which is default for all other products) and not 15% for this category. I feel as thick as two planks!Code:function apply_special_category_discount($category, $count, &$disc_amount) {
switch($category) {
case 16:
case 22:
if ($count >= 10) {
$disc_amount = 15;
} else if ($count >= 2) {
$disc_amount = 10;
}
break;
}
}
Thank you for your patience.
Go to the FAQ for Quantity Discounts and look at the link "Category Issues." Either your master categories id is not set the way you think it is (sometimes happens when EZ Populate is used) or you aren't clear on what "category" means for Quantity Discounts (it means master category).
Thank you for the quick reply Scott. I've read the Category Issues http://www.thatsoftwareguy.com/zenca...issues.html#mt a few times and read it again a couple of times and realised that I was using a linked category (master_categories_id = 16) which I've removed and checked that the one I'm using (master_categories_id = 22) is correct.
includes/modules/order_total/ot_quantity_discount.php now shows
It still doesn't seem to be working. E.g. if I add a quantity of 50 to this product from category id 22 - http://tinyurl.com/kzhgamj, I'm getting 20% discount (default discount for all other categories) instead of 15%. I'm using Fast and Easy Checkout module and I don't think that matters in this case. I've read the installation notes again. Going to take a break. It's so straightforward with detailed documention and I'm pulling my hair out!Code:function apply_special_category_discount($category, $count, &$disc_amount) {
switch($category) {
case 22:
if ($count > 10) {
$disc_amount = 15;
} else if ($count > 2) {
$disc_amount = 10;
}
break;
}
}