Earn Rewardpoints on order status pending in 1.6

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 年 前
Hi,
does anyone resolved this problem in 1.6? I know, it's already fixed in 1.70, but we can't upgrade now.
I really appreciate any help. Thanks.
13 年 前
OK, I made a small hack to make it work.

I put this part of OrderManager.SetOrderStatus method to separate method:

public static void SetRewardPoints(Order currentOrder)
        {
            if (OrderManager.RewardPointsEnabled)
            {
                if (OrderManager.RewardPointsForPurchases_Amount > decimal.Zero)
                {
                    int points = (int)Math.Truncate(currentOrder.OrderTotal / OrderManager.RewardPointsForPurchases_Amount * OrderManager.RewardPointsForPurchases_Points);
                    if (points != 0)
                    {
                        if (OrderManager.RewardPointsForPurchases_Awarded == currentOrder.OrderStatus)
                        {
                            var rph = OrderManager.InsertRewardPointsHistory(currentOrder.CustomerId,
                                0, points, decimal.Zero,
                                decimal.Zero, string.Empty,
                                string.Format(LocalizationManager.GetLocaleResourceString("RewardPoints.Message.EarnedForOrder"), currentOrder.OrderId),
                                DateTime.Now);
                        }


                        if (OrderManager.RewardPointsForPurchases_Canceled == currentOrder.OrderStatus)
                        {
                            var rph = OrderManager.InsertRewardPointsHistory(currentOrder.CustomerId,
                                0, -points, decimal.Zero,
                                decimal.Zero, string.Empty,
                                string.Format(LocalizationManager.GetLocaleResourceString("RewardPoints.Message.ReducedForOrder"), currentOrder.OrderId),
                                DateTime.Now);
                        }
                    }
                }
            }
        }


!!! Don't forget to remove this part from SetOrderStatus() method

and then call it from OrderManager.CheckOrderStatus method:

protected static Order CheckOrderStatus(int orderId)
        {
            var order = OrderManager.GetOrderById(orderId);
            if (order == null)
                return null;

            SetRewardPoints(order); .......
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.