Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discount requirement #7178

Closed
mhmd7776 opened this issue May 8, 2024 · 5 comments
Closed

Discount requirement #7178

mhmd7776 opened this issue May 8, 2024 · 5 comments

Comments

@mhmd7776
Copy link

mhmd7776 commented May 8, 2024

nopCommerce version: 4.70

Steps to reproduce the problem:
Discount requirement does not save and display correctly.

@AndreiMaz
Copy link
Member

@mhmd7776 What exactly discount requirement are you testing? It works fine on our demo website - https://admin-demo.nopcommerce.com/

@mhmd7776
Copy link
Author

mhmd7776 commented May 8, 2024

@AndreiMaz
For example (Must be assigned to customer role)
I created a sample discount in demo site like this

1

when i select discount requirement type on (Must be assigned to customer role) and choose vendors option, it say (Discount requirement saved) and every thing must be fine but the selected requirement is empty and actually not saved.

2

@mhmd7776
Copy link
Author

mhmd7776 commented May 8, 2024

@AndreiMaz
I checked the problem further.
The discount requirement is saved correctly, but it is not displayed because it's cached.
We have to clear the cache manually every time

@danFbach
Copy link
Contributor

Do you have prices cached in Catalog Settings?
image

I can confirm that having this enabled with Customer Role based discount rules that the prices become inaccurate. As stated in the hint - "Check to cache product prices. It can significantly improve performance. But you not should enable it if you use some complex discounts, discount requirement rules, or coupon codes." @AndreiMaz (this text should probably be rewritten as it contains typos.) maybe to "Check to cache product prices. It can significantly improve performance, but you should not enable it if you use some complex discounts, discount requirement rules, or coupon codes."

I personally live with the occasionally wrong prices because my site becomes really slow with it disabled and then have my Cache clearing task set to run hourly to try and mitigate it better.
I have many compounding factors. Lots of grouped products, so when a category page is loaded, it is loading sometimes 200+ product prices to get the grouped product "From" price.

I started refactoring the Pricing cache service so that the cache key included any applied discounts ids, and if someone has a coupon applied to their cart then just ignore the cache and load prices fresh, but never finished the work.

@skoshelev
Copy link
Contributor

Hi @mhmd7776. By default, the discount edit page does not apply any caching to requirements. I can't reproduce the problem either locally or on the demo site. Perhaps you have some kind of plugin that changes the caching behavior or have made some custom edits to the code

@AndreiMaz AndreiMaz closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants