Aworewards coupon per order does not send mail


  • Default avatar
    dario9    
     2 years ago
    0

    With these parameters rule:

    Points: 15% Order Total
    Coupon - System: W4Db95
    Coupon Expiration: 120
    Minimum Order Total Type: Per Order
    Minimum Order Total: 100.00
    Order Number to trigger rule: 1,2,3,4,5,6,7,8,9,10

    any mail was sent with coupon code after confirmation order.

    I change the order status in Virtuemart order but aworewards not trigger the rule.
    Where I make mistake??

    Thank you.

  • Your avatar
    seyi    
     2 years ago
    0

    Hello,

    The rule seems fine. In the credit type section of the rule, do you have that set to points or email? Also is the aworewards plugin installed and enabled?
  • Default avatar
    dario9    
     2 years ago
    0

    In the credit type section i have coupon - system and yes the plugin are all installed and published
  • Your avatar
    seyi    
     2 years ago
    0

    Hello,

    I am not able to reproduce the problem using the parameters.

    If the order is over 100 and the confirmed order is one of 10, and the email template is not blank, you should receive the email. Is the credit recorded in aworewards->credit history?

    If still having trouble, is it possible to send a private message with temporary admin access to have a look?
  • Your avatar
    seyi    
     2 years ago
    0

    Hello,

    Ok, thanks for the access. I believe I figured out what the problem is now. You are using Virtuemart 1.1.9 and do not have AwoCoupon installed. AwoCoupon automatically adds an injection which is needed also by AwoRewards in the Virtuemart 1 branch. This is an oversight, and will be fixed in the future. But to get it to work, please do the below:

    in wwww/administrator/components/com_virtuemart/classes/ps_order.php, around line 219 is this set of code
    <?php
                
    // Update the Order History.
                
    $fields = array( 'order_id' => $d["order_id"],
                                            
    'order_status_code' => $d["order_status"],
                                            
    'date_added' => $mysqlDatetime,
                                            
    'customer_notified' => $notify_customer,
                                            
    'comments' => $d['order_comment']
                                );
                
    $db->buildQuery('INSERT''#__{vm}_order_history'$fields );
                
    $db->query();
    ?>


    Right after that, add this
    <?php
            
    # aworewards_code START ===============================================================
            
    JPluginHelper::importPlugin('virtuemart');
            
    $dispatcher JDispatcher::getInstance();
            
    $returnValues $dispatcher->trigger('onOrderStatusUpdate', array($d,$curr_order_status));
            
    # aworewards_code END =================================================================
    ?>


    Save the file and then try changing the order status back to pending and then to confirmed. It should fire now.


  • Default avatar
    dario9    
     2 years ago
    0

    Than you very much. It fires now.