AWOReferral: problem viewing "credit history"


  • Default avatar
    andrea2    
     11 years ago
    0

    Hello,
    I'm using AWO Referral and I noticed a problem in the "credit history" (front end). The use of the coupon is correctly, but the display creates some problems to customers. I configured "Payment Type = cumulative" for the sponsor, with "Rule Type = order" and "Percent of Order Total = 10". In this way, the sponsor accumulates credit when friends making orders..

    When the sponsor asks for the generation of the coupon code, it appears correctly in the column "Coupon Code". The following coupon codes, however, are inserted into all lines of credit history and not only in line with the credit of the last coupon.

    I forgot some parameters in the configuration?

    I'm using Joomla 2.5.13 and Virtuemart 2.0.22a

    thanks

    Andrea
  • Your avatar
    seyi    
     11 years ago
    0

    Hello,

    when a customer requests a coupon code, and it is paid, it is paid for all credits that have not been paid. So it is possible for the coupon code to show in multiple lines of the credit. You should see the same thing in the backend of credit history.
  • Default avatar
    andrea2    
     11 years ago
    0

    I'm sorry I did not explain well.

    The problem is that the coupon code changes in the rows relating to other credits with coupons already paid..

    I chose the "payment type = cumulative" and I'll explain with an example.

    1) Customer X buys and the sponsor has a credit of € 3.
    2) Customer Y buys and the sponsor has a credit of € 8.
    3) The sponsor asks the coupon and the code (eg "coupon123") is displayed in the "coupon code" column. Total and Claimed Amount are € 8. The sponsor buys using coupon123.
    4) Customer Z buys and the sponsor has a new credit of € 7, which results in a new line without coupon code.
    5) The sponsor asks the coupon and the code (eg "coupon456") will appear in all rows, even where there was coupon123.

    Regards,
    Andrea
  • Your avatar
    seyi    
     11 years ago
    0

    Hello Andrea,

    Yes, I was able to produce the bug. Nasty one. I have updated the component so you can get updates, but just for completeness, here is the solution:
    in www/administrator/components/com_aworeferral/helpers/aworeferralLibrary.php, around line 438 is this:
    <?php
            $sql 
    'SELECT id,amount-IFNULL(amount_paid,0) AS balance
                      FROM #__aworeferral_credit WHERE estore="'
    .AWOREFERRAL_ESTORE.'" AND user_id='.$user_row->id.' AND payment_type="points"';
    ?

    change it to this:
    <?
    php
            $sql 
    'SELECT id,amount-IFNULL(amount_paid,0) AS balance
                      FROM #__aworeferral_credit WHERE estore="'
    .AWOREFERRAL_ESTORE.'" AND user_id='.$user_row->id.' AND payment_type="points"
                    HAVING balance>0'
    ;
    ?>


    That should fix it.
  • Default avatar
    andrea2    
     11 years ago
    0

    Perfect, it works!
    thanks
    Andrea