I have the solution on the Discount Coupons that can work for you ...
Customize the file:
/includes/modules/order_total/ot_coupon.php
and add the code in RED:
Code:
function get_order_total($couponCode)
{
global $order;
$orderTaxGroups = $order->info['tax_groups'];
$orderTotalTax = $order->info['tax'];
$orderTotal = $order->info['total'];
$products = $_SESSION['cart']->get_products();
for ($i=0; $i<sizeof($products); $i++) {
// bof: no discount on Products with Product Discount quantities products_discount_quantity
global $db;
$no_discount = false;
$sql = "SELECT products_id from " . TABLE_PRODUCTS_DISCOUNT_QUANTITY . " WHERE products_id = '" . (int)$products[$i]['id'] . "'";
$chk_discount = $db->Execute($sql);
if ($chk_discount->RecordCount() > 0) $no_discount = true;
//echo 'ot_coupon products_id: ' . (int)$products[$i]['id'] . ' RecordCount(): ' . $chk_discount->RecordCount() . ' Discounted: ' . ($no_discount ? 'YES' : 'NO') . '<br><br>';
if ($no_discount || !is_product_valid($products[$i]['id'], $couponCode)) {
// eof: no discount on Products with Product Discount quantities products_discount_quantity
$products_tax = zen_get_tax_rate($products[$i]['tax_class_id']);
$productsTaxAmount = (zen_calculate_tax($products[$i]['final_price'], $products_tax)) * $products[$i]['quantity'];
$orderTotal -= $products[$i]['final_price'] * $products[$i]['quantity'];
if ($this->include_tax == 'true') {
For the Group discounts, this is going to be more complicated and if I get time, I will try to workout some kind of solution for that ...
Bookmarks