Пример #1
0
        public void ExportProduct(ProductContent product, string deletedVariantCode)
        {
            var configuration = KachingConfiguration.Instance;

            _log.Information("ExportProduct: " + product.Code);

            // Bail if not published
            if (!_publishedStateAssessor.IsPublished(product))
            {
                _log.Information("Skipped product export because it's not yet published");
                return;
            }

            // Since Ka-ching uses tags for category hierachy we need to go
            // up the tree of nodes to find the correct tags for the product
            var tags           = TagsForProduct(product);
            var kachingProduct = _productFactory.BuildKaChingProduct(product, tags, configuration, deletedVariantCode);
            var products       = new List <Product>();

            products.Add(kachingProduct);
            PostKachingProducts(products, _configuration.ProductsImportUrl);
        }