public GoogleCheckoutPaymentProcessor(ISettingService settingService,
                                       IWebHelper webHelper, ITaxService taxService,
                                       IShippingService shippingService,
                                       IOrderTotalCalculationService orderTotalCalculationService,
                                       IProductAttributeFormatter productAttributeFormatter,
                                       IPriceCalculationService priceCalculationService,
                                       IWorkContext workContext,
                                       IStoreContext storeContext,
                                       ICustomerService customerService,
                                       IGenericAttributeService genericAttributeService,
                                       ICountryService countryService,
                                       IStateProvinceService stateProvinceService,
                                       IOrderProcessingService orderProcessingService,
                                       IOrderService orderService,
                                       ILogger logger,
                                       HttpContextBase httpContext)
 {
     this._settingService  = settingService;
     this._webHelper       = webHelper;
     this._taxService      = taxService;
     this._shippingService = shippingService;
     this._orderTotalCalculationService = orderTotalCalculationService;
     this._productAttributeFormatter    = productAttributeFormatter;
     this._priceCalculationService      = priceCalculationService;
     this._workContext             = workContext;
     this._storeContext            = storeContext;
     this._customerService         = customerService;
     this._genericAttributeService = genericAttributeService;
     this._countryService          = countryService;
     this._stateProvinceService    = stateProvinceService;
     this._orderProcessingService  = orderProcessingService;
     this._orderService            = orderService;
     this._logger      = logger;
     this._httpContext = httpContext;
 }
Пример #2
0
 public RssFeedService(IWebHelper webHelper
                       , IWorkContext workContext
                       , RssFeedSetting rssFeedSettings
                       , CurrencySettings currencySettings
                       , ISettingService settingService
                       , ICurrencyService currencyService
                       , ILanguageService languageService
                       , ICustomerService customerService
                       , IPriceCalculationService priceCalculationService
                       , IRepository <ProductVariant> productVariantRepository
                       , ITaxService taxService
                       , ICategoryService categoryService
                       , IPictureService pictureService
                       , ILogger logger)
 {
     _webHelper                = webHelper;
     _workContext              = workContext;
     _settingService           = settingService;
     _rssFeedSettings          = rssFeedSettings;
     _currencyService          = currencyService;
     _priceCalculationService  = priceCalculationService;
     _languageService          = languageService;
     _productVariantRepository = productVariantRepository;
     _categoryService          = categoryService;
     _taxService               = taxService;
     _pictureService           = pictureService;
     _currencySettings         = currencySettings;
     _customerService          = customerService;
     _logger = logger;
 }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="workContext">Work context</param>
 /// <param name="storeContext">Store context</param>
 /// <param name="priceCalculationService">Price calculation service</param>
 /// <param name="taxService">Tax service</param>
 /// <param name="shippingService">Shipping service</param>
 /// <param name="paymentService">Payment service</param>
 /// <param name="checkoutAttributeParser">Checkout attribute parser</param>
 /// <param name="discountService">Discount service</param>
 /// <param name="giftCardService">Gift card service</param>
 /// <param name="genericAttributeService">Generic attribute service</param>
 /// <param name="taxSettings">Tax settings</param>
 /// <param name="rewardPointsSettings">Reward points settings</param>
 /// <param name="shippingSettings">Shipping settings</param>
 /// <param name="shoppingCartSettings">Shopping cart settings</param>
 /// <param name="catalogSettings">Catalog settings</param>
 public OrderTotalCalculationService(IWorkContext workContext,
     IStoreContext storeContext,
     IPriceCalculationService priceCalculationService,
     ITaxService taxService,
     IShippingService shippingService,
     IPaymentService paymentService,
     ICheckoutAttributeParser checkoutAttributeParser,
     IDiscountService discountService,
     IGiftCardService giftCardService,
     IGenericAttributeService genericAttributeService,
     TaxSettings taxSettings,
     RewardPointsSettings rewardPointsSettings,
     ShippingSettings shippingSettings,
     ShoppingCartSettings shoppingCartSettings,
     CatalogSettings catalogSettings)
 {
     this._workContext = workContext;
     this._storeContext = storeContext;
     this._priceCalculationService = priceCalculationService;
     this._taxService = taxService;
     this._shippingService = shippingService;
     this._paymentService = paymentService;
     this._checkoutAttributeParser = checkoutAttributeParser;
     this._discountService = discountService;
     this._giftCardService = giftCardService;
     this._genericAttributeService = genericAttributeService;
     this._taxSettings = taxSettings;
     this._rewardPointsSettings = rewardPointsSettings;
     this._shippingSettings = shippingSettings;
     this._shoppingCartSettings = shoppingCartSettings;
     this._catalogSettings = catalogSettings;
 }
 public StripeConnectPaymentProcessor(ILocalizationService localizationService,
                                      IWebHelper webHelper,
                                      ISettingService settingService,
                                      StripeConnectObjectContext stripeConnectObjectContext,
                                      IChargeService chargeService,
                                      IWorkContext workContext,
                                      IStoreContext storeContext,
                                      IPriceCalculationService priceCalculationService,
                                      ILogger logger,
                                      IVendorService vendorService,
                                      ICustomerService customerService,
                                      IRefundService refundService)
 {
     _localizationservice        = localizationService;
     _webhelper                  = webHelper;
     _settingService             = settingService;
     _stripeConnectObjectContext = stripeConnectObjectContext;
     _chargeService              = chargeService;
     _workContext                = workContext;
     _storeContext               = storeContext;
     _priceCalculationService    = priceCalculationService;
     _logger          = logger;
     _vendorService   = vendorService;
     _customerService = customerService;
     _refundService   = refundService;
 }
 public DHLComputationMethod(IMeasureService measureService,
                             IShippingService shippingService,
                             ISettingService settingService,
                             DHLSettings dhlSettings,
                             DHLObjectContext objectContext,
                             IDHLService dhlService,
                             IStoreContext storeContext,
                             IPriceCalculationService priceCalculationService,
                             ILogger logger,
                             ICurrencyService currencyService,
                             IOrderTotalCalculationService orderTotalCalculationService,
                             IWorkContext workContext
                             )
 {
     this._measureService          = measureService;
     this._shippingService         = shippingService;
     this._settingService          = settingService;
     this._dhlSettings             = dhlSettings;
     this._objectContext           = objectContext;
     this._storeContext            = storeContext;
     this._priceCalculationService = priceCalculationService;
     this._logger          = logger;
     this._dhlService      = dhlService;
     this._currencyService = currencyService;
     this._orderTotalCalculationService = orderTotalCalculationService;
     this._workContext = workContext;
 }
        public new void SetUp()
        {
			_store = new Store() { Id = 1 };
			_storeContext = MockRepository.GenerateMock<IStoreContext>();
			_storeContext.Expect(x => x.CurrentStore).Return(_store);

            _discountService = MockRepository.GenerateMock<IDiscountService>();

            _categoryService = MockRepository.GenerateMock<ICategoryService>();

            _productAttributeParser = MockRepository.GenerateMock<IProductAttributeParser>();
			_productService = MockRepository.GenerateMock<IProductService>();
			_productAttributeService = MockRepository.GenerateMock<IProductAttributeService>();

			_downloadService = MockRepository.GenerateMock<IDownloadService>();
			_commonServices = MockRepository.GenerateMock<ICommonServices>();
			_commonServices.Expect(x => x.StoreContext).Return(_storeContext);
			_httpRequestBase = MockRepository.GenerateMock<HttpRequestBase>();
			_taxService = MockRepository.GenerateMock<ITaxService>();

            _shoppingCartSettings = new ShoppingCartSettings();
            _catalogSettings = new CatalogSettings();

			_priceCalcService = new PriceCalculationService(_discountService, _categoryService, _productAttributeParser, _productService, _shoppingCartSettings, _catalogSettings,
				_productAttributeService, _downloadService, _commonServices, _httpRequestBase, _taxService);
        }
 public GetProductDetailsAttributeChangeHandler(
     IMediator mediator,
     IProductAttributeParser productAttributeParser,
     IPermissionService permissionService,
     IPriceCalculationService priceCalculationService,
     IBackInStockSubscriptionService backInStockSubscriptionService,
     ITaxService taxService,
     ICurrencyService currencyService,
     IPriceFormatter priceFormatter,
     ILocalizationService localizationService,
     IPictureService pictureService,
     ShoppingCartSettings shoppingCartSettings,
     MediaSettings mediaSettings)
 {
     _mediator = mediator;
     _productAttributeParser         = productAttributeParser;
     _permissionService              = permissionService;
     _priceCalculationService        = priceCalculationService;
     _backInStockSubscriptionService = backInStockSubscriptionService;
     _taxService           = taxService;
     _currencyService      = currencyService;
     _priceFormatter       = priceFormatter;
     _localizationService  = localizationService;
     _pictureService       = pictureService;
     _shoppingCartSettings = shoppingCartSettings;
     _mediaSettings        = mediaSettings;
 }
Пример #8
0
 public GetWishlistHandler(
     IPermissionService permissionService,
     IShoppingCartService shoppingCartService,
     IProductService productService,
     IProductAttributeParser productAttributeParser,
     IProductAttributeFormatter productAttributeFormatter,
     ILocalizationService localizationService,
     ITaxService taxService,
     IPriceCalculationService priceCalculationService,
     ICurrencyService currencyService,
     IPriceFormatter priceFormatter,
     ICacheManager cacheManager,
     IPictureService pictureService,
     ShoppingCartSettings shoppingCartSettings,
     CatalogSettings catalogSettings,
     MediaSettings mediaSettings)
 {
     _permissionService         = permissionService;
     _shoppingCartService       = shoppingCartService;
     _productService            = productService;
     _productAttributeParser    = productAttributeParser;
     _productAttributeFormatter = productAttributeFormatter;
     _localizationService       = localizationService;
     _taxService = taxService;
     _priceCalculationService = priceCalculationService;
     _currencyService         = currencyService;
     _priceFormatter          = priceFormatter;
     _cacheManager            = cacheManager;
     _pictureService          = pictureService;
     _shoppingCartSettings    = shoppingCartSettings;
     _catalogSettings         = catalogSettings;
     _mediaSettings           = mediaSettings;
 }
Пример #9
0
 public ProductAttributeFormatter(
     SmartDbContext db,
     IWorkContext workContext,
     IWebHelper webHelper,
     IProductAttributeMaterializer productAttributeMaterializer,
     IPriceFormatter priceFormatter,
     ITaxService taxService,
     ICurrencyService currencyService,
     ILocalizationService localizationService,
     IPriceCalculationService priceCalculationService,
     ShoppingCartSettings shoppingCartSettings,
     CatalogSettings catalogSettings)
 {
     _db          = db;
     _workContext = workContext;
     _webHelper   = webHelper;
     _productAttributeMaterializer = productAttributeMaterializer;
     _priceFormatter          = priceFormatter;
     _taxService              = taxService;
     _currencyService         = currencyService;
     _localizationService     = localizationService;
     _priceCalculationService = priceCalculationService;
     _shoppingCartSettings    = shoppingCartSettings;
     _catalogSettings         = catalogSettings;
 }
Пример #10
0
 public ProductAttributeFormatter(IWorkContext workContext,
                                  IProductAttributeService productAttributeService,
                                  IProductAttributeParser productAttributeParser,
                                  ICurrencyService currencyService,
                                  ILocalizationService localizationService,
                                  ITaxService taxService,
                                  IPriceFormatter priceFormatter,
                                  IDownloadService downloadService,
                                  IWebHelper webHelper,
                                  IPriceCalculationService priceCalculationService,
                                  ILanguageService languageService,
                                  ILocalizedEntityService localizedEntityService,
                                  ISettingService settingService)
 {
     this._workContext             = workContext;
     this._productAttributeService = productAttributeService;
     this._productAttributeParser  = productAttributeParser;
     this._currencyService         = currencyService;
     this._localizationService     = localizationService;
     this._taxService              = taxService;
     this._priceFormatter          = priceFormatter;
     this._downloadService         = downloadService;
     this._webHelper               = webHelper;
     this._priceCalculationService = priceCalculationService;
     this._languageService         = languageService;
     this._localizedEntityService  = localizedEntityService;
     this._settingService          = settingService;
     this._shoppingCartSettings    = _settingService.LoadSetting <ShoppingCartSettings>();
 }
Пример #11
0
 public ShoppingCartController(ICustomerService customerService,
                               IDateTimeHelper dateTimeHelper, IPriceFormatter priceFormatter,
                               IStoreService storeService, ITaxService taxService,
                               IPriceCalculationService priceCalculationService,
                               IPermissionService permissionService, ILocalizationService localizationService,
                               AdminAreaSettings adminAreaSettings,
                               IPictureService pictureService,
                               IProductAttributeFormatter productAttributeFormatter,
                               IShoppingCartService shoppingCartService,
                               IDiscountService discountService)
 {
     this._customerService           = customerService;
     this._dateTimeHelper            = dateTimeHelper;
     this._priceFormatter            = priceFormatter;
     this._storeService              = storeService;
     this._taxService                = taxService;
     this._priceCalculationService   = priceCalculationService;
     this._permissionService         = permissionService;
     this._localizationService       = localizationService;
     this._adminAreaSettings         = adminAreaSettings;
     this._pictureService            = pictureService;
     this._productAttributeFormatter = productAttributeFormatter;
     this._shoppingCartService       = shoppingCartService;
     this._discountService           = discountService;
 }
 public MiscFacebookShopController(IAclService aclService,
                                   ICacheManager cacheManager,
                                   CatalogSettings catalogSettings,
                                   ICategoryService categoryService,
                                   ICurrencyService currencyService,
                                   ILocalizationService localizationService,
                                   IPermissionService permissionService,
                                   IPictureService pictureService,
                                   IPriceCalculationService priceCalculationService,
                                   IPriceFormatter priceFormatter,
                                   IProductService productService,
                                   IStoreContext storeContext,
                                   IStoreMappingService storeMappingService,
                                   ITaxService taxService,
                                   IWorkContext workContext)
 {
     this._aclService              = aclService;
     this._cacheManager            = cacheManager;
     this._catalogSettings         = catalogSettings;
     this._categoryService         = categoryService;
     this._currencyService         = currencyService;
     this._localizationService     = localizationService;
     this._permissionService       = permissionService;
     this._pictureService          = pictureService;
     this._priceCalculationService = priceCalculationService;
     this._priceFormatter          = priceFormatter;
     this._productService          = productService;
     this._storeContext            = storeContext;
     this._storeMappingService     = storeMappingService;
     this._taxService              = taxService;
     this._workContext             = workContext;
 }
Пример #13
0
 public FroogleService(IGoogleService googleService,
     IPriceCalculationService priceCalculationService,
     ITaxService taxService, 
     IProductService productService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IPictureService pictureService,
     ICurrencyService currencyService,
     ILanguageService languageService,
     ISettingService settingService,
     IWorkContext workContext,
     IMeasureService measureService,
     MeasureSettings measureSettings,
     FroogleSettings froogleSettings,
     CurrencySettings currencySettings,
     GoogleProductObjectContext objectContext)
 {
     this._googleService = googleService;
     this._priceCalculationService = priceCalculationService;
     this._taxService = taxService;
     this._productService = productService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._pictureService = pictureService;
     this._currencyService = currencyService;
     this._languageService = languageService;
     this._settingService = settingService;
     this._workContext = workContext;
     this._measureService = measureService;
     this._measureSettings = measureSettings;
     this._froogleSettings = froogleSettings;
     this._currencySettings = currencySettings;
     this._objectContext = objectContext;
 }
Пример #14
0
 public PriceCalculator(IPriceCalculationService priceCalculationService, IMarketRatesService marketRatesService,
                        IConfigurationService configurationService)
 {
     this.priceCalculationService = priceCalculationService;
     this.marketRatesService      = marketRatesService;
     this.configurationService    = configurationService;
 }
 public FroogleService(IGoogleService googleService,
                       IPriceCalculationService priceCalculationService,
                       ITaxService taxService,
                       IProductService productService,
                       ICategoryService categoryService,
                       IManufacturerService manufacturerService,
                       IPictureService pictureService,
                       ICurrencyService currencyService,
                       ILanguageService languageService,
                       ISettingService settingService,
                       IWorkContext workContext,
                       IMeasureService measureService,
                       MeasureSettings measureSettings,
                       FroogleSettings froogleSettings,
                       CurrencySettings currencySettings,
                       GoogleProductObjectContext objectContext)
 {
     this._googleService           = googleService;
     this._priceCalculationService = priceCalculationService;
     this._taxService          = taxService;
     this._productService      = productService;
     this._categoryService     = categoryService;
     this._manufacturerService = manufacturerService;
     this._pictureService      = pictureService;
     this._currencyService     = currencyService;
     this._languageService     = languageService;
     this._settingService      = settingService;
     this._workContext         = workContext;
     this._measureService      = measureService;
     this._measureSettings     = measureSettings;
     this._froogleSettings     = froogleSettings;
     this._currencySettings    = currencySettings;
     this._objectContext       = objectContext;
 }
 public GetMiniShoppingCartHandler(
     IShoppingCartService shoppingCartService,
     IOrderTotalCalculationService orderTotalCalculationService,
     IPriceFormatter priceFormatter,
     ITaxService taxService,
     ICheckoutAttributeService checkoutAttributeService,
     IProductService productService,
     IProductAttributeFormatter productAttributeFormatter,
     IProductAttributeParser productAttributeParser,
     ILocalizationService localizationService,
     IPriceCalculationService priceCalculationService,
     IPictureService pictureService,
     IMediator mediator,
     ShoppingCartSettings shoppingCartSettings,
     OrderSettings orderSettings,
     TaxSettings taxSettings,
     MediaSettings mediaSettings)
 {
     _shoppingCartService          = shoppingCartService;
     _orderTotalCalculationService = orderTotalCalculationService;
     _priceFormatter            = priceFormatter;
     _taxService                = taxService;
     _checkoutAttributeService  = checkoutAttributeService;
     _productService            = productService;
     _productAttributeFormatter = productAttributeFormatter;
     _productAttributeParser    = productAttributeParser;
     _localizationService       = localizationService;
     _priceCalculationService   = priceCalculationService;
     _pictureService            = pictureService;
     _mediator             = mediator;
     _shoppingCartSettings = shoppingCartSettings;
     _orderSettings        = orderSettings;
     _taxSettings          = taxSettings;
     _mediaSettings        = mediaSettings;
 }
        public new void SetUp()
        {
            _workContext = null;

            _store = new Store() { Id = 1 };
            _storeContext = MockRepository.GenerateMock<IStoreContext>();
            _storeContext.Expect(x => x.CurrentStore).Return(_store);

            _discountService = MockRepository.GenerateMock<IDiscountService>();
            _categoryService = MockRepository.GenerateMock<ICategoryService>();
            _productService = MockRepository.GenerateMock<IProductService>();


            _productAttributeParser = MockRepository.GenerateMock<IProductAttributeParser>();

            _shoppingCartSettings = new ShoppingCartSettings();
            _catalogSettings = new CatalogSettings();

            _cacheManager = new NopNullCache();

            _priceCalcService = new PriceCalculationService(_workContext,
                _storeContext, 
                _discountService,
                _categoryService,
                _productAttributeParser,
                _productService,
                _cacheManager,
                _shoppingCartSettings, 
                _catalogSettings);
        }
        //private readonly IStoreContext _storeContext;
        //private readonly IDiscountService _discountService;
        //private readonly ICategoryService _categoryService;
        //private readonly IProductAttributeParser _productAttributeParser;
        //private readonly IProductService _productService;
        //private readonly ICacheManager _cacheManager;
        //private readonly ShoppingCartSettings _shoppingCartSettings;
        //private readonly CatalogSettings _catalogSettings;

        #endregion

        #region constructor

        public PromosPriceCalculationService(
            IPromoUtilities promoUtilities,
            IWorkContext workContext,
            IStoreContext storeContext,
            IDiscountService discountService,
            ICategoryService categoryService,
            IManufacturerService manufacturerService,
            IProductAttributeParser productAttributeParser,
            IProductService productService,
            ICacheManager cacheManager,
            ShoppingCartSettings shoppingCartSettings,
            CatalogSettings catalogSettings,
            PromoSettings promoSettings,
            ICurrencyService currencyService,
            IPriceCalculationService priceCalculationService,
            ILocalizationService localizationService,
            ILogger logger)
            : base (workContext, storeContext, discountService,
                    categoryService, manufacturerService, productAttributeParser,
                    productService, cacheManager, shoppingCartSettings,
                    catalogSettings)
        {
            this._promoUtilities = promoUtilities;
            this._promoSettings = promoSettings;
            this._workContext = workContext;
            this._currencyService = currencyService;
            this._priceCalculationService = priceCalculationService;
            this._localizationService = localizationService;
            this._logger = logger;
        }
Пример #19
0
        public IsamOrderService(
            ISettingService settingService,
            IEncryptionService encryptionService,
            IBaseService baseIsamService,
            IProductAttributeParser productAttributeParser,
            IAttributeUtilities attributeUtilities,
            IRepository <ShopAbc> shopAbcRepository,
            IRepository <CustomerShopMapping> customerShopMappingRepository,
            IRepository <WarrantySku> warrantySkuRepository,
            IRepository <ProductAbcDescription> productAbcDescriptionRepository,
            IRepository <GiftCardUsageHistory> giftCardUsageHistoryRepository,
            IStoreContext storeContext,
            IWorkContext workContext,
            IGiftCardService giftCardService,
            ExportOrderSettings settings,
            ILogger logger,
            IOrderService orderService,
            IPriceCalculationService priceCalculationService,
            IAddressService addressService,
            IProductService productService,
            IStateProvinceService stateProvinceService,
            ICountryService countryService,
            IUrlRecordService urlRecordService,
            IProductAttributeService productAttributeService,
            IRepository <Product> productRepository,
            ICustomShopService customShopService,
            IIsamGiftCardService isamGiftCardService,
            IYahooService yahooService
            )
        {
            _settingService                  = settingService;
            _encryptionService               = encryptionService;
            _baseIsamService                 = baseIsamService;
            _productAttributeParser          = productAttributeParser;
            _attributeUtilities              = attributeUtilities;
            _shopAbcRepository               = shopAbcRepository;
            _customerShopMappingRepository   = customerShopMappingRepository;
            _warrantySkuRepository           = warrantySkuRepository;
            _productAbcDescriptionRepository = productAbcDescriptionRepository;
            _giftCardUsageHistoryRepository  = giftCardUsageHistoryRepository;
            _storeContext            = storeContext;
            _workContext             = workContext;
            _giftCardService         = giftCardService;
            _settings                = settings;
            _logger                  = logger;
            _orderService            = orderService;
            _priceCalculationService = priceCalculationService;
            _addressService          = addressService;
            _productService          = productService;
            _stateProvinceService    = stateProvinceService;
            _countryService          = countryService;
            _urlRecordService        = urlRecordService;
            _productAttributeService = productAttributeService;
            _productRepository       = productRepository;
            _customShopService       = customShopService;
            _isamGiftCardService     = isamGiftCardService;
            _yahooService            = yahooService;

            InitializeAllColParams();
        }
Пример #20
0
 public ShoppingCartModelFactory(CatalogSettings catalogSettings,
                                 IBaseAdminModelFactory baseAdminModelFactory,
                                 ICountryService countryService,
                                 ICustomerService customerService,
                                 IDateTimeHelper dateTimeHelper,
                                 ILocalizationService localizationService,
                                 IPriceCalculationService priceCalculationService,
                                 IPriceFormatter priceFormatter,
                                 IProductAttributeFormatter productAttributeFormatter,
                                 IShoppingCartService shoppingCartService,
                                 IStoreService storeService,
                                 ITaxService taxService)
 {
     _catalogSettings           = catalogSettings;
     _baseAdminModelFactory     = baseAdminModelFactory;
     _countryService            = countryService;
     _customerService           = customerService;
     _dateTimeHelper            = dateTimeHelper;
     _localizationService       = localizationService;
     _priceCalculationService   = priceCalculationService;
     _priceFormatter            = priceFormatter;
     _productAttributeFormatter = productAttributeFormatter;
     _shoppingCartService       = shoppingCartService;
     _storeService = storeService;
     _taxService   = taxService;
 }
Пример #21
0
 protected CartItemMapperBase(
     SmartDbContext db,
     ICommonServices services,
     ITaxService taxService,
     ICurrencyService currencyService,
     IPriceCalculationService priceCalculationService,
     IProductAttributeFormatter productAttributeFormatter,
     IProductAttributeMaterializer productAttributeMaterializer,
     IShoppingCartValidator shoppingCartValidator,
     ShoppingCartSettings shoppingCartSettings,
     CatalogSettings catalogSettings,
     MediaSettings mediaSettings,
     ProductUrlHelper productUrlHelper,
     Localizer t)
 {
     _db                           = db;
     _services                     = services;
     _taxService                   = taxService;
     _currencyService              = currencyService;
     _priceCalculationService      = priceCalculationService;
     _productAttributeFormatter    = productAttributeFormatter;
     _productAttributeMaterializer = productAttributeMaterializer;
     _shoppingCartValidator        = shoppingCartValidator;
     _shoppingCartSettings         = shoppingCartSettings;
     _catalogSettings              = catalogSettings;
     _mediaSettings                = mediaSettings;
     _productUrlHelper             = productUrlHelper;
     T = t;
 }
Пример #22
0
 public MobileAPIPlugin(IPriceCalculationService priceCalculationService,
                        ITaxService taxService,
                        IProductService productService,
                        ICategoryService categoryService,
                        IManufacturerService manufacturerService,
                        IPictureService pictureService,
                        ICurrencyService currencyService,
                        ILanguageService languageService,
                        ISettingService settingService,
                        IWorkContext workContext,
                        IMeasureService measureService,
                        MeasureSettings measureSettings,
                        MobileAPISettings mobileAPISettings,
                        CurrencySettings currencySettings)
 {
     this._priceCalculationService = priceCalculationService;
     this._taxService          = taxService;
     this._productService      = productService;
     this._categoryService     = categoryService;
     this._manufacturerService = manufacturerService;
     this._pictureService      = pictureService;
     this._currencyService     = currencyService;
     this._languageService     = languageService;
     this._settingService      = settingService;
     this._workContext         = workContext;
     this._measureService      = measureService;
     this._measureSettings     = measureSettings;
     this._mobileAPISettings   = mobileAPISettings;
     this._currencySettings    = currencySettings;
 }
Пример #23
0
        public new void SetUp()
        {
            _workContext = null;

            _store = new Store {
                Id = 1
            };
            _storeContext = MockRepository.GenerateMock <IStoreContext>();
            _storeContext.Expect(x => x.CurrentStore).Return(_store);

            _discountService     = MockRepository.GenerateMock <IDiscountService>();
            _categoryService     = MockRepository.GenerateMock <ICategoryService>();
            _manufacturerService = MockRepository.GenerateMock <IManufacturerService>();
            _productService      = MockRepository.GenerateMock <IProductService>();


            _productAttributeParser = MockRepository.GenerateMock <IProductAttributeParser>();

            _shoppingCartSettings = new ShoppingCartSettings();
            _catalogSettings      = new CatalogSettings();

            _cacheManager = new NopNullCache();

            _priceCalcService = new PriceCalculationService(_workContext,
                                                            _storeContext,
                                                            _discountService,
                                                            _categoryService,
                                                            _manufacturerService,
                                                            _productAttributeParser,
                                                            _productService,
                                                            _cacheManager,
                                                            _shoppingCartSettings,
                                                            _catalogSettings);
        }
 public MiscFacebookShopController(IAclService aclService,
     ICacheManager cacheManager,
     CatalogSettings catalogSettings,
     ICategoryService categoryService,
     ICurrencyService currencyService,
     ILocalizationService localizationService,
     IPermissionService permissionService,
     IPictureService pictureService,
     IPriceCalculationService priceCalculationService,
     IPriceFormatter priceFormatter,
     IProductService productService,
     IStoreContext storeContext,
     IStoreMappingService storeMappingService,
     ITaxService taxService,
     IWorkContext workContext)
 {
     this._aclService = aclService;
     this._cacheManager = cacheManager;
     this._catalogSettings = catalogSettings;
     this._categoryService = categoryService;
     this._currencyService = currencyService;
     this._localizationService = localizationService;
     this._permissionService = permissionService;
     this._pictureService = pictureService;
     this._priceCalculationService = priceCalculationService;
     this._priceFormatter = priceFormatter;
     this._productService = productService;
     this._storeContext = storeContext;
     this._storeMappingService = storeMappingService;
     this._taxService = taxService;
     this._workContext = workContext;
 }
Пример #25
0
        public new void SetUp()
        {
            _serviceProvider = new TestServiceProvider();
            _store           = new Store {
                Id = 1
            };
            _storeContext = new Mock <IStoreContext>();
            _storeContext.Setup(x => x.CurrentStore).Returns(_store);

            _categoryService     = new Mock <ICategoryService>();
            _manufacturerService = new Mock <IManufacturerService>();
            _productService      = TestProductService.Init();

            _productAttributeParser = new Mock <IProductAttributeParser>();

            _shoppingCartSettings = new ShoppingCartSettings();
            _catalogSettings      = new CatalogSettings();

            _cacheManager = new TestCacheManager();
            _workContext  = new Mock <IWorkContext>();

            _discountService = TestDiscountService.Init();

            _priceCalcService = new PriceCalculationService(_catalogSettings, new CurrencySettings {
                PrimaryStoreCurrencyId = 1
            }, _categoryService.Object,
                                                            _serviceProvider.CurrencyService.Object, _discountService, _manufacturerService.Object, _productAttributeParser.Object,
                                                            _productService, _cacheManager, _storeContext.Object, _workContext.Object, _shoppingCartSettings);

            var nopEngine = new Mock <QNetEngine>();

            nopEngine.Setup(x => x.ServiceProvider).Returns(_serviceProvider);
            EngineContext.Replace(nopEngine.Object);
        }
Пример #26
0
		public GoogleService(
			IRepository<GoogleProductRecord> gpRepository,
			IProductService productService,
			IManufacturerService manufacturerService,
			IStoreService storeService,
			ICategoryService categoryService,
			FroogleSettings settings,
			IMeasureService measureService,
			MeasureSettings measureSettings,
			IPriceCalculationService priceCalculationService,
			IWorkContext workContext)
        {
            _gpRepository = gpRepository;
			_productService = productService;
			_manufacturerService = manufacturerService;
			_storeService = storeService;
			_categoryService = categoryService;
			Settings = settings;
			_measureService = measureService;
			_measureSettings = measureSettings;
			_priceCalculationService = priceCalculationService;
			_workContext = workContext;

			_helper = new PluginHelperFeed("PromotionFeed.Froogle", "SmartStore.Plugin.Feed.Froogle", () =>
			{
				return Settings as PromotionFeedSettings;
			});
        }
Пример #27
0
 public KlarnaCheckoutHelper(
     IWorkContext workContext,
     IStoreContext storeContext,
     IOrderTotalCalculationService orderTotalCalculationService,
     ILocalizationService localizationService,
     IProductAttributeParser productAttributeParser,
     ITaxService taxService,
     IPriceCalculationService priceCalculationService,
     ICurrencyService currencyService,
     IGenericAttributeService genericAttributeService,
     ICheckoutAttributeParser checkoutAttributeParser,
     KlarnaCheckoutSettings klarnaSettings
     )
 {
     _workContext  = workContext;
     _storeContext = storeContext;
     _orderTotalCalculationService = orderTotalCalculationService;
     _localizationService          = localizationService;
     _productAttributeParser       = productAttributeParser;
     _taxService = taxService;
     _priceCalculationService = priceCalculationService;
     _currencyService         = currencyService;
     _genericAttributeService = genericAttributeService;
     _checkoutAttributeParser = checkoutAttributeParser;
     _klarnaSettings          = klarnaSettings;
 }
Пример #28
0
 public MiniShoppingCartModelMapper(
     SmartDbContext db,
     ICommonServices services,
     IProductService productService,
     IMediaService mediaService,
     ICurrencyService currencyService,
     IPriceCalculationService priceCalculationService,
     IOrderCalculationService orderCalculationService,
     IProductAttributeFormatter productAttributeFormatter,
     ICheckoutAttributeMaterializer checkoutAttributeMaterializer,
     ProductUrlHelper productUrlHelper,
     ShoppingCartSettings shoppingCartSettings,
     CatalogSettings catalogSettings,
     MediaSettings mediaSettings,
     OrderSettings orderSettings)
 {
     _db                            = db;
     _services                      = services;
     _productService                = productService;
     _priceCalculationService       = priceCalculationService;
     _mediaService                  = mediaService;
     _currencyService               = currencyService;
     _orderCalculationService       = orderCalculationService;
     _productAttributeFormatter     = productAttributeFormatter;
     _checkoutAttributeMaterializer = checkoutAttributeMaterializer;
     _productUrlHelper              = productUrlHelper;
     _shoppingCartSettings          = shoppingCartSettings;
     _catalogSettings               = catalogSettings;
     _mediaSettings                 = mediaSettings;
     _orderSettings                 = orderSettings;
 }
Пример #29
0
 public ProductAttributeFormatter(IWorkContext workContext,
                                  IProductAttributeService productAttributeService,
                                  IProductAttributeParser productAttributeParser,
                                  ICurrencyService currencyService,
                                  ILocalizationService localizationService,
                                  ITaxService taxService,
                                  IPriceFormatter priceFormatter,
                                  IDownloadService downloadService,
                                  IWebHelper webHelper,
                                  IPriceCalculationService priceCalculationService,
                                  IProductService productService,
                                  ShoppingCartSettings shoppingCartSettings)
 {
     _workContext             = workContext;
     _productAttributeService = productAttributeService;
     _productAttributeParser  = productAttributeParser;
     _currencyService         = currencyService;
     _localizationService     = localizationService;
     _taxService              = taxService;
     _priceFormatter          = priceFormatter;
     _downloadService         = downloadService;
     _webHelper               = webHelper;
     _priceCalculationService = priceCalculationService;
     _productService          = productService;
     _shoppingCartSettings    = shoppingCartSettings;
 }
 public GetAddToCartHandler(
     IProductAttributeFormatter productAttributeFormatter,
     ILocalizationService localizationService,
     ITaxService taxService,
     IPriceCalculationService priceCalculationService,
     ICurrencyService currencyService,
     IPriceFormatter priceFormatter,
     IShoppingCartService shoppingCartService,
     ICacheBase cacheManager,
     IOrderTotalCalculationService orderTotalCalculationService,
     IPictureService pictureService,
     IProductService productService,
     IProductAttributeParser productAttributeParser,
     IAuctionService auctionService,
     ShoppingCartSettings shoppingCartSettings,
     TaxSettings taxSettings,
     MediaSettings mediaSettings)
 {
     _productAttributeFormatter = productAttributeFormatter;
     _localizationService       = localizationService;
     _taxService = taxService;
     _priceCalculationService = priceCalculationService;
     _currencyService         = currencyService;
     _priceFormatter          = priceFormatter;
     _shoppingCartService     = shoppingCartService;
     _cacheBase = cacheManager;
     _orderTotalCalculationService = orderTotalCalculationService;
     _pictureService         = pictureService;
     _productService         = productService;
     _productAttributeParser = productAttributeParser;
     _auctionService         = auctionService;
     _shoppingCartSettings   = shoppingCartSettings;
     _taxSettings            = taxSettings;
     _mediaSettings          = mediaSettings;
 }
 public FakeShoppingCartService(CatalogSettings catalogSettings = null,
                                IAclService aclService          = null,
                                IActionContextAccessor actionContextAccessor       = null,
                                ICacheKeyService cacheKeyService                   = null,
                                ICheckoutAttributeParser checkoutAttributeParser   = null,
                                ICheckoutAttributeService checkoutAttributeService = null,
                                ICurrencyService currencyService                   = null,
                                ICustomerService customerService                   = null,
                                IDateRangeService dateRangeService                 = null,
                                IDateTimeHelper dateTimeHelper = null,
                                IEventPublisher eventPublisher = null,
                                IGenericAttributeService genericAttributeService = null,
                                ILocalizationService localizationService         = null,
                                IPermissionService permissionService             = null,
                                IPriceCalculationService priceCalculationService = null,
                                IPriceFormatter priceFormatter = null,
                                IProductAttributeParser productAttributeParser   = null,
                                IProductAttributeService productAttributeService = null,
                                IProductService productService = null,
                                IRepository <ShoppingCartItem> sciRepository = null,
                                IShippingService shippingService             = null,
                                IStaticCacheManager staticCacheManager       = null,
                                IStoreContext storeContext = null,
                                IStoreMappingService storeMappingService = null,
                                IUrlHelperFactory urlHelperFactory       = null,
                                IUrlRecordService urlRecordService       = null,
                                IWorkContext workContext    = null,
                                OrderSettings orderSettings = null,
                                ShoppingCartSettings shoppingCartSettings = null) : base(
         catalogSettings ?? new CatalogSettings(),
         aclService ?? new Mock <IAclService>().Object,
         actionContextAccessor ?? new Mock <IActionContextAccessor>().Object,
         cacheKeyService ?? new FakeCacheKeyService(),
         checkoutAttributeParser ?? new Mock <ICheckoutAttributeParser>().Object,
         checkoutAttributeService ?? new Mock <ICheckoutAttributeService>().Object,
         currencyService ?? new Mock <ICurrencyService>().Object,
         customerService ?? new Mock <ICustomerService>().Object,
         dateRangeService ?? new Mock <IDateRangeService>().Object,
         dateTimeHelper ?? new Mock <IDateTimeHelper>().Object,
         eventPublisher ?? new Mock <IEventPublisher>().Object,
         genericAttributeService ?? new Mock <IGenericAttributeService>().Object,
         localizationService ?? new Mock <ILocalizationService>().Object,
         permissionService ?? new Mock <IPermissionService>().Object,
         priceCalculationService ?? new Mock <IPriceCalculationService>().Object,
         priceFormatter ?? new Mock <IPriceFormatter>().Object,
         productAttributeParser ?? new Mock <IProductAttributeParser>().Object,
         productAttributeService ?? new Mock <IProductAttributeService>().Object,
         productService ?? new Mock <IProductService>().Object,
         sciRepository.FakeRepoNullPropagation(),
         shippingService ?? new Mock <IShippingService>().Object,
         staticCacheManager ?? new TestCacheManager(),
         storeContext ?? new Mock <IStoreContext>().Object,
         storeMappingService ?? new Mock <IStoreMappingService>().Object,
         urlHelperFactory ?? new Mock <IUrlHelperFactory>().Object,
         urlRecordService ?? new Mock <IUrlRecordService>().Object,
         workContext ?? new Mock <IWorkContext>().Object,
         orderSettings ?? new OrderSettings(),
         shoppingCartSettings ?? new ShoppingCartSettings())
 {
 }
Пример #32
0
        public new void SetUp()
        {
            _store = new Store()
            {
                Id = 1
            };
            _storeContext = MockRepository.GenerateMock <IStoreContext>();
            _storeContext.Expect(x => x.CurrentStore).Return(_store);

            _discountService = MockRepository.GenerateMock <IDiscountService>();

            _categoryService = MockRepository.GenerateMock <ICategoryService>();

            _productAttributeParser  = MockRepository.GenerateMock <IProductAttributeParser>();
            _productService          = MockRepository.GenerateMock <IProductService>();
            _productAttributeService = MockRepository.GenerateMock <IProductAttributeService>();

            _downloadService = MockRepository.GenerateMock <IDownloadService>();
            _services        = MockRepository.GenerateMock <ICommonServices>();
            _services.Expect(x => x.StoreContext).Return(_storeContext);
            _httpRequestBase = MockRepository.GenerateMock <HttpRequestBase>();
            _taxService      = MockRepository.GenerateMock <ITaxService>();

            _shoppingCartSettings = new ShoppingCartSettings();
            _catalogSettings      = new CatalogSettings();

            _priceCalcService = new PriceCalculationService(_discountService, _categoryService, _productAttributeParser, _productService, _shoppingCartSettings, _catalogSettings,
                                                            _productAttributeService, _downloadService, _services, _httpRequestBase, _taxService);
        }
Пример #33
0
 public GetProductOverviewHandler(
     IPermissionService permissionService,
     IWorkContext workContext,
     IStoreContext storeContext,
     ILocalizationService localizationService,
     IProductService productService,
     IPriceCalculationService priceCalculationService,
     ITaxService taxService,
     ICurrencyService currencyService,
     IPriceFormatter priceFormatter,
     IPictureService pictureService,
     IDateTimeHelper dateTimeHelper,
     IMediator mediator,
     MediaSettings mediaSettings,
     CatalogSettings catalogSettings)
 {
     _permissionService       = permissionService;
     _workContext             = workContext;
     _storeContext            = storeContext;
     _localizationService     = localizationService;
     _productService          = productService;
     _priceCalculationService = priceCalculationService;
     _taxService      = taxService;
     _currencyService = currencyService;
     _priceFormatter  = priceFormatter;
     _pictureService  = pictureService;
     _dateTimeHelper  = dateTimeHelper;
     _mediator        = mediator;
     _mediaSettings   = mediaSettings;
     _catalogSettings = catalogSettings;
 }
Пример #34
0
 public CustomOrderProcessingService(
     IPluginFinder pluginFinder,
     IOrderService orderService, IWebHelper webHelper, ILocalizationService localizationService,
     ILanguageService languageService, IProductService productService, IPaymentService paymentService,
     ILogger logger, IOrderTotalCalculationService orderTotalCalculationService,
     IPriceCalculationService priceCalculationService, IPriceFormatter priceFormatter,
     IProductAttributeParser productAttributeParser, IProductAttributeFormatter productAttributeFormatter,
     IGiftCardService giftCardService, IShoppingCartService shoppingCartService,
     ICheckoutAttributeFormatter checkoutAttributeFormatter, IShippingService shippingService,
     IShipmentService shipmentService, ITaxService taxService, ICustomerService customerService,
     IDiscountService discountService, IEncryptionService encryptionService, IWorkContext workContext,
     IWorkflowMessageService workflowMessageService, IVendorService vendorService,
     ICustomerActivityService customerActivityService, ICurrencyService currencyService,
     IAffiliateService affiliateService, IEventPublisher eventPublisher, IPdfService pdfService,
     IRewardPointService rewardPointService, IGenericAttributeService genericAttributeService,
     ICountryService countryService, ShippingSettings shippingSettings, PaymentSettings paymentSettings,
     RewardPointsSettings rewardPointsSettings, OrderSettings orderSettings, TaxSettings taxSettings,
     LocalizationSettings localizationSettings, CurrencySettings currencySettings) :
     base(orderService, webHelper, localizationService, languageService, productService, paymentService, logger,
          orderTotalCalculationService, priceCalculationService, priceFormatter, productAttributeParser,
          productAttributeFormatter, giftCardService, shoppingCartService, checkoutAttributeFormatter,
          shippingService, shipmentService, taxService, customerService, discountService, encryptionService,
          workContext, workflowMessageService, vendorService, customerActivityService, currencyService,
          affiliateService, eventPublisher, pdfService, rewardPointService, genericAttributeService, countryService,
          shippingSettings, paymentSettings, rewardPointsSettings, orderSettings, taxSettings, localizationSettings, currencySettings)
 {
     _pluginFinder = pluginFinder;
 }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="workContext">Work context</param>
 /// <param name="storeContext">Store context</param>
 /// <param name="priceCalculationService">Price calculation service</param>
 /// <param name="taxService">Tax service</param>
 /// <param name="shippingService">Shipping service</param>
 /// <param name="paymentService">Payment service</param>
 /// <param name="checkoutAttributeParser">Checkout attribute parser</param>
 /// <param name="discountService">Discount service</param>
 /// <param name="giftCardService">Gift card service</param>
 /// <param name="genericAttributeService">Generic attribute service</param>
 /// <param name="taxSettings">Tax settings</param>
 /// <param name="rewardPointsSettings">Reward points settings</param>
 /// <param name="shippingSettings">Shipping settings</param>
 /// <param name="shoppingCartSettings">Shopping cart settings</param>
 /// <param name="catalogSettings">Catalog settings</param>
 public OrderTotalCalculationService(IWorkContext workContext,
                                     IStoreContext storeContext,
                                     IPriceCalculationService priceCalculationService,
                                     ITaxService taxService,
                                     IShippingService shippingService,
                                     IPaymentService paymentService,
                                     ICheckoutAttributeParser checkoutAttributeParser,
                                     IDiscountService discountService,
                                     IGiftCardService giftCardService,
                                     IGenericAttributeService genericAttributeService,
                                     TaxSettings taxSettings,
                                     RewardPointsSettings rewardPointsSettings,
                                     ShippingSettings shippingSettings,
                                     ShoppingCartSettings shoppingCartSettings,
                                     CatalogSettings catalogSettings)
 {
     this._workContext             = workContext;
     this._storeContext            = storeContext;
     this._priceCalculationService = priceCalculationService;
     this._taxService              = taxService;
     this._shippingService         = shippingService;
     this._paymentService          = paymentService;
     this._checkoutAttributeParser = checkoutAttributeParser;
     this._discountService         = discountService;
     this._giftCardService         = giftCardService;
     this._genericAttributeService = genericAttributeService;
     this._taxSettings             = taxSettings;
     this._rewardPointsSettings    = rewardPointsSettings;
     this._shippingSettings        = shippingSettings;
     this._shoppingCartSettings    = shoppingCartSettings;
     this._catalogSettings         = catalogSettings;
 }
 public OrderItemsController(IJsonFieldsSerializer jsonFieldsSerializer,
                             IAclService aclService,
                             ICustomerService customerService,
                             IStoreMappingService storeMappingService,
                             IStoreService storeService,
                             IDiscountService discountService,
                             ICustomerActivityService customerActivityService,
                             ILocalizationService localizationService,
                             IOrderItemApiService orderItemApiService,
                             IOrderApiService orderApiService,
                             IOrderService orderService,
                             IProductApiService productApiService,
                             IPriceCalculationService priceCalculationService,
                             ITaxService taxService,
                             IPictureService pictureService,
                             IDTOHelper dtoHelper)
     : base(jsonFieldsSerializer,
            aclService,
            customerService,
            storeMappingService,
            storeService,
            discountService,
            customerActivityService,
            localizationService,
            pictureService)
 {
     _orderItemApiService     = orderItemApiService;
     _orderApiService         = orderApiService;
     _orderService            = orderService;
     _productApiService       = productApiService;
     _priceCalculationService = priceCalculationService;
     _taxService = taxService;
     _dtoHelper  = dtoHelper;
 }
Пример #37
0
        /// <summary>
        /// Gets the base price info
        /// </summary>
        /// <param name="product">Product</param>
        /// <param name="localizationService">Localization service</param>
        /// <param name="priceFormatter">Price formatter</param>
        /// <param name="currencyService">Currency service</param>
        /// <param name="taxService">Tax service</param>
        /// <param name="priceCalculationService">Price calculation service</param>
        /// <param name="customer">Customer</param>
        /// <param name="currency">Target currency</param>
        /// <param name="priceAdjustment">Price adjustment</param>
        /// <returns>The base price info</returns>
        public static string GetBasePriceInfo(this Product product,
                                              ILocalizationService localizationService,
                                              IPriceFormatter priceFormatter,
                                              ICurrencyService currencyService,
                                              ITaxService taxService,
                                              IPriceCalculationService priceCalculationService,
                                              Customer customer,
                                              Currency currency,
                                              decimal priceAdjustment = decimal.Zero)
        {
            Guard.NotNull(product, nameof(product));
            Guard.NotNull(currencyService, nameof(currencyService));
            Guard.NotNull(taxService, nameof(taxService));
            Guard.NotNull(priceCalculationService, nameof(priceCalculationService));
            Guard.NotNull(customer, nameof(customer));
            Guard.NotNull(currency, nameof(currency));

            if (product.BasePriceHasValue && product.BasePriceAmount != decimal.Zero)
            {
                var currentPrice = priceCalculationService.GetFinalPrice(product, customer, true);
                var price        = taxService.GetProductPrice(product, decimal.Add(currentPrice, priceAdjustment), customer, currency, out var taxrate);
                price = currencyService.ConvertFromPrimaryStoreCurrency(price, currency);

                return(product.GetBasePriceInfo(price, localizationService, priceFormatter, currency));
            }

            return(string.Empty);
        }
 public GoogleCheckoutPaymentProcessor(ISettingService settingService, 
     IWebHelper webHelper, ITaxService taxService,
     IShippingService shippingService, 
     IOrderTotalCalculationService orderTotalCalculationService,
     IProductAttributeFormatter productAttributeFormatter,
     IPriceCalculationService priceCalculationService, IWorkContext workContext,
     ICustomerService customerService, IGenericAttributeService genericAttributeService, 
     ICountryService countryService,
     IStateProvinceService stateProvinceService, IOrderProcessingService orderProcessingService,
     IOrderService orderService, ILogger logger, HttpContextBase httpContext)
 {
     this._settingService = settingService;
     this._webHelper = webHelper;
     this._taxService = taxService;
     this._shippingService = shippingService;
     this._orderTotalCalculationService = orderTotalCalculationService;
     this._productAttributeFormatter = productAttributeFormatter;
     this._priceCalculationService = priceCalculationService;
     this._workContext = workContext;
     this._customerService = customerService;
     this._genericAttributeService = genericAttributeService;
     this._countryService = countryService;
     this._stateProvinceService = stateProvinceService;
     this._orderProcessingService = orderProcessingService;
     this._orderService = orderService;
     this._logger = logger;
     this._httpContext = httpContext;
 }
Пример #39
0
        public ProductController(
			ICommonServices services,
			IManufacturerService manufacturerService,
			IProductService productService,
			IProductAttributeService productAttributeService,
			IProductAttributeParser productAttributeParser,
			ITaxService taxService,
			ICurrencyService currencyService,
			IPictureService pictureService,
			IPriceCalculationService priceCalculationService, 
			IPriceFormatter priceFormatter,
			ICustomerContentService customerContentService, 
			ICustomerService customerService,
			IShoppingCartService shoppingCartService,
			IRecentlyViewedProductsService recentlyViewedProductsService, 
			IWorkflowMessageService workflowMessageService, 
			IProductTagService productTagService,
			IOrderReportService orderReportService,
			IBackInStockSubscriptionService backInStockSubscriptionService, 
			IAclService aclService,
			IStoreMappingService storeMappingService,
			MediaSettings mediaSettings, 
			CatalogSettings catalogSettings,
			ShoppingCartSettings shoppingCartSettings,
			LocalizationSettings localizationSettings, 
			CaptchaSettings captchaSettings,
			CatalogHelper helper,
            IDownloadService downloadService,
            ILocalizationService localizationService)
        {
            this._services = services;
            this._manufacturerService = manufacturerService;
            this._productService = productService;
            this._productAttributeService = productAttributeService;
            this._productAttributeParser = productAttributeParser;
            this._taxService = taxService;
            this._currencyService = currencyService;
            this._pictureService = pictureService;
            this._priceCalculationService = priceCalculationService;
            this._priceFormatter = priceFormatter;
            this._customerContentService = customerContentService;
            this._customerService = customerService;
            this._shoppingCartService = shoppingCartService;
            this._recentlyViewedProductsService = recentlyViewedProductsService;
            this._workflowMessageService = workflowMessageService;
            this._productTagService = productTagService;
            this._orderReportService = orderReportService;
            this._backInStockSubscriptionService = backInStockSubscriptionService;
            this._aclService = aclService;
            this._storeMappingService = storeMappingService;
            this._mediaSettings = mediaSettings;
            this._catalogSettings = catalogSettings;
            this._shoppingCartSettings = shoppingCartSettings;
            this._localizationSettings = localizationSettings;
            this._captchaSettings = captchaSettings;
            this._helper = helper;
            this._downloadService = downloadService;
            this._localizationService = localizationService;
        }
		public HadSpentAmountRule(
            IOrderService orderService,
            IPriceCalculationService priceCalculationService,
            ITaxService taxService)
        {
			this._orderService = orderService;
            this._priceCalculationService = priceCalculationService;
            this._taxService = taxService;
        }
Пример #41
0
 public promoService(
     IProductService productService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IPictureService pictureService,
     ICurrencyService currencyService,
     ISettingService settingService,
     IWorkContext workContext,
     IMeasureService measureService,
     MeasureSettings measureSettings,
     CurrencySettings currencySettings,
     IProductAttributeService productAttributeService,
     IPriceCalculationService priceCalculationService,
     ITaxService taxService,
     ILogger logger,
     IStoreService storeService,
     IPromoUtilities promoUtilities,
     PromoSettings promoSettings,
     IShippingService shippingService,
     IGenericAttributeService genericAttributeService,
     IStoreContext storeContext,
     IProductMappingService productMappingService,
     IShoppingCartService shoppingCartService,
     ICouponService qixolPromosCouponService,
     IAttributeValueService attributeValueService,
     IOrderService orderService,
     ICustomerService customerService,
     ILocalizationService localizationService)
 {
     this._productService = productService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._pictureService = pictureService;
     this._currencyService = currencyService;
     this._settingService = settingService;
     this._workContext = workContext;
     this._measureService = measureService;
     this._measureSettings = measureSettings;
     this._currencySettings = currencySettings;
     this._productAttributeService = productAttributeService;
     this._priceCalculationService = priceCalculationService;
     this._taxService = taxService;
     this._logger = logger;
     this._promoUtilities = promoUtilities;
     this._storeService = storeService;
     this._shippingService = shippingService;
     this._genericAttributeService = genericAttributeService;
     this._storeContext = storeContext;
     this._productMappingService = productMappingService;
     this._shoppingCartService = shoppingCartService;
     this._couponService = qixolPromosCouponService;
     this._attributeValueService = attributeValueService;
     this._orderService = orderService;
     this._promoSettings = promoSettings;
     this._customerService = customerService;
     this._localizationService = localizationService;
 }
Пример #42
0
        public ShoppingCartController(IProductService productService, IWorkContext workContext,
            IShoppingCartService shoppingCartService, IPictureService pictureService,
            ILocalizationService localizationService, IProductAttributeFormatter productAttributeFormatter,
            ITaxService taxService, ICurrencyService currencyService, 
            IPriceCalculationService priceCalculationService, IPriceFormatter priceFormatter,
            ICheckoutAttributeParser checkoutAttributeParser, ICheckoutAttributeFormatter checkoutAttributeFormatter, 
            IOrderProcessingService orderProcessingService,
            IDiscountService discountService,ICustomerService customerService, 
            IGiftCardService giftCardService, ICountryService countryService,
            IStateProvinceService stateProvinceService, IShippingService shippingService, 
            IOrderTotalCalculationService orderTotalCalculationService,
            ICheckoutAttributeService checkoutAttributeService, IPaymentService paymentService,
            IWorkflowMessageService workflowMessageService,
            IPermissionService permissionService, 
            IDownloadService downloadService,
            MediaSettings mediaSetting, ShoppingCartSettings shoppingCartSettings,
            CatalogSettings catalogSettings, OrderSettings orderSettings,
            ShippingSettings shippingSettings, TaxSettings taxSettings,
            CaptchaSettings captchaSettings)
        {
            this._productService = productService;
            this._workContext = workContext;
            this._shoppingCartService = shoppingCartService;
            this._pictureService = pictureService;
            this._localizationService = localizationService;
            this._productAttributeFormatter = productAttributeFormatter;
            this._taxService = taxService;
            this._currencyService = currencyService;
            this._priceCalculationService = priceCalculationService;
            this._priceFormatter = priceFormatter;
            this._checkoutAttributeParser = checkoutAttributeParser;
            this._checkoutAttributeFormatter = checkoutAttributeFormatter;
            this._orderProcessingService = orderProcessingService;
            this._discountService = discountService;
            this._customerService = customerService;
            this._giftCardService = giftCardService;
            this._countryService = countryService;
            this._stateProvinceService = stateProvinceService;
            this._shippingService = shippingService;
            this._orderTotalCalculationService = orderTotalCalculationService;
            this._checkoutAttributeService = checkoutAttributeService;
            this._paymentService = paymentService;
            this._workflowMessageService = workflowMessageService;
            this._permissionService = permissionService;
            this._downloadService = downloadService;

            this._mediaSetting = mediaSetting;
            this._shoppingCartSettings = shoppingCartSettings;
            this._catalogSettings = catalogSettings;
            this._orderSettings = orderSettings;
            this._shippingSettings = shippingSettings;
            this._taxSettings = taxSettings;
            this._captchaSettings = captchaSettings;
        }
		public HadSpentAmountDiscountRequirementRule(
            ILocalizationService localizationService, 
            IOrderService orderService,
            IPriceCalculationService priceCalculationService,
            ITaxService taxService)
        {
            this._localizationService = localizationService;
			this._orderService = orderService;
            this._priceCalculationService = priceCalculationService;
            this._taxService = taxService;
        }
Пример #44
0
 public ShoppingCartController(ICustomerService customerService,
     IDateTimeHelper dateTimeHelper, IPriceFormatter priceFormatter,
     ITaxService taxService, IPriceCalculationService priceCalculationService,
     IPermissionService permissionService)
 {
     this._customerService = customerService;
     this._dateTimeHelper = dateTimeHelper;
     this._priceFormatter = priceFormatter;
     this._taxService = taxService;
     this._priceCalculationService = priceCalculationService;
     this._permissionService = permissionService;
 }
 public USPSComputationMethod(IMeasureService measureService,
     IShippingService shippingService, ISettingService settingService,
     USPSSettings uspsSettings, MeasureSettings measureSettings,
     IPriceCalculationService priceCalculationService)
 {
     this._measureService = measureService;
     this._shippingService = shippingService;
     this._settingService = settingService;
     this._uspsSettings = uspsSettings;
     this._measureSettings = measureSettings;
     this._priceCalculationService = priceCalculationService;
 }
 public ByWeightShippingComputationMethod(IShippingService shippingService,
     IShippingByWeightService shippingByWeightService,
     IPriceCalculationService priceCalculationService, 
     ShippingByWeightSettings shippingByWeightSettings,
     ShippingByWeightObjectContext objectContext)
 {
     this._shippingService = shippingService;
     this._shippingByWeightService = shippingByWeightService;
     this._priceCalculationService = priceCalculationService;
     this._shippingByWeightSettings = shippingByWeightSettings;
     this._objectContext = objectContext;
 }
 public PayPalDirectPaymentProcessor(PayPalDirectPaymentSettings paypalDirectPaymentSettings,
     ISettingService settingService,
     ITaxService taxService, IPriceCalculationService priceCalculationService,
     ICurrencyService currencyService,
     CurrencySettings currencySettings, IWebHelper webHelper,
     StoreInformationSettings storeInformationSettings)
 {
     this._paypalDirectPaymentSettings = paypalDirectPaymentSettings;
     this._settingService = settingService;
     this._taxService = taxService;
     this._priceCalculationService = priceCalculationService;
     this._currencyService = currencyService;
     this._currencySettings = currencySettings;
     this._webHelper = webHelper;
     this._storeInformationSettings = storeInformationSettings;
 }
 public ByWeightShippingComputationMethod(IShippingService shippingService,
     IStoreContext storeContext,
     IShippingByWeightService shippingByWeightService,
     IPriceCalculationService priceCalculationService, 
     ShippingByWeightSettings shippingByWeightSettings,
     //ShippingByWeightObjectContext objectContext,
     ISettingService settingService)
 {
     this._shippingService = shippingService;
     this._storeContext = storeContext;
     this._shippingByWeightService = shippingByWeightService;
     this._priceCalculationService = priceCalculationService;
     this._shippingByWeightSettings = shippingByWeightSettings;
     //this._objectContext = objectContext;
     this._settingService = settingService;
 }
 public PromoPlugin(
     IProductService productService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IPictureService pictureService,
     ICurrencyService currencyService,
     ISettingService settingService,
     IWorkContext workContext,
     IMeasureService measureService,
     MeasureSettings measureSettings,
     PromoSettings promosFeedSettings,
     CurrencySettings currencySettings,
     IProductAttributeService productAttributeService,
     IPriceCalculationService priceCalculationService,
     ITaxService taxService,
     ILogger logger,
     IPromoService promosFeedService,
     IScheduleTaskService scheduleTaskService,
     NopPromoContext nopPromoContext,
     IProductAttributeConfigService productAttributeConfigService,
     WidgetSettings widgetSettings,
     IPluginFinder pluginFinder,
     ILocalizationService localizationService)
 {
     this._productService = productService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._pictureService = pictureService;
     this._currencyService = currencyService;
     this._settingService = settingService;
     this._workContext = workContext;
     this._measureService = measureService;
     this._measureSettings = measureSettings;
     this._promoSettings = promosFeedSettings;
     this._currencySettings = currencySettings;
     this._productAttributeService = productAttributeService;
     this._priceCalculationService = priceCalculationService;
     this._taxService = taxService;
     this._logger = logger;
     this._promosFeedService = promosFeedService;
     this._scheduleTaskService = scheduleTaskService;
     this._nopPromoContext = nopPromoContext;
     this._productAttributeConfigService = productAttributeConfigService;
     this._widgetSettings = widgetSettings;
     this._pluginFinder = pluginFinder;
     this._localizationService = localizationService;
 }
Пример #50
0
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="shippingService">Shipping service</param>
        /// <param name="shippingByTotalService">ShippingByTotal service</param>
        /// <param name="shippingByTotalSettings">ShippingByTotal settings</param>
        /// <param name="objectContext">ShippingByTotal object context</param>
        /// <param name="priceCalculationService">PriceCalculation service</param>
        /// <param name="settingService">Settings service</param>
        /// <param name="logger">Logger</param>
        public ByTotalProvider(IShippingService shippingService,
			IStoreContext storeContext,
            IShippingByTotalService shippingByTotalService,
            ShippingByTotalSettings shippingByTotalSettings,
            IPriceCalculationService priceCalculationService,
            ILogger logger,
            ISettingService settingService,
            ILocalizationService localizationService)
        {
            this._shippingService = shippingService;
            this._storeContext = storeContext;
            this._shippingByTotalService = shippingByTotalService;
            this._shippingByTotalSettings = shippingByTotalSettings;
            this._priceCalculationService = priceCalculationService;
            this._logger = logger;
            this._settingService = settingService;
            this._localizationService = localizationService;
        }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="shippingService">Shipping service</param>
 /// <param name="shippingByTotalService">ShippingByTotal service</param>
 /// <param name="shippingByTotalSettings">ShippingByTotal settings</param>
 /// <param name="objectContext">ShippingByTotal object context</param>
 /// <param name="priceCalculationService">PriceCalculation service</param>
 /// <param name="settingService">Settings service</param>
 /// <param name="logger">Logger</param>
 public ByTotalShippingComputationMethod(IShippingService shippingService,
     IStoreContext storeContext,
     IShippingByTotalService shippingByTotalService,
     ShippingByTotalSettings shippingByTotalSettings,
     ShippingByTotalObjectContext objectContext,
     IPriceCalculationService priceCalculationService,
     ILogger logger,
     ISettingService settingService)
 {
     this._shippingService = shippingService;
     this._storeContext = storeContext;
     this._shippingByTotalService = shippingByTotalService;
     this._shippingByTotalSettings = shippingByTotalSettings;
     this._objectContext = objectContext;
     this._priceCalculationService = priceCalculationService;
     this._logger = logger;
     this._settingService = settingService;
 }
Пример #52
0
        public VendorController(
            IProductService productService, 
            IProductTemplateService productTemplateService,
            IWorkContext workContext, 
            ITaxService taxService, 
            ICurrencyService currencyService,
            IPictureService pictureService, 
            ILocalizationService localizationService,
            IPriceCalculationService priceCalculationService, IPriceFormatter priceFormatter,
            IWebHelper webHelper, ISpecificationAttributeService specificationAttributeService,
            IGenericAttributeService genericAttributeService,
            IPermissionService permissionService, 
            ICustomerActivityService customerActivityService, 
            IAclService aclService,
            MediaSettings mediaSettings, CatalogSettings catalogSettings,
        
            ICacheManager cacheManager
            , IVendorService vendorService //add by hz
            , IVendorTemplateService vendorTemplateService //add by hz
            )
        {
            this._productService = productService;
            this._productTemplateService = productTemplateService;
            this._workContext = workContext;
            this._taxService = taxService;
            this._currencyService = currencyService;
            this._pictureService = pictureService;
            this._localizationService = localizationService;
            this._priceCalculationService = priceCalculationService;
            this._priceFormatter = priceFormatter;
            this._webHelper = webHelper;
            this._specificationAttributeService = specificationAttributeService;
            this._genericAttributeService = genericAttributeService;
            this._permissionService = permissionService;
            this._customerActivityService = customerActivityService;
            this._aclService = aclService;

            this._mediaSettings = mediaSettings;
            this._catalogSettings = catalogSettings;

            this._cacheManager = cacheManager;
            this._vendorService = vendorService; //add by hz
            this._vendorTemplateService = vendorTemplateService; // add by hz
        }
        public ByWeightShippingComputationMethod(IShippingService shippingService,
			IStoreContext storeContext,
            IShippingByWeightService shippingByWeightService,
            IPriceCalculationService priceCalculationService, 
            ShippingByWeightSettings shippingByWeightSettings,
            ShippingByWeightObjectContext objectContext,
            ILocalizationService localizationService,
            IPriceFormatter priceFormatter,
            ICommonServices commonServices)
        {
            this._shippingService = shippingService;
            this._storeContext = storeContext;
            this._shippingByWeightService = shippingByWeightService;
            this._priceCalculationService = priceCalculationService;
            this._shippingByWeightSettings = shippingByWeightSettings;
            this._objectContext = objectContext;
            this._localizationService = localizationService;
            this._priceFormatter = priceFormatter;
            this._commonServices = commonServices;
        }
 public ShoppingCartController(ICustomerService customerService,
     IDateTimeHelper dateTimeHelper,
     IPriceFormatter priceFormatter,
     IStoreService storeService,
     ITaxService taxService, 
     IPriceCalculationService priceCalculationService,
     IPermissionService permissionService, 
     ILocalizationService localizationService,
     IProductAttributeFormatter productAttributeFormatter)
 {
     this._customerService = customerService;
     this._dateTimeHelper = dateTimeHelper;
     this._priceFormatter = priceFormatter;
     this._storeService = storeService;
     this._taxService = taxService;
     this._priceCalculationService = priceCalculationService;
     this._permissionService = permissionService;
     this._localizationService = localizationService;
     this._productAttributeFormatter = productAttributeFormatter;
 }
 public ProductAttributeFormatter(IWorkContext workContext,
     IProductAttributeService productAttributeService,
     IProductAttributeParser productAttributeParser,
     ICurrencyService currencyService,
     ILocalizationService localizationService,
     ITaxService taxService,
     IPriceFormatter priceFormatter,
     IDownloadService downloadService,
     IWebHelper webHelper,
     IPriceCalculationService priceCalculationService)
 {
     this._workContext = workContext;
     this._productAttributeService = productAttributeService;
     this._productAttributeParser = productAttributeParser;
     this._currencyService = currencyService;
     this._localizationService = localizationService;
     this._taxService = taxService;
     this._priceFormatter = priceFormatter;
     this._downloadService = downloadService;
     this._webHelper = webHelper;
     this._priceCalculationService = priceCalculationService;
 }
        public static IEnumerable<ProductOverviewModel> PrepareProductOverviewModels(this Controller controller,
            IWorkContext workContext,
            IStoreContext storeContext,
            ICategoryService categoryService,
            IProductService productService,
            ISpecificationAttributeService specificationAttributeService,
            IPriceCalculationService priceCalculationService,
            IPriceFormatter priceFormatter,
            IPermissionService permissionService,
            ILocalizationService localizationService,
            ITaxService taxService,
            ICurrencyService currencyService,
            IPictureService pictureService,
            IWebHelper webHelper,
            ICacheManager cacheManager,
            CatalogSettings catalogSettings,
            MediaSettings mediaSettings,
            IEnumerable<Product> products,
            bool preparePriceModel = true, bool preparePictureModel = true,
            int? productThumbPictureSize = null, bool prepareSpecificationAttributes = false,
            bool forceRedirectionAfterAddingToCart = false)
        {
            if (products == null)
                throw new ArgumentNullException("products");

            var models = new List<ProductOverviewModel>();
            foreach (var product in products)
            {
                var model = new ProductOverviewModel
                {
                    Id = product.Id,
                    Name = product.GetLocalized(x => x.Name),
                    ShortDescription = product.GetLocalized(x => x.ShortDescription),
                    FullDescription = product.GetLocalized(x => x.FullDescription),
                    SeName = product.GetSeName(),
                };
                //price
                if (preparePriceModel)
                {
                    #region Prepare product price

                    var priceModel = new ProductOverviewModel.ProductPriceModel
                    {
                        ForceRedirectionAfterAddingToCart = forceRedirectionAfterAddingToCart
                    };

                    switch (product.ProductType)
                    {
                        case ProductType.GroupedProduct:
                            {
                                #region Grouped product

                                var associatedProducts = productService.GetAssociatedProducts(product.Id, storeContext.CurrentStore.Id);

                                switch (associatedProducts.Count)
                                {
                                    case 0:
                                        {
                                            //no associated products
                                            //priceModel.DisableBuyButton = true;
                                            //priceModel.DisableWishlistButton = true;
                                            //compare products
                                            priceModel.DisableAddToCompareListButton = !catalogSettings.CompareProductsEnabled;
                                            //priceModel.AvailableForPreOrder = false;
                                        }
                                        break;
                                    default:
                                        {
                                            //we have at least one associated product
                                            //priceModel.DisableBuyButton = true;
                                            //priceModel.DisableWishlistButton = true;
                                            //compare products
                                            priceModel.DisableAddToCompareListButton = !catalogSettings.CompareProductsEnabled;
                                            //priceModel.AvailableForPreOrder = false;

                                            if (permissionService.Authorize(StandardPermissionProvider.DisplayPrices))
                                            {
                                                //find a minimum possible price
                                                decimal? minPossiblePrice = null;
                                                Product minPriceProduct = null;
                                                foreach (var associatedProduct in associatedProducts)
                                                {
                                                    //calculate for the maximum quantity (in case if we have tier prices)
                                                    var tmpPrice = priceCalculationService.GetFinalPrice(associatedProduct,
                                                        workContext.CurrentCustomer, decimal.Zero, true, int.MaxValue);
                                                    if (!minPossiblePrice.HasValue || tmpPrice < minPossiblePrice.Value)
                                                    {
                                                        minPriceProduct = associatedProduct;
                                                        minPossiblePrice = tmpPrice;
                                                    }
                                                }
                                                if (minPriceProduct != null && !minPriceProduct.CustomerEntersPrice)
                                                {
                                                    if (minPriceProduct.CallForPrice)
                                                    {
                                                        priceModel.OldPrice = null;
                                                        priceModel.Price = localizationService.GetResource("Products.CallForPrice");
                                                    }
                                                    else if (minPossiblePrice.HasValue)
                                                    {
                                                        //calculate prices
                                                        decimal taxRate;
                                                        decimal finalPriceBase = taxService.GetProductPrice(minPriceProduct, minPossiblePrice.Value, out taxRate);
                                                        decimal finalPrice = currencyService.ConvertFromPrimaryStoreCurrency(finalPriceBase, workContext.WorkingCurrency);

                                                        priceModel.OldPrice = null;
                                                        priceModel.Price = String.Format(localizationService.GetResource("Products.PriceRangeFrom"), priceFormatter.FormatPrice(finalPrice));

                                                    }
                                                    else
                                                    {
                                                        //Actually it's not possible (we presume that minimalPrice always has a value)
                                                        //We never should get here
                                                        Debug.WriteLine("Cannot calculate minPrice for product #{0}", product.Id);
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                //hide prices
                                                priceModel.OldPrice = null;
                                                priceModel.Price = null;
                                            }
                                        }
                                        break;
                                }

                                #endregion
                            }
                            break;
                        case ProductType.SimpleProduct:
                        default:
                            {
                                #region Simple product

                                //add to cart button
                                priceModel.DisableBuyButton = product.DisableBuyButton ||
                                    !permissionService.Authorize(StandardPermissionProvider.EnableShoppingCart) ||
                                    !permissionService.Authorize(StandardPermissionProvider.DisplayPrices);

                                //add to wishlist button
                                priceModel.DisableWishlistButton = product.DisableWishlistButton ||
                                    !permissionService.Authorize(StandardPermissionProvider.EnableWishlist) ||
                                    !permissionService.Authorize(StandardPermissionProvider.DisplayPrices);
                                //compare products
                                priceModel.DisableAddToCompareListButton = !catalogSettings.CompareProductsEnabled;

                                //rental
                                priceModel.IsRental = product.IsRental;

                                //pre-order
                                if (product.AvailableForPreOrder)
                                {
                                    priceModel.AvailableForPreOrder = !product.PreOrderAvailabilityStartDateTimeUtc.HasValue ||
                                        product.PreOrderAvailabilityStartDateTimeUtc.Value >= DateTime.UtcNow;
                                    priceModel.PreOrderAvailabilityStartDateTimeUtc = product.PreOrderAvailabilityStartDateTimeUtc;
                                }

                                //prices
                                if (permissionService.Authorize(StandardPermissionProvider.DisplayPrices))
                                {
                                    if (!product.CustomerEntersPrice)
                                    {
                                        if (product.CallForPrice)
                                        {
                                            //call for price
                                            priceModel.OldPrice = null;
                                            priceModel.Price = localizationService.GetResource("Products.CallForPrice");
                                        }
                                        else
                                        {
                                            //prices

                                            //calculate for the maximum quantity (in case if we have tier prices)
                                            decimal minPossiblePrice = priceCalculationService.GetFinalPrice(product,
                                                workContext.CurrentCustomer, decimal.Zero, true, int.MaxValue);

                                            decimal taxRate;
                                            decimal oldPriceBase = taxService.GetProductPrice(product, product.OldPrice, out taxRate);
                                            decimal finalPriceBase = taxService.GetProductPrice(product, minPossiblePrice, out taxRate);

                                            decimal oldPrice = currencyService.ConvertFromPrimaryStoreCurrency(oldPriceBase, workContext.WorkingCurrency);
                                            decimal finalPrice = currencyService.ConvertFromPrimaryStoreCurrency(finalPriceBase, workContext.WorkingCurrency);

                                            //do we have tier prices configured?
                                            var tierPrices = new List<TierPrice>();
                                            if (product.HasTierPrices)
                                            {
                                                tierPrices.AddRange(product.TierPrices
                                                    .OrderBy(tp => tp.Quantity)
                                                    .ToList()
                                                    .FilterByStore(storeContext.CurrentStore.Id)
                                                    .FilterForCustomer(workContext.CurrentCustomer)
                                                    .RemoveDuplicatedQuantities());
                                            }
                                            //When there is just one tier (with  qty 1),
                                            //there are no actual savings in the list.
                                            bool displayFromMessage = tierPrices.Count > 0 &&
                                                !(tierPrices.Count == 1 && tierPrices[0].Quantity <= 1);
                                            if (displayFromMessage)
                                            {
                                                priceModel.OldPrice = null;
                                                priceModel.Price = String.Format(localizationService.GetResource("Products.PriceRangeFrom"), priceFormatter.FormatPrice(finalPrice));
                                            }
                                            else
                                            {
                                                if (finalPriceBase != oldPriceBase && oldPriceBase != decimal.Zero)
                                                {
                                                    priceModel.OldPrice = priceFormatter.FormatPrice(oldPrice);
                                                    priceModel.Price = priceFormatter.FormatPrice(finalPrice);
                                                }
                                                else
                                                {
                                                    priceModel.OldPrice = null;
                                                    priceModel.Price = priceFormatter.FormatPrice(finalPrice);
                                                }
                                            }
                                            if (product.IsRental)
                                            {
                                                //rental product
                                                priceModel.OldPrice = priceFormatter.FormatRentalProductPeriod(product, priceModel.OldPrice);
                                                priceModel.Price = priceFormatter.FormatRentalProductPeriod(product, priceModel.Price);
                                            }

                                            //property for German market
                                            //we display tax/shipping info only with "shipping enabled" for this product
                                            //we also ensure this it's not free shipping
                                            priceModel.DisplayTaxShippingInfo = catalogSettings.DisplayTaxShippingInfoProductBoxes
                                                && product.IsShipEnabled &&
                                                !product.IsFreeShipping;
                                        }
                                    }
                                }
                                else
                                {
                                    //hide prices
                                    priceModel.OldPrice = null;
                                    priceModel.Price = null;
                                }

                                #endregion
                            }
                            break;
                    }

                    model.ProductPrice = priceModel;

                    #endregion
                }

                //picture
                if (preparePictureModel)
                {
                    #region Prepare product picture

                    //If a size has been set in the view, we use it in priority
                    int pictureSize = productThumbPictureSize.HasValue ? productThumbPictureSize.Value : mediaSettings.ProductThumbPictureSize;
                    //prepare picture model
                    var defaultProductPictureCacheKey = string.Format(ModelCacheEventConsumer.PRODUCT_DEFAULTPICTURE_MODEL_KEY, product.Id, pictureSize, true, workContext.WorkingLanguage.Id, webHelper.IsCurrentConnectionSecured(), storeContext.CurrentStore.Id);
                    model.DefaultPictureModel = cacheManager.Get(defaultProductPictureCacheKey, () =>
                    {
                        var picture = pictureService.GetPicturesByProductId(product.Id, 1).FirstOrDefault();
                        var pictureModel = new PictureModel
                        {
                            ImageUrl = pictureService.GetPictureUrl(picture, pictureSize),
                            FullSizeImageUrl = pictureService.GetPictureUrl(picture)
                        };
                        //"title" attribute
                        pictureModel.Title = (picture != null && !string.IsNullOrEmpty(picture.TitleAttribute)) ?
                            picture.TitleAttribute :
                            string.Format(localizationService.GetResource("Media.Product.ImageLinkTitleFormat"), model.Name);
                        //"alt" attribute
                        pictureModel.AlternateText = (picture != null && !string.IsNullOrEmpty(picture.AltAttribute)) ?
                            picture.AltAttribute :
                            string.Format(localizationService.GetResource("Media.Product.ImageAlternateTextFormat"), model.Name);

                        return pictureModel;
                    });

                    #endregion
                }

                //specs
                if (prepareSpecificationAttributes)
                {
                    model.SpecificationAttributeModels = PrepareProductSpecificationModel(controller, workContext,
                         specificationAttributeService, cacheManager, product);
                }

                //reviews
                model.ReviewOverviewModel = new ProductReviewOverviewModel
                {
                    ProductId = product.Id,
                    RatingSum = product.ApprovedRatingSum,
                    TotalReviews = product.ApprovedTotalReviews,
                    AllowCustomerReviews = product.AllowCustomerReviews
                };

                models.Add(model);
            }
            return models;
        }
        public new void SetUp()
        {
            _workContext = MockRepository.GenerateMock<IWorkContext>();

            _store = new Store() { Id = 1 };
            _storeContext = MockRepository.GenerateMock<IStoreContext>();
            _storeContext.Expect(x => x.CurrentStore).Return(_store);

            var pluginFinder = new PluginFinder();
            var cacheManager = new NopNullCache();

            //price calculation service
            _discountService = MockRepository.GenerateMock<IDiscountService>();
            _categoryService = MockRepository.GenerateMock<ICategoryService>();
            _productAttributeParser = MockRepository.GenerateMock<IProductAttributeParser>();

            _shoppingCartSettings = new ShoppingCartSettings();
            _catalogSettings = new CatalogSettings();

            _priceCalcService = new PriceCalculationService(_workContext, _discountService,
                _categoryService, _productAttributeParser, _shoppingCartSettings, _catalogSettings);

            _eventPublisher = MockRepository.GenerateMock<IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything));

            _localizationService = MockRepository.GenerateMock<ILocalizationService>();

            //shipping
            _shippingSettings = new ShippingSettings();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List<string>();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod");
            _shippingMethodRepository = MockRepository.GenerateMock<IRepository<ShippingMethod>>();
            _logger = new NullLogger();
            _shippingService = new ShippingService(cacheManager,
                _shippingMethodRepository,
                _logger,
                _productAttributeParser,
                _checkoutAttributeParser,
                _genericAttributeService,
                _localizationService,
                _shippingSettings, pluginFinder,
                _eventPublisher, _shoppingCartSettings);

            _paymentService = MockRepository.GenerateMock<IPaymentService>();
            _checkoutAttributeParser = MockRepository.GenerateMock<ICheckoutAttributeParser>();
            _giftCardService = MockRepository.GenerateMock<IGiftCardService>();
            _genericAttributeService = MockRepository.GenerateMock<IGenericAttributeService>();

            _eventPublisher = MockRepository.GenerateMock<IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything));

            //tax
            _taxSettings = new TaxSettings();
            _taxSettings.ShippingIsTaxable = true;
            _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true;
            _taxSettings.DefaultTaxAddressId = 10;
            _addressService = MockRepository.GenerateMock<IAddressService>();
            _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address() { Id = _taxSettings.DefaultTaxAddressId });
            _taxService = new TaxService(_addressService, _workContext, _taxSettings, pluginFinder);

            _rewardPointsSettings = new RewardPointsSettings();

            _orderTotalCalcService = new OrderTotalCalculationService(_workContext, _storeContext,
                _priceCalcService, _taxService, _shippingService, _paymentService,
                _checkoutAttributeParser, _discountService, _giftCardService, _genericAttributeService,
                _taxSettings, _rewardPointsSettings, _shippingSettings, _shoppingCartSettings, _catalogSettings);
        }
        public new void SetUp()
        {
            _workContext = null;

            _discountService = MockRepository.GenerateMock<IDiscountService>();

            _categoryService = MockRepository.GenerateMock<ICategoryService>();

            _productAttributeParser = MockRepository.GenerateMock<IProductAttributeParser>();

            _shoppingCartSettings = new ShoppingCartSettings();
            _catalogSettings = new CatalogSettings();

            _priceCalcService = new PriceCalculationService(_workContext, _discountService,
                _categoryService, _productAttributeParser, _shoppingCartSettings, _catalogSettings);
        }
Пример #59
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="orderService">Order service</param>
 /// <param name="webHelper">Web helper</param>
 /// <param name="localizationService">Localization service</param>
 /// <param name="languageService">Language service</param>
 /// <param name="productService">Product service</param>
 /// <param name="paymentService">Payment service</param>
 /// <param name="logger">Logger</param>
 /// <param name="orderTotalCalculationService">Order total calculationservice</param>
 /// <param name="priceCalculationService">Price calculation service</param>
 /// <param name="priceFormatter">Price formatter</param>
 /// <param name="productAttributeParser">Product attribute parser</param>
 /// <param name="productAttributeFormatter">Product attribute formatter</param>
 /// <param name="giftCardService">Gift card service</param>
 /// <param name="shoppingCartService">Shopping cart service</param>
 /// <param name="checkoutAttributeFormatter">Checkout attribute service</param>
 /// <param name="shippingService">Shipping service</param>
 /// <param name="shipmentService">Shipment service</param>
 /// <param name="taxService">Tax service</param>
 /// <param name="customerService">Customer service</param>
 /// <param name="discountService">Discount service</param>
 /// <param name="encryptionService">Encryption service</param>
 /// <param name="workContext">Work context</param>
 /// <param name="workflowMessageService">Workflow message service</param>
 /// <param name="vendorService">Vendor service</param>
 /// <param name="customerActivityService">Customer activity service</param>
 /// <param name="currencyService">Currency service</param>
 /// <param name="affiliateService">Affiliate service</param>
 /// <param name="eventPublisher">Event published</param>
 /// <param name="pdfService">PDF service</param>
 /// <param name="paymentSettings">Payment settings</param>
 /// <param name="shippingSettings">Shipping settings</param>
 /// <param name="rewardPointsSettings">Reward points settings</param>
 /// <param name="orderSettings">Order settings</param>
 /// <param name="taxSettings">Tax settings</param>
 /// <param name="localizationSettings">Localization settings</param>
 /// <param name="currencySettings">Currency settings</param>
 public OrderProcessingService(IOrderService orderService,
     IWebHelper webHelper,
     ILocalizationService localizationService,
     ILanguageService languageService,
     IProductService productService,
     IPaymentService paymentService,
     ILogger logger,
     IOrderTotalCalculationService orderTotalCalculationService,
     IPriceCalculationService priceCalculationService,
     IPriceFormatter priceFormatter,
     IProductAttributeParser productAttributeParser,
     IProductAttributeFormatter productAttributeFormatter,
     IGiftCardService giftCardService,
     IShoppingCartService shoppingCartService,
     ICheckoutAttributeFormatter checkoutAttributeFormatter,
     IShippingService shippingService,
     IShipmentService shipmentService,
     ITaxService taxService,
     ICustomerService customerService,
     IDiscountService discountService,
     IEncryptionService encryptionService,
     IWorkContext workContext,
     IWorkflowMessageService workflowMessageService,
     IVendorService vendorService,
     ICustomerActivityService customerActivityService,
     ICurrencyService currencyService,
     IAffiliateService affiliateService,
     IEventPublisher eventPublisher,
     IPdfService pdfService,
     ShippingSettings shippingSettings,
     PaymentSettings paymentSettings,
     RewardPointsSettings rewardPointsSettings,
     OrderSettings orderSettings,
     TaxSettings taxSettings,
     LocalizationSettings localizationSettings,
     CurrencySettings currencySettings)
 {
     this._orderService = orderService;
     this._webHelper = webHelper;
     this._localizationService = localizationService;
     this._languageService = languageService;
     this._productService = productService;
     this._paymentService = paymentService;
     this._logger = logger;
     this._orderTotalCalculationService = orderTotalCalculationService;
     this._priceCalculationService = priceCalculationService;
     this._priceFormatter = priceFormatter;
     this._productAttributeParser = productAttributeParser;
     this._productAttributeFormatter = productAttributeFormatter;
     this._giftCardService = giftCardService;
     this._shoppingCartService = shoppingCartService;
     this._checkoutAttributeFormatter = checkoutAttributeFormatter;
     this._workContext = workContext;
     this._workflowMessageService = workflowMessageService;
     this._vendorService = vendorService;
     this._shippingService = shippingService;
     this._shipmentService = shipmentService;
     this._taxService = taxService;
     this._customerService = customerService;
     this._discountService = discountService;
     this._encryptionService = encryptionService;
     this._customerActivityService = customerActivityService;
     this._currencyService = currencyService;
     this._affiliateService = affiliateService;
     this._eventPublisher = eventPublisher;
     this._pdfService = pdfService;
     this._paymentSettings = paymentSettings;
     this._shippingSettings = shippingSettings;
     this._rewardPointsSettings = rewardPointsSettings;
     this._orderSettings = orderSettings;
     this._taxSettings = taxSettings;
     this._localizationSettings = localizationSettings;
     this._currencySettings = currencySettings;
 }
Пример #60
0
        public InvoicesController(IOrderService orderService,
            IOrderReportService orderReportService,
            IOrderProcessingService orderProcessingService,
            IPriceCalculationService priceCalculationService,
            IDateTimeHelper dateTimeHelper,
            IPriceFormatter priceFormatter,
            IDiscountService discountService,
            ILocalizationService localizationService,
            IWorkContext workContext,
            ICurrencyService currencyService,
            IEncryptionService encryptionService,
            IPaymentService paymentService,
            IMeasureService measureService,
            IPdfService pdfService,
            IAddressService addressService,
            ICountryService countryService,
            IStateProvinceService stateProvinceService,
            Nop.Services.Catalog.IProductService productService,
            IExportManager exportManager,
            IPermissionService permissionService,
            IWorkflowMessageService workflowMessageService,
            ICategoryService categoryService,
            IManufacturerService manufacturerService,
            IProductAttributeService productAttributeService,
            IProductAttributeParser productAttributeParser,
            IProductAttributeFormatter productAttributeFormatter,
            IShoppingCartService shoppingCartService,
            IGiftCardService giftCardService,
            IDownloadService downloadService,
            IShipmentService shipmentService,
            IShippingService shippingService,
            IStoreService storeService,
            IVendorService vendorService,
            IAddressAttributeParser addressAttributeParser,
            IAddressAttributeService addressAttributeService,
            IAddressAttributeFormatter addressAttributeFormatter,
            IAffiliateService affiliateService,
            IPictureService pictureService,
            CurrencySettings currencySettings,
            TaxSettings taxSettings,
            MeasureSettings measureSettings,
            AddressSettings addressSettings,
            ShippingSettings shippingSettings,
            IInvoiceService invoiceService,
            IGenericAttributeService genericAttributeService,
            IProductTemplateService productTemplateService,
            IStoreContext storeContext,
            ISettingService settingService,
            IGroupDealService groupDealService)
        {
            this._orderService = orderService;
            this._orderReportService = orderReportService;
            this._orderProcessingService = orderProcessingService;
            this._priceCalculationService = priceCalculationService;
            this._dateTimeHelper = dateTimeHelper;
            this._priceFormatter = priceFormatter;
            this._discountService = discountService;
            this._localizationService = localizationService;
            this._workContext = workContext;
            this._currencyService = currencyService;
            this._encryptionService = encryptionService;
            this._paymentService = paymentService;
            this._measureService = measureService;
            this._pdfService = pdfService;
            this._addressService = addressService;
            this._countryService = countryService;
            this._stateProvinceService = stateProvinceService;
            this._productService = productService;
            this._exportManager = exportManager;
            this._permissionService = permissionService;
            this._workflowMessageService = workflowMessageService;
            this._categoryService = categoryService;
            this._manufacturerService = manufacturerService;
            this._productAttributeService = productAttributeService;
            this._productAttributeParser = productAttributeParser;
            this._productAttributeFormatter = productAttributeFormatter;
            this._shoppingCartService = shoppingCartService;
            this._giftCardService = giftCardService;
            this._downloadService = downloadService;
            this._shipmentService = shipmentService;
            this._shippingService = shippingService;
            this._storeService = storeService;
            this._vendorService = vendorService;
            this._addressAttributeParser = addressAttributeParser;
            this._addressAttributeService = addressAttributeService;
            this._addressAttributeFormatter = addressAttributeFormatter;
            this._affiliateService = affiliateService;
            this._pictureService = pictureService;

            this._currencySettings = currencySettings;
            this._taxSettings = taxSettings;
            this._measureSettings = measureSettings;
            this._addressSettings = addressSettings;
            this._shippingSettings = shippingSettings;
            this._invoiceService = invoiceService;
            this._genericAttributeService = genericAttributeService;
            this._productTemplateService = productTemplateService;
            this._storeContext = storeContext;
            this._settingService = settingService;
            this._groupDealService = groupDealService;
        }