Coupon invalid on free Items


  • Default avatar
    ialearn    
     6 years ago  last edited 6 years ago
    0

    Hi

    I just installed the new version of the coupon component.

    I am using this together with Hikashop, I think I had Version 2.5.9.5 and now installed 3.5.6.1

    With the previous version if I had a 0 value item (free) in the cart plus an item with a price and tried to pay using a gift voucher it worked correctly now I get a "The coupon you entered is not valid " error.

    How do I fix this?
  • Your avatar
    seyi    
     6 years ago
    0

    Hello,

    In the file www/administrator/components/com_awocoupon/helper/estore/hikashop/class-awocoupon-helper-estore-hikashop.php, around line 979 is this:
    <?php
                    
    'tax_rate' => ( $price $price_notax ) / $price_notax,
    ?>

    Update it to this:
    <?php
                    
    'tax_rate' => empty( $price_notax ) ? : ( $price $price_notax ) / $price_notax,
    ?>

    That should fix it