Après moultes recherches et essais, j'ai réussi à obtenir du module ot_coupon (catalog/includes/modules/ot_coupon.php) la non-application des réductions sur les produits déjà en promotion. J'ai effectué des modifs uniquement sur les coupons en % et sans restrictions (produits ou catégories)... La tva aussi est modifiée en conséquence.
CODE
function calculate_credit($amount) {
global $customer_id, $order, $cc_id, $languages_id;
//Start CP sale exclusion
//check if this product ($product['id']) on sale
for ($i=0; $i<sizeof($order->products); $i++) {
$specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . $order->products[$i]['id'] ."' and status = '1'"); }
if (tep_db_num_rows($specials_query) > 0) {
$specials = tep_db_fetch_array($specials_query);
$specialprice = $specials['specials_new_products_price'];
}
if ($specialprice > 0) {
//This item is on sale, do not apply ANY discount
$amount = $amount - ($specialprice*1.196);
} else {
//This item is of regular value, let the system proceed with applied discount
$amount = $amount;
}
//End CP sale exclusion
puis
CODE
function calculate_tax_deduction($amount, $od_amount, $method) {
global $customer_id, $order, $cc_id, $cart;
//Start CP sale exclusion
//check if this product ($product['id']) on sale
for ($i=0; $i<sizeof($order->products); $i++) {
$specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . $order->products[$i]['id'] ."' and status = '1'"); }
if (tep_db_num_rows($specials_query) > 0) {
$specials = tep_db_fetch_array($specials_query);
$specialprice = $specials['specials_new_products_price'];
}
//End CP sale exclusion
et dans la même fonction ajouter
CODE
if ($get_result['coupon_type'] =='P') {
$tod_amount=0;
if ($method=='Credit Note') {
$tax_desc = tep_get_tax_description($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
$tod_amount = $order->info['tax_groups'][$tax_desc] * $od_amount/100;
$order->info['tax_groups'][$tax_desc] -= $tod_amount;
} else {
//Start CP sale exclusion
if ($specialprice > 0) {
reset($order->info['tax_groups']);
while (list($key, $value) = each($order->info['tax_groups'])) {
$god_amount=0;
$tax_rate = tep_get_tax_rate_from_desc($key);
$net = $tax_rate * $order->info['tax_groups'][$key];
if ($net>0) {
$god_amount = ($order->info['tax_groups'][$key] * $get_result['coupon_amount']/100);
$tod_amount += $god_amount;
$order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] - $god_amount+(($specialprice*0.196) * $get_result['coupon_amount']/100);
}} } else {
//End CP sale exclusion
sans oublier pour finir
CODE
//Start CP sale exclusion
}
//End CP sale exclusion
}
}
}
//$order->info['total'] -= $tod_amount; // CP ajustement total pour calcul TVA
$order->info['tax'] -= $tod_amount;
}
}
}
}
return $tod_amount;
}
Ce n'est pas du code de haute voltige mais ça a le mérite de fonctionner... ou d'être une piste à reprendre !