Ejemplo n.º 1
0
        private void AddListPriceToSellableItem(Product sourceProduct, CommerceEntity destinationProduct)
        {
            if (sourceProduct.ListPriceCurrency == null)
            {
                return;
            }

            var pricePolicy = destinationProduct.GetPolicy <Commerce.Plugin.Pricing.ListPricingPolicy>();

            pricePolicy.RemovePrice(new Money(sourceProduct.ListPriceCurrency, sourceProduct.ListPrice));
            pricePolicy.AddPrice(new Money(sourceProduct.ListPriceCurrency, sourceProduct.ListPrice));

            Log($"{sourceProduct.Id} price has been set");
        }