SaaS CMS has officially launched! Learn more now.

How to override price and inventory changes


I tried to follow the documentation from

But it seems quite out of date, as IndexContentsIfNeeded is no longer makred as virtual.

Can anyone provide me some sample pls?

Thanks in advance

Apr 02, 2016 16:55

For anyone who had the similiar issues, I finally got solution (Note: you need to upgrade to EPi.Find.Commerce 9.5.2+).  

        protected override void IndexContentsIfNeeded(IEnumerable<ContentReference> contentLinks, 
            IDictionary<Type, bool> cachedReindexContentOnEventForType, 
            Func<bool> isReindexingContentOnUpdates)
            var contents = _contentRepository.GetItems(contentLinks, CultureInfo.InvariantCulture).ToList();
            var parentContentLinks = new List<ContentReference>();
            foreach (var parents in contents.OfType<VariationContent>().Select(content => _contentRepository
                .GetItems(content.GetParentProducts(_relationRepository), CultureInfo.InvariantCulture).Select(c => c.ContentLink).ToList()))
            IndexContentsIfNeeded(parentContentLinks, GetIndexContentAction());
May 10, 2016 15:09
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.