private static void IndexProductVariant(IProductVariant productVariant) { var cache = new VirtualProductContentCache(); cache.ClearVirtualCache(productVariant.ProductKey); ProductIndexer.ReIndexNode(productVariant.SerializeToXml().Root, IndexTypes.ProductVariant); }
private static void DeleteProductVariantFromIndex(IProductVariant productVariant) { var cache = new VirtualProductContentCache(); cache.ClearVirtualCache(productVariant.ProductKey); ProductIndexer.DeleteFromIndex(((ProductVariant)productVariant).ExamineId.ToString(CultureInfo.InvariantCulture)); }
/// <summary> /// Removes a product with all of its variants from the index /// </summary> static void ProductServiceDeleted(IProductService sender, DeleteEventArgs <IProduct> e) { var cache = new VirtualProductContentCache(); cache.ClearVirtualCache(e); e.DeletedEntities.ForEach(DeleteProductFromIndex); }
/// <summary> /// Adds or updates a product with all of its variants to the index /// </summary> static void ProductServiceSaved(IProductService sender, SaveEventArgs <IProduct> e) { var cache = new VirtualProductContentCache(); cache.ClearVirtualCache(e); e.SavedEntities.ForEach(IndexProduct); }
/// <summary> /// Removes a product with all of its variants from the index /// </summary> static void ProductServiceDeleted(IProductService sender, DeleteEventArgs <IProduct> e) { var cache = new VirtualProductContentCache(); cache.ClearVirtualCache(e); foreach (var eDeletedEntity in e.DeletedEntities) { DeleteProductFromIndex(eDeletedEntity); } }
/// <summary> /// Adds or updates a product with all of its variants to the index /// </summary> static void ProductServiceSaved(IProductService sender, SaveEventArgs <IProduct> e) { var cache = new VirtualProductContentCache(); cache.ClearVirtualCache(e); foreach (var eSavedEntity in e.SavedEntities) { IndexProduct(eSavedEntity); } }
/// <summary> /// The product option repository re index. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The product keys. /// </param> /// <remarks> /// REFACTOR v3 /// </remarks> private void ProductOptionRepositoryReIndex(ProductOptionRepository sender, Core.Events.ObjectEventArgs <IEnumerable <Guid> > e) { var keys = e.EventObject; if (MerchelloContext.HasCurrent) { var products = MerchelloContext.Current.Services.ProductService.GetByKeys(keys).ToArray(); var contentCache = new VirtualProductContentCache(); foreach (var p in products) { IndexProduct(p); // we also need to refresh the published product cache contentCache.ClearVirtualCache(p); } } }
/// <summary> /// Adds or updates a product with all of its variants to the index /// </summary> static void ProductServiceSaved(IProductService sender, SaveEventArgs<IProduct> e) { var cache = new VirtualProductContentCache(); cache.ClearVirtualCache(e); e.SavedEntities.ForEach(IndexProduct); }
/// <summary> /// Removes a product with all of its variants from the index /// </summary> static void ProductServiceDeleted(IProductService sender, DeleteEventArgs<IProduct> e) { var cache = new VirtualProductContentCache(); cache.ClearVirtualCache(e); e.DeletedEntities.ForEach(DeleteProductFromIndex); }