Beispiel #1
0
 public ProductAttributesComponent(IProductService productService, IProductModelFactory productModelFactory, IProductVariantService productVariantService, IPriceAccountant priceAccountant, TaxSettings taxSettings)
 {
     _productService        = productService;
     _productModelFactory   = productModelFactory;
     _productVariantService = productVariantService;
     _priceAccountant       = priceAccountant;
     _taxSettings           = taxSettings;
 }
 public ProductModelFactory(IModelMapper modelMapper, IMediaAccountant mediaAccountant, CatalogSettings catalogSettings, IPriceAccountant priceAccountant, TaxSettings taxSettings, IRoundingService roundingService)
 {
     _modelMapper     = modelMapper;
     _mediaAccountant = mediaAccountant;
     _catalogSettings = catalogSettings;
     _priceAccountant = priceAccountant;
     _taxSettings     = taxSettings;
     _roundingService = roundingService;
 }
Beispiel #3
0
 public ProductsController(IProductService productService, ICategoryService categoryService, CatalogSettings catalogSettings, IModelMapper modelMapper, IProductRelationService productRelationService, IProductVariantService productVariantService, IDataSerializer dataSerializer, IPriceAccountant priceAccountant, TaxSettings taxSettings, IReviewService reviewService, GeneralSettings generalSettings, IProductModelFactory productModelFactory, IDownloadService downloadService, IUploadService uploadService, ILocalFileProvider localFileProvider)
 {
     _productService         = productService;
     _categoryService        = categoryService;
     _catalogSettings        = catalogSettings;
     _modelMapper            = modelMapper;
     _productRelationService = productRelationService;
     _productVariantService  = productVariantService;
     _dataSerializer         = dataSerializer;
     _priceAccountant        = priceAccountant;
     _taxSettings            = taxSettings;
     _reviewService          = reviewService;
     _generalSettings        = generalSettings;
     _productModelFactory    = productModelFactory;
     _downloadService        = downloadService;
     _uploadService          = uploadService;
     _localFileProvider      = localFileProvider;
 }
Beispiel #4
0
 public CheckoutController(IPaymentProcessor paymentProcessor, IPaymentAccountant paymentAccountant, IModelMapper modelMapper, IAddressService addressService, ICartService cartService, IDataSerializer dataSerializer, IPluginAccountant pluginAccountant, IOrderService orderService, OrderSettings orderSettings, IRoleService roleService, IUserService userService, IProductService productService, IOrderAccountant orderAccountant, IDownloadService downloadService, ILogger logger, AffiliateSettings affiliateSettings, IStoreCreditService storeCreditService, IPriceAccountant priceAccountant, ICryptographyService cryptographyService)
 {
     _paymentProcessor    = paymentProcessor;
     _paymentAccountant   = paymentAccountant;
     _modelMapper         = modelMapper;
     _addressService      = addressService;
     _cartService         = cartService;
     _dataSerializer      = dataSerializer;
     _pluginAccountant    = pluginAccountant;
     _orderService        = orderService;
     _orderSettings       = orderSettings;
     _roleService         = roleService;
     _userService         = userService;
     _productService      = productService;
     _orderAccountant     = orderAccountant;
     _downloadService     = downloadService;
     _logger              = logger;
     _affiliateSettings   = affiliateSettings;
     _storeCreditService  = storeCreditService;
     _priceAccountant     = priceAccountant;
     _cryptographyService = cryptographyService;
 }
Beispiel #5
0
        protected void Setup()
        {
            _cartService           = Resolve <ICartService>();
            _userService           = Resolve <IUserService>();
            _productService        = Resolve <IProductService>();
            _priceAccountant       = Resolve <IPriceAccountant>();
            _roleService           = Resolve <IRoleService>();
            _discountCouponService = Resolve <IDiscountCouponService>();
            _categoryService       = Resolve <ICategoryService>();
            _vendorService         = Resolve <IVendorService>();
            _manufacturerService   = Resolve <IManufacturerService>();
            _settingService        = Resolve <ISettingService>();
            _taxSettings           = Resolve <TaxSettings>();
            _registeredUser        = new User()
            {
                Email     = "*****@*****.**",
                CreatedOn = DateTime.UtcNow,
                UpdatedOn = DateTime.UtcNow,
            };
            _userService.Insert(_registeredUser);
            _registeredRole = _roleService.FirstOrDefault(x => x.SystemName == SystemRoleNames.Registered);
            _roleService.SetUserRoles(_registeredUser.Id, new [] { _registeredRole.Id }); //registered user
            _registeredUser = _userService.Get(_registeredUser.Id);

            _visitor = new User()
            {
                Email     = "*****@*****.**",
                CreatedOn = DateTime.UtcNow,
                UpdatedOn = DateTime.UtcNow,
            };

            _userService.Insert(_visitor);
            _visitorRole = _roleService.FirstOrDefault(x => x.SystemName == SystemRoleNames.Visitor);
            _roleService.SetUserRoles(_visitor.Id, new[] { _visitorRole.Id }); //visitor user
            _visitor = _userService.Get(_visitor.Id);

            _manufacturer = new Manufacturer()
            {
                Name = "Test Manufacturer"
            };
            _manufacturerService.Insert(_manufacturer);

            _vendor = new Vendor()
            {
                Name    = "Test Vendor",
                Address = "Test Address",
                City    = "Test City"
            };
            _vendorService.Insert(_vendor);

            var products = EvenCart.Tests.Data.Products.GetList();

            _product1 = products[0];
            _product1.ManufacturerId = _manufacturer.Id;
            _productService.Insert(_product1);

            _product2 = products[1];
            _productService.Insert(_product2);
            _vendorService.AddVendorProduct(_vendor.Id, _product2.Id);

            _category = new Category()
            {
                Name = "Test Category"
            };
            _categoryService.Insert(_category);

            _productService.LinkCategoryWithProduct(_category.Id, _product1.Id, 0);



            var discounts = new[]
            {
                new DiscountCoupon()
                {
                    Name                 = "Test Coupon One",
                    CalculationType      = CalculationType.FixedAmount,
                    HasCouponCode        = false,
                    DiscountValue        = 10,
                    Enabled              = true,
                    StartDate            = DateTime.UtcNow,
                    EndDate              = DateTime.UtcNow.AddDays(5),
                    NumberOfTimesPerUser = 1,
                    TotalNumberOfTimes   = 5,
                    RestrictionType      = RestrictionType.OrderTotal
                },
                new DiscountCoupon()
                {
                    Name                 = "Test Coupon Two",
                    CalculationType      = CalculationType.Percentage,
                    CouponCode           = "VALIDCOUPON",
                    HasCouponCode        = true,
                    DiscountValue        = 5,
                    Enabled              = true,
                    StartDate            = DateTime.UtcNow,
                    EndDate              = DateTime.UtcNow.AddDays(5),
                    NumberOfTimesPerUser = 1,
                    TotalNumberOfTimes   = 5
                },
                new DiscountCoupon()
                {
                    Name                  = "Expired Coupon",
                    CalculationType       = CalculationType.Percentage,
                    HasCouponCode         = true,
                    CouponCode            = "EXPIREDCOUPON",
                    DiscountValue         = 5,
                    Enabled               = true,
                    StartDate             = DateTime.UtcNow.AddDays(-5),
                    EndDate               = DateTime.UtcNow.AddDays(-1),
                    NumberOfTimesPerUser  = 1,
                    TotalNumberOfTimes    = 5,
                    MaximumDiscountAmount = 10
                },
            };

            //save some discounts
            _discountCouponService.Insert(discounts);
            _autoCoupon  = discounts[0];
            _validCoupon = discounts[1];
        }