Exemple #1
0
        private IEntity GetEntity(CatalogEntryDto.CatalogEntryRow entry, ESalesVariantHelper variantHelper, string language,
                                  IEnumerable <Attribute> attributes)
        {
            var keyValue = _keyLookup.Value(entry, language);

            if (variantHelper.IsVariant(entry.CatalogEntryId))
            {
                var productKey = _keyLookup.Value(_catalogSystem.GetCatalogEntry(variantHelper.GetParentProduct(entry.CatalogEntryId)), language);
                return(new Variant(keyValue, productKey, attributes));
            }
            return(new Product(keyValue, attributes));
        }
        private void IndexEntry(CatalogEntryDto.CatalogEntryRow entry, string[] languages, CatalogDto.CatalogRow catalog,
                                ESalesVariantHelper variantHelper)
        {
            if (variantHelper.IsVariant(entry.CatalogEntryId))
            {
                Add(entry, languages, catalog, variantHelper);
            }
            else
            {
                UpdateProduct(entry, languages, catalog, variantHelper);
            }

            ReportAddProgress();
        }