Wrong payment-method pre-select after confirming an order


  • Default avatar
    theo44    
     8 years ago
    0

    Hi, I found a rather annoying bug when using AwoCoupon pro.

    To figure out where my bug came from I did a clean Joomla 3.4.5 install with Virtuemart 3.0.12 and AwoCoupon Pro 2.4.4. So living on the edge.

    So here's my setup:
    - I have 2 (default) payment methods: Free (max price of 0.00) and Paid (min price of 0.01) and 1 shipping method: Default.
    - Virtuemart has a product with a price of 9.99 EURO.
    - Awocoupon has a coupon-code specific for this product for 10 euro's.

    After I apply the coupon-code the cart is update with a total of 0 euro's and the right payment method is selected: Free. So far so perfect.

    But then, when I confirm this order, something weird happens: the payment-method changes from Free, to Paid. And because my paid option (iDeal) can't pay 0 euro's, I get an error. The wrong payment method is also applied to the order that has been created.

    When checking the underlying cart I can see that the wrong payment id is pre-selected. This preselection is based on the cart, including the coupon discount. So i believe the problem is somewhere in that area.

    This problem only occurs with AwoCoupon Pro. The Free version works, and so does the virtuemart native coupon.

    The following things are not the problem:

    - Tax settings (with or without tax, same problem)
    - Missing code in the calculation helper. tried that to no avail.
    - A specific code for a product. Same problem holds for overall discount.

    I hope someone can help with this bug. Thanks.
  • Your avatar
    seyi    
     8 years ago
    0

    Hello,

    Ok, tracked it down. In
    www/administrator/components/com_awocoupon/helpers/estore/virtuemart/couponhandler.php, line 692 is this line:

    <?php
                        $calculator
    ->_cart $oldcart;
    ?>


    Comment it out or delete it
    <?php
                        
    //$calculator->_cart = $oldcart;
    ?>


    I do not think this will have any bad effects but please test in general just to verify.