Payment method discount calculation incorrect


  • Default avatar
    kboy224    
     13 years ago
    0

    Hello everyone

    Sorry to post this here...I have a problem with VM, but I don't get any response as there are too many posts...
    If anyone using VM and can help me, it would be very much appreciated.

    I have a problem with payment method discount.
    I set 2% discount for direct debit and VM applies the payment method discount to the subtotal, not the total after coupon discount when there's a coupon discount.

    For example,
    Order subtotal :$59.50
    Coupon discount : -$5.95
    (subtotal $53.55)
    Payment method discount : -$1.19 (should be $1.07)
    Total : $52.36 (should be $52.48

    The item subtotal is $59.50
    and AW coupon discount 10% $5.95
    and the total comes to $53.55 which is the amount customer has to pay.
    Therefore, I want the payment method discount 2% to apply to the total $53.55 (2%=$1.07) not to $59.50 (2% = $1.19).
    The difference is not that big, but when the coupon discount is a big one, it makes a lot different.

    Could anyone please help me to correct this? I tried to modify the code, but no luck...


    Thank you in advance!
    Bo
  • Your avatar
    seyi    
     13 years ago
    0

    Hi, the payment method discount is calculated in
    www/administrator/components/com_virtuemart/classes/ps_checkout.php function get_payment_discount

    Within that function, you could probably add something like this
    <?php
    @$subtotal $subtotal $_SESSION['coupon_discount'];
    ?>


    after
    <?php
    if( $subtotal === '') {
        
    $subtotal $this->get_order_subtotal$vars );
    }
    ?>




  • Default avatar
    kboy224    
     13 years ago
    0

    Hi Seyi,

    You're my life saver! Thanks sooo much!