Skip to content

Unable to set custom price when the cache is enabled #6699

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

Closed
arijit-de93 opened this issue Sep 21, 2016 · 5 comments
Closed

Unable to set custom price when the cache is enabled #6699

arijit-de93 opened this issue Sep 21, 2016 · 5 comments

Comments

@arijit-de93
Copy link

I am using Magento 2.1.Cache is enabled in my magento.

I am using catalog_product_collection_load_after event for loading all the products when a category is triggered from the front-end and to set a custom price for the products.

And similarly, catalog_product_collection_load_after event I have used to set a custom price when a particular product will be viewed.

The problem that I am facing is described below:-
1)The above mentioned two events is getting triggered sometimes not all the time.
2)And if it is triggered, I am failing to get the customer id from the session and at the same time not able to set the price.I am using setPrice($customPrice) method for setting.

These above issues does not arise when the cache is disabled.

I will very thankful if you can provide your ideas or a way around about how I can set a custom price for a product when the cache is enabled.

@southerncomputer
Copy link
Contributor

What cache backend are you using? Varnish PLUS REDIS (SESSION/BACKEND) are the only functioning cache backends - built in file/zend based caching is broken!

@arijit-de93
Copy link
Author

@southerncomputer
I am not using any custom caching process. I am using the same Cache process of Magento 2.0.

Thanks

@southerncomputer
Copy link
Contributor

I'd suggest implementing Varnish as a cache, it should reduce the problem points. It is known issue that the built in cache process for Magento 2 is not for production quality and causes pain-points!

See ticket #3572 if you don't believe me!

@veloraven
Copy link
Contributor

@arijit-insync thank you for your feedback.
Please, format this issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result.
Please, also identify which version of Magento you are running.

@veloraven
Copy link
Contributor

According to contributor guide, tickets without response for two weeks should be closed.
If this issue still reproducible please feel free to create the new one: format new issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result and specify Magento version.

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

3 participants