public override object Map(object source, object target, Type sourceType, Type targetType, string prefix, MappingContext context)
        {
            var model = base.Map(source, target, sourceType, targetType, prefix, context) as ProductVariant;
            var variant = source as Kooboo.Commerce.Products.ProductVariant;

            // Final price
            var shoppingContext = new Kooboo.Commerce.Carts.ShoppingContext
            {
                Culture = context.ApiContext.Culture.Name
            };

            if (!context.ApiContext.Customer.IsGuest())
            {
                var service = new Kooboo.Commerce.Customers.CustomerService(context.ApiContext.Instance);
                var customer = service.FindByEmail(context.ApiContext.Customer.Email);
                if (customer != null)
                {
                    shoppingContext.CustomerId = customer.Id;
                }
            }

            model.FinalPrice = variant.GetFinalPrice(shoppingContext);

            return model;
        }
        public override object Map(object source, object target, Type sourceType, Type targetType, string prefix, MappingContext context)
        {
            var model   = base.Map(source, target, sourceType, targetType, prefix, context) as ProductVariant;
            var variant = source as Kooboo.Commerce.Products.ProductVariant;

            // Final price
            var shoppingContext = new Kooboo.Commerce.Carts.ShoppingContext
            {
                Culture = context.ApiContext.Culture.Name
            };

            if (!context.ApiContext.Customer.IsGuest())
            {
                var service  = new Kooboo.Commerce.Customers.CustomerService(context.ApiContext.Instance);
                var customer = service.FindByEmail(context.ApiContext.Customer.Email);
                if (customer != null)
                {
                    shoppingContext.CustomerId = customer.Id;
                }
            }

            model.FinalPrice = variant.GetFinalPrice(shoppingContext);

            return(model);
        }