I changed the name of a Discount Code, now the discount is incorrectly being applied to all orders\sales

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 года назад
Hello,

    I have a rather strange issue that I cannot seem to find a reason or resolution for. I had a 20% discount that I have been successfully using for many months. I needed to change the name of the code, which was easy enough, but after doing so, the discount is being applied to every sale, not just to the customers that it is intended for or that I sent the code to.
This is happening even after I completely deleted all of my discount codes, cleared the cache, restarted the website in the control panel and iis.
As soon as I add a new code for a 20% discount, with any name, that code and discount gets applied to the sale. Even when it is not entered in the coupon code field during checkout, and I am 100% positive that the customer cannot know what the code is. I have queried the database, using the query below, which I found here in the forum,
(https://www.nopcommerce.com/en/boards/topic/55494/discount-code)
SELECT [Id]
      ,[EntityId]
      ,[KeyGroup]
      ,[Key]
      ,[Value]
      ,[StoreId]
  FROM [othoba].[dbo].[GenericAttribute]
  where [Key] like '%DiscountCouponCode%'
"DiscountCouponCode",
the only code it returns is an old code that I have deleted, but it was for a 10% discount, not 20.

I am using 4.2

Any thoughts or suggestions would be greatly appreciated.

Cheers,

DQ
3 года назад
In 4.2 discounts are stored in the Discount table, try:

SELECT * FROM Discount;


What discount plugins do you have installed?  If I had to guess there is likely a discount lingering without any restrictions.  What is the result of this query?


SELECT * FROM Discount d
LEFT JOIN DiscountRequirement dr
ON d.Id = dr.DiscountId;


If it is the standard "Discount must be assigned to customer role" make sure the renamed discount has the appropriate role assigned, and the appropriate customers also have that role assigned to them.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.