protected virtual TProduct BaseMap(ProductContent source)
        {
            var imageUrl            = source.CommerceMediaCollection.FirstOrDefault()?.AssetLink.GetUrl();
            var thumbnail           = UrlHelper.GetAsThumbnailUrl(imageUrl);
            var variantQuantity     = GetTotalInventoryByEntry(source.Code);
            var configurableOptions = GetProductConfigurableOptions(source).ToList();

            var productVariations = source.GetVariants();

            var productPrice = PriceService.GetDefaultPrice(source.ContentLink);

            var product = new TProduct
            {
                Id        = source.ContentLink.ID,
                Name      = source.DisplayName,
                UrlKey    = source.RouteSegment,
                UrlPath   = source.SeoUri,
                IsInStock = new VsfStock {
                    IsInStock = true, Quantity = (int)variantQuantity
                },
                Sku             = source.Code,
                TaxClassId      = null,
                MediaGallery    = GetGallery(source),
                Image           = imageUrl ?? "",
                Thumbnail       = thumbnail,
                FinalPrice      = productPrice,
                Price           = productPrice,
                TypeId          = "configurable",
                SpecialPrice    = null,
                NewsFromDate    = null,
                NewsToDate      = null,
                SpecialFromDate = null,
                SpecialToDate   = null,
                CategoryIds     = source.GetCategories().Select(x => x.ID.ToString()),
                Category        = source.GetCategories().Select(x =>
                                                                new CategoryListItem {
                    Id = x.ID, Name = ContentLoaderWrapper.Get <NodeContent>(x).DisplayName
                }),
                Status              = 1,
                Visibility          = source.Status.Equals(VersionStatus.Published) ? 4 : 0,
                Weight              = 1,
                HasOptions          = configurableOptions.Count > 1 ? "1" : "0",
                RequiredOptions     = "0",
                ConfigurableOptions = configurableOptions,
                UpdatedAt           = source.Changed,
                CreatedAt           = source.Created
            };

            product.ConfigurableChildren = productVariations
                                           .Select(v => MapVariant(product, ContentLoaderWrapper.Get <VariationContent>(v))).ToList();
            return(product);
        }
        private static List <string> GetNodes(ProductContent currentContent)
        {
            var nodeList = new List <string>();

            foreach (var nodeRelation in currentContent.GetCategories())
            {
                var currentNode = _contentLoader.Value.Get <NodeContent>(nodeRelation);
                if (currentNode != null)
                {
                    AddParentNodes(currentNode, nodeList);
                }
            }

            return(nodeList);
        }