Don't miss out Virtual Happy Hour this Friday (April 26).
Try our conversational search powered by Generative AI!
AI OnAI Off
Don't miss out Virtual Happy Hour this Friday (April 26).
Hi,
You can hook into catalog events.
http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Commerce/8/Content/catalog-events/
http://world.episerver.com/blogs/K-Khan-/Dates/2015/5/hook-into-catalog-events/
In theory this should work var contenEventHandler = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance<EPiServer.Core.IContentEvents>(); contenEventHandler.SavingContent += contenEventHandler_SavingContent; void contenEventHandler_SavingContent(object sender, ContentEventArgs e) { //your conditions and actions e.CancelAction = true; }
Regards
/K
Thanks Khan,
The idea is to prevent saving a product and show the client a error msg if the assets list is empty, or some other condition in assets.
I will try the eventHandler...
Juan
Hi
Is it posible to every time I create a Product its MUST have a assets (Mandatory), like a picture?
Juan