Ok, will not worry about how it is calculated, that is a Virtuemart thing. But yes, the total is not adjusted when there is a coupon with AwoCoupon. Here is how to fix it. In the file
\administrator\components\com_awocoupon\helper\estore\virtuemart\class-awocoupon-helper-estore-virtuemart-discount.php, around line 466 is this:
<?php
else {
// update cart objects
$coupon_taxbill = 0;
$this->vmcartPrices['couponTax'] = round( $coupon_session->product_discount_tax + $coupon_session->shipping_discount_tax + $coupon_taxbill,2 ) * $negative_multiplier;
$this->vmcartPrices['couponValue'] = round( $coupon_session->product_discount_notax + $coupon_session->shipping_discount_notax,2 ) * $negative_multiplier;
$this->vmcartPrices['salesPriceCoupon'] = round( $coupon_session->product_discount + $coupon_session->shipping_discount + $coupon_taxbill,2 ) * $negative_multiplier;
$this->vmcartPrices['billSub'] -= $this->vmcartPrices['couponValue'] * $negative_multiplier;
$this->vmcartPrices['billTaxAmount'] -= $this->vmcartPrices['couponTax'] * $negative_multiplier;
$this->vmcartPrices['billTotal'] -= $this->vmcartPrices['salesPriceCoupon'] * $negative_multiplier;
}
?>
Right after that add this
<?php
// adjust for payment method
if ( ! empty( $this->vmcartPrices['salesPricePayment'] ) ) {
$percent_discount = $this->vmcartPrices['salesPriceCoupon'] / ( $this->vmcartPrices['salesPriceShipment'] + $this->vmcartPrices['withTax'] );
$payment_adjust = abs( round( $this->vmcartPrices['salesPricePayment'] * $percent_discount, 2 ) );
$this->vmcartPrices['billTotal'] -= $payment_adjust;
}
?>
That should do it.