Coupon used only ONCE per user?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 years ago
I would like to adjust the coupon so that it may only be used once per user.
Currently a coupn code can be repeatedly used by one user on as many transactions as they wish.
Generally when you recieve a coupon (in the real world) you may only use it once.
I would like to offer promotional discounts to my customers but this factor is holding me back.
Is there a way with the existing nopCommerce (any version) of acheiving this?
If not is there a tweak/hack to reslove this issue?
Thanks
CAWPublishing.co.uk/
14 years ago
I actually registered to ask the same thing, can anyone please assist with this?

Thanks!
14 years ago
This option will be available in the next release
14 years ago
This may be of a little help:
https://www.nopcommerce.com/Boards/Topic.aspx?TopicID=912

It doesn't deactivate a coupon code, but it does remove it from the DB if the customer returns after a while.  May be a short term solution, may not.
14 years ago
When is this new release coming and what will it have in it please?
14 years ago
Next release will be published in March. Currently, I cannot disclosure too much, but briefly, it'll include almost everything that general ecommerce site should have
14 years ago
If you are using 1.40 and cannot wait for the next release, you can put this piece of code in
CustomerManager.cs > ResetCheckoutData (after line 461 - if (ClearCouponCode) - and before the line customer = ApplyCouponCode(customer.CustomerID, string.Empty);)

This will make sure that coupon codes that start with 1- are deleted once they are used the first time.
You can offcourse change the string that the coupon should start with by changing the value in the code below.


//Added feb 2010 - make single use coupons possible

                     if (customer.LastAppliedCouponCode.StartsWith("1-"))
                     {
                         Promo.Discounts.Discount currentdiscount = null;
                         foreach (Promo.Discounts.Discount discount in Promo.Discounts.DiscountManager.GetAllDiscounts(Promo.Discounts.DiscountTypeEnum.AssignedToSKUs))
                         {
                             if (customer.LastAppliedCouponCode == discount.CouponCode)
                             {
                                 currentdiscount = discount;
                                 break;
                             }
                         }

                         if (currentdiscount == null)
                         {
                            foreach (Promo.Discounts.Discount discount in Promo.Discounts.DiscountManager.GetAllDiscounts(Promo.Discounts.DiscountTypeEnum.AssignedToWholeOrder))
                             {
                                 if (customer.LastAppliedCouponCode == discount.CouponCode)
                                 {
                                     currentdiscount = discount;
                                     break;
                                 }
                             }
                         }

                         if (currentdiscount == null)
                         {
                             Promo.Discounts.DiscountManager.MarkDiscountAsDeleted(currentdiscount.DiscountID);
                         }
                     }

                    //End added feb 2010
5 years ago
Hi,

I'm using nopcommerce 3.8 and have an issue with discounts.
I created a discount with the limitation of N time per costumer= 1 but if my customer checkout as gest he can use the coupon code as much as he wants. How can I fix it?

Thanks,
Moran
5 years ago
RE: "checkout as guest he can use the coupon code as much as he wants"

I think preventing that will require customization.  You would need some criteria to match the guest's order with something from another order - e.g. billing or shipping address.

(P.S.  Please don't duplicate topics)
5 years ago
The problem is that the coupon code approved before the customer enters his address. so i might need to use some other identification.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.