Feature Request: ACL on discounts

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 年 前
When a store has a lot of discounts, the cart and checkout processes slow way down. If ACL's could be applied to discounts this would reduce the number of discounts that NopCommerce has to check. I did a custom project awhile back where I made a sort of ACL for discounts and it reduced the number of discounts that NopCommerce had to check per product from about 100 to 1 or 2.
8 年 前
wmwebsites wrote:
When a store has a lot of discounts, the cart and checkout processes slow way down. If ACL's could be applied to discounts this would reduce the number of discounts that NopCommerce has to check. I did a custom project awhile back where I made a sort of ACL for discounts and it reduced the number of discounts that NopCommerce had to check per product from about 100 to 1 or 2.

You can already add a discount requirement to limit the discount by customer role similar to how the ACL system works so how would this be diferent?
8 年 前
The problem that occurs that all discount requirements are still checked even if you use the customer role requirement rule. This change would use linq to pull only discounts the customer qualifies for. My customer had about 250 discounts and about 50 discount groups. What would happen is that every time a product was added to cart, NopCommerce would check every possible discount that could apply to that product and then check all requirements one by one. So maybe 80 discounts would be checked for a single product with those discounts having 2 requirement rules so 160 requirement rules were being checked per product every time the cart page was loaded. This eventually caused runaway memory and the server would crash. Filtering the discounts by ACL before checking requirements fixed the issue. The issue still could occur if you had a lot of discounts that were not affected by ACL but for their situation, all customers would belong to a customer role.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.