Discount before shipping calculation not working


  • Default avatar
    wolverines    
     2 years ago
    0

    Setup for discount/coupon
    The shop has 4 main categories in use
    We need a 15% discount coupon that offers this discount for only 2 combined categories and customer has to have a minimum of 2 items in the cart from these categories before the discount is applied.
    The discount should be applied to the cart subtotal before the shipping rate is set. We have a shipping rate of £12.99 below £150 order value and free when over this value.

    Using the built in Hikashop discount, I created a coupon for 15% off (but am not able to limit this to the 2 required combined categories, which is why I purchased Awocoupon) This setup worked and took the discount off before applying the shipping calculation.
    Once I installed Awocoupon, the function no longer works and shipping is now calculated on the subtotal value before discounts.

    Have I missed an obvious setting in Awocoupon?

    Regards
    Phil
  • Your avatar
    seyi    
     2 years ago
    0

    I have looked into this and it is a problem with AwoCoupon. it does not pass back to hikashop certain information that is needed. To fix, you will need ftp access to make modifications.

    In www/administrator/components/com_awocoupon/helpers/estore/hikashop/couponhandler.php, around line 333 is this:

    <?php
            $cart
    ->coupon $object;
            
    $cart->full_total $object->total;
    //printr$object);        
            
    return null;        
            
        }
    ?>



    Right before that you will need to add a little code, so fully it looks like this:
    <?php
            $object
    ->discount_flat_amount $coupon_session['product_discount'];
            
    $object->discount_flat_amount_without_tax $coupon_session['product_discount_notax'];
            
    $object->discount_percent_amount 0;
            
    $cart->coupon $object;
            
    $cart->full_total $object->total;
    //printr$object);        
            
    return null;        
            
        }
    ?>


    And that should fix the problem.