[Resolved] Discount for minimum value applied incorrectly


  • Default avatar
    brendon0    
     10 years ago
    0

    Redshop 1.1.20
    Joomla 2.5.9
    Awo Coupon 2.1.7


    Hi there,

    I didn't see another post for this open in the forum. On my client's site we have an automatic coupon set up to trigger on orders with a minimum value of $250. I've noticed an issue though where the automatic coupon will show up in the cart, but then not be carried over to the checkout page. It looks like this is because when proceeding to checkout the automatic coupon is looking at the total after tax/discount in the cart and making a decision on whether or not it qualifies after that. Here's an example:


    Example A (discount appears in cart but is not carried over to checkout):

    Subtotal: $233.52
    Tax: $28.02
    Discount: $13.08
    Total: $248.47


    Example B (discount appears in cart and is carried over to checkout):

    Subtotal: $235.20
    Tax: $28.22
    Discount: $13.17
    Total: $250.25


    It should really be looking at the subtotal only (ideally), or the subtotal plus tax if that's not possible. If someone can let me know if there's anything I can to do the code on my end to correct this it would be greatly appreciated.

    Cheers,

    Brendon
  • Your avatar
    seyi    
     10 years ago
    0

    Hello,

    Yes, I see what you mean. It should really calculate on the product total including taxes, but no coupon discounts. Here is a fix, which will also be added to the next version:

    in www/administrator/components/com_awocoupon/helpers/estore/redshop/couponhandler.php, around line 28 is this:
    <?php
            $this
    ->product_total = @$this->rscart['total'];
    ?>


    Change it to this
    <?php
            
    //$this->product_total = @$this->rscart['total'];
            
    $this->product_total = @$this->rscart['product_subtotal'];
            if(!empty(
    $this->rscart['coupon'])) {
                foreach(
    $this->rscart['coupon'] as $c$this->product_total += $c['product_discount'];
            }
    ?>


    That should fix it.
  • Default avatar
    brendon0    
     10 years ago
    0

    It looks like that did the trick. Thanks for the quick response.