OK, I am getting there now, I have chenged the code as follows and it now displays the correct VAT/TAX on the checkout etc, but reverts to the incorrect tax on the order details page within admin, and also on an invoice
if ($cart->count_contents() > 0) {
if ((isset($_POST['coupon_code'])) and ($_POST['coupon_code'] != '')) {
switch (strtolower($_POST['coupon_code'])) {
case '5percentoff' : $new_discount = $cart->show_total() * 0.05; $discount_percentage = 0.05;
$easy_discount->reset();$easy_discount->set('COUPON1','5% Coupon Discount', $new_discount);
break;
case '10percentoff' : $new_discount = $cart->show_total() * 0.10; $discount_percentage = 0.1;
$easy_discount->reset();$easy_discount->set('COUPON2','10% Coupon Discount', $new_discount);
break;
case '20percentoff' : $new_discount = $cart->show_total() * 0.20; $discount_percentage = 0.2;
$easy_discount->reset();$easy_discount->set('COUPON3','20% Coupon Discount', $new_discount);
break;
}
}
} else {
$easy_discount->reset();
}
Anyone help me get past this final hurdle?
Thank you, Andy