A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
AI OnAI Off
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
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