No history under history of uses


  • Default avatar
    wen127    
     8 years ago
    0

    Hello Seyi,

    I found that my AwoCoupon Pro failed on collecting history of uses, with no error or warning shown.

    The coupon did it's job to applying discount on customer's orders.
    But it shows nothing under history of uses.

    If I go into the specific order in VM, I can see the coupon been apply.


    Do you have any idea what the problem would be?
  • Default avatar
    wen127    
     8 years ago
    0

    OK, after several testing. I should correct my question.

    first, I set a coupon code limited usage 1 per Customer.
    Then configuration -> Trigger ->Order state to trigger coupon processing:

    A. Set to "confirm" (actually it'll be the same if I set other than "order creation")
    After the order been confirmed:
    --> 1. The coupon code still usable by the same customer. (fail)
    --> 2. History of Uses show the order. (correct)


    B. Set to "order creation"
    After the order been creat:
    --> 1. The coupon code is not reusable by the same customer. (correct)
    --> 2. History of Uses show the order. (correct)

    B makes everything correct.
    But I need that after a customer paid & confirm the order --> coupon set can't be re-use & record on history of uses.
    What should I do?

    p.s.
    configuration -> Trigger ->Restore coupon's number of uses if order is not processed
    was set to "Refunded, cancelled"
  • Your avatar
    seyi    
     8 years ago
    0

    Hello,

    That is strange If you have a coupon code set to customer 1 per use, once it is in the history of uses for that customer, it is no longer usable by that customer. The history of uses is what is used to determine usage. Can you verify scenario A? That after number 2 happens, number 1 cannot?
  • Default avatar
    wen127    
     8 years ago
    0

    Yes. I just test it again (on a identical staging site).
    Scenario A, after number 2 happens, number 1 cannot.
    I can still purchase again using the same coupon.

    For your reference
    http://www.awesomescreenshot.com/image/60776/33e872f4676fb5898435fc3b1762cf42
    http://www.awesomescreenshot.com/image/60778/6cc224ef04ae1fb94969c134c74fc8bc

  • Your avatar
    seyi    
     8 years ago
    0

    Hello,

    What versions are you using?
  • Default avatar
    wen127    
     8 years ago
    0

    Hellow,

    I'm using

    Joomla! 3.3.6
    VirtueMart 3.0.2
    AwoCoupon 2.3.7 (latest)
  • Your avatar
    seyi    
     8 years ago
    0

    Hello,

    Tested and able to produce. Looks like, in this version at least, there is a cart session created for the admin user. So when you manually confirm the order, it uses the admin email instead of the user email. As the number of uses it calculated on the email address, this causes the number of uses per customer not to work.

    So the fix:
    in www/administrator/components/com_awocoupon/helpers/estore/virtuemart/couponhandler.php, around line 787 is this:

    <?php
            
    if(empty($email)) {
    ?>


    Change it to this:
    <?php
            
    if(JFactory::getApplication()->isAdmin() || empty($email)) {
    ?>

  • Default avatar
    wen127    
     8 years ago
    0

    Yes it fixed!
    Thank you so much, Seyi. :D