Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

How to override price and inventory changes

Vote:
 

I tried to follow the documentation from http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Commerce/9/Search/find-integration/indexing-variations-in-a-product-document/

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

#146997
Apr 02, 2016 16:55
Vote:
 

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()))
            {
                parentContentLinks.AddRange(parents);
            }
            IndexContentsIfNeeded(parentContentLinks, GetIndexContentAction());
        }
#148342
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.