Moin,
ich hatte eben das folgende Szenario im integrierten Gutscheinsystem:
100% Gutschein auf einen Artikel bezogen mit maximaler Benutzung von 1 erstellt.
Artikel 2x in den Warenkorb gelegt und Gutschein eingegeben.
Erwartetes Verhalten:
Artikel wird 1x zu 100% abgezogen.
Aufgetretenes Verhalten:
Artikel wurde 2x zu 100% abgezogen bzw. bezogen auf die Summe 100% des Artikel abgezogen.
Quickfix (ohne Test von eventuellen Nebeneffekten):
Datei includes/modules/order_total/ot_coupon.php
// INFOS ‹BER DEN KUPON AUSLESEN
//web28 -2011-11-06 - FIX: only active coupon
$coupon_get = xtc_db_query("select coupon_amount, coupon_minimum_order,
restrict_to_products, restrict_to_categories,
- coupon_type
+ coupon_type, uses_per_coupon
from ".TABLE_COUPONS."
where coupon_code = '".$coupon_result['coupon_code']."'
and coupon_active = 'Y'
");
und etwas weiter unten:
if ($pr_ids[$ii] == xtc_get_prid
($order->products[$i]['id'])) { if ($get_result['coupon_type'] == 'P') { $pr_c = $this->product_price($order->products[$i]['id']); //web28- 2010-07-29 - $order->products[$i]['id'] //Fred 2003-10-28, fix for the row above, otherwise the discount is calc based on price excl VAT!+ // Only reduce the maximum uses of the coupon+ if ($get_result['uses_per_coupon'] < $order->products[$i]['qty']) {+ $pr_c -= $get_result['uses_per_coupon'] * $order->products[$i]['price'];+ } $pod_amount = round($pr_c*10)/10*$c_deduct/100; $od_amount = $od_amount + $pod_amount; } else { $od_amount = $c_deduct; $pr_c += $this->product_price($order->products[$i]['id']); //web28- 2010-07-29 - FIX $order->products[$i]['id'] //web28- 2010-05-21 - FIX - restrict max coupon amount Vielleicht hilft es ja dem ein oder anderen der da auch schon drauf gestoßen ist oder noch drauf stößt.
Linkback: https://www.modified-shop.org/forum/index.php?topic=26129.0