Example #1
0
 public ProductController(IProductService productService, 
     IProductTemplateService productTemplateService,
     ICategoryService categoryService, IManufacturerService manufacturerService,
     IWorkContext workContext, ILanguageService languageService, 
     ILocalizationService localizationService, ILocalizedEntityService localizedEntityService,
     ISpecificationAttributeService specificationAttributeService, IPictureService pictureService,
     ITaxCategoryService taxCategoryService, IProductTagService productTagService,
     ICopyProductService copyProductService, IPdfService pdfService,
     IExportManager exportManager, IImportManager importManager,
     ICustomerActivityService customerActivityService,
     IPermissionService permissionService, AdminAreaSettings adminAreaSettings)
 {
     this._productService = productService;
     this._productTemplateService = productTemplateService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._workContext = workContext;
     this._languageService = languageService;
     this._localizationService = localizationService;
     this._localizedEntityService = localizedEntityService;
     this._specificationAttributeService = specificationAttributeService;
     this._pictureService = pictureService;
     this._taxCategoryService = taxCategoryService;
     this._productTagService = productTagService;
     this._copyProductService = copyProductService;
     this._pdfService = pdfService;
     this._exportManager = exportManager;
     this._importManager = importManager;
     this._customerActivityService = customerActivityService;
     this._permissionService = permissionService;
     this._adminAreaSettings = adminAreaSettings;
 }
        public static IList<ProductSpecificationModel> PrepareProductSpecificationModel(this Controller controller,
            IWorkContext workContext,
            ISpecificationAttributeService specificationAttributeService,
            ICacheManager cacheManager,
            Product product)
        {
            if (product == null)
                throw new ArgumentNullException("product");

            string cacheKey = string.Format(ModelCacheEventConsumer.PRODUCT_SPECS_MODEL_KEY, product.Id, workContext.WorkingLanguage.Id);
            return cacheManager.Get(cacheKey, () =>
            {
                var model = specificationAttributeService.GetProductSpecificationAttributesByProductId(product.Id, null, true)
                   .Select(psa =>
                   {
                       return new ProductSpecificationModel()
                       {
                           SpecificationAttributeId = psa.SpecificationAttributeOption.SpecificationAttributeId,
                           SpecificationAttributeName = psa.SpecificationAttributeOption.SpecificationAttribute.GetLocalized(x => x.Name),
                           SpecificationAttributeOption = !String.IsNullOrEmpty(psa.CustomValue) ? psa.CustomValue : psa.SpecificationAttributeOption.GetLocalized(x => x.Name),
                       };
                   }).ToList();
                return model;
            });
        }
 public CopyProductService(IProductService productService,
     IProductAttributeService productAttributeService,
     ILanguageService languageService,
     ILocalizedEntityService localizedEntityService, 
     IPictureService pictureService,
     ICategoryService categoryService, 
     IManufacturerService manufacturerService,
     ISpecificationAttributeService specificationAttributeService,
     IDownloadService downloadService,
     IProductAttributeParser productAttributeParser,
     IUrlRecordService urlRecordService, 
     IStoreMappingService storeMappingService)
 {
     this._productService = productService;
     this._productAttributeService = productAttributeService;
     this._languageService = languageService;
     this._localizedEntityService = localizedEntityService;
     this._pictureService = pictureService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._specificationAttributeService = specificationAttributeService;
     this._downloadService = downloadService;
     this._productAttributeParser = productAttributeParser;
     this._urlRecordService = urlRecordService;
     this._storeMappingService = storeMappingService;
 }
Example #4
0
 public AddSpecificationAttributeCommandHandler(
     ISpecificationAttributeService specificationAttributeService,
     ICustomerActivityService customerActivityService,
     ITranslationService translationService)
 {
     _specificationAttributeService = specificationAttributeService;
     _customerActivityService       = customerActivityService;
     _translationService            = translationService;
 }
Example #5
0
 public AddSpecificationAttributeCommandHandler(
     ISpecificationAttributeService specificationAttributeService,
     ICustomerActivityService customerActivityService,
     ILocalizationService localizationService)
 {
     _specificationAttributeService = specificationAttributeService;
     _customerActivityService       = customerActivityService;
     _localizationService           = localizationService;
 }
 public SelectSellController(IProductService productService,
     IProductTemplateService productTemplateService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     ICustomerService customerService,
     IUrlRecordService urlRecordService,
     IWorkContext workContext,
     ILanguageService languageService,
     ILocalizationService localizationService,
     ILocalizedEntityService localizedEntityService,
     ISpecificationAttributeService specificationAttributeService,
     IPictureService pictureService,
     ITaxCategoryService taxCategoryService,
     IProductTagService productTagService,
     ICopyProductService copyProductService,
     IPdfService pdfService,
     IExportManager exportManager,
     IImportManager importManager,
     ICustomerActivityService customerActivityService,
     IPermissionService permissionService,
     IAclService aclService,
     IStoreService storeService,
     IOrderService orderService,
     IStoreMappingService storeMappingService,
     IVendorService vendorService,
     IShippingService shippingService,
     IShipmentService shipmentService,
     ICurrencyService currencyService,
     CurrencySettings currencySettings,
     IMeasureService measureService,
     MeasureSettings measureSettings,
     AdminAreaSettings adminAreaSettings,
     IDateTimeHelper dateTimeHelper,
     IDiscountService discountService,
     IProductAttributeService productAttributeService,
     IBackInStockSubscriptionService backInStockSubscriptionService,
     IShoppingCartService shoppingCartService,
     IProductAttributeFormatter productAttributeFormatter,
     IProductAttributeParser productAttributeParser,
     IDownloadService downloadService,
     IStoreContext storeContext,
     IRepository<StoreMapping> storeMapping)
 {
     _workContext = workContext;
     _productService = productService;
     _pictureService = pictureService;
     _localizationService = localizationService;
     _categoryService = categoryService;
     _manufacturerService = manufacturerService;
     _storeService = storeService;
     _shippingService = shippingService;
     _vendorService = vendorService;
     _storeMappingService = storeMappingService;
     _storeContext = storeContext;
     _storeMapping = storeMapping;
 }
Example #7
0
 public SelectSellController(IProductService productService,
                             IProductTemplateService productTemplateService,
                             ICategoryService categoryService,
                             IManufacturerService manufacturerService,
                             ICustomerService customerService,
                             IUrlRecordService urlRecordService,
                             IWorkContext workContext,
                             ILanguageService languageService,
                             ILocalizationService localizationService,
                             ILocalizedEntityService localizedEntityService,
                             ISpecificationAttributeService specificationAttributeService,
                             IPictureService pictureService,
                             ITaxCategoryService taxCategoryService,
                             IProductTagService productTagService,
                             ICopyProductService copyProductService,
                             IPdfService pdfService,
                             IExportManager exportManager,
                             IImportManager importManager,
                             ICustomerActivityService customerActivityService,
                             IPermissionService permissionService,
                             IAclService aclService,
                             IStoreService storeService,
                             IOrderService orderService,
                             IStoreMappingService storeMappingService,
                             IVendorService vendorService,
                             IShippingService shippingService,
                             IShipmentService shipmentService,
                             ICurrencyService currencyService,
                             CurrencySettings currencySettings,
                             IMeasureService measureService,
                             MeasureSettings measureSettings,
                             AdminAreaSettings adminAreaSettings,
                             IDateTimeHelper dateTimeHelper,
                             IDiscountService discountService,
                             IProductAttributeService productAttributeService,
                             IBackInStockSubscriptionService backInStockSubscriptionService,
                             IShoppingCartService shoppingCartService,
                             IProductAttributeFormatter productAttributeFormatter,
                             IProductAttributeParser productAttributeParser,
                             IDownloadService downloadService,
                             IStoreContext storeContext,
                             IRepository <StoreMapping> storeMapping)
 {
     _workContext         = workContext;
     _productService      = productService;
     _pictureService      = pictureService;
     _localizationService = localizationService;
     _categoryService     = categoryService;
     _manufacturerService = manufacturerService;
     _storeService        = storeService;
     _shippingService     = shippingService;
     _vendorService       = vendorService;
     _storeMappingService = storeMappingService;
     _storeContext        = storeContext;
     _storeMapping        = storeMapping;
 }
Example #8
0
 public DTOHelper(IProductService productService,
                  IAclService aclService,
                  IStoreMappingService storeMappingService,
                  IPictureService pictureService,
                  IProductAttributeService productAttributeService,
                  ICustomerApiService customerApiService,
                  ICustomerService customerService,
                  IProductAttributeConverter productAttributeConverter,
                  ILanguageService languageService,
                  ICurrencyService currencyService,
                  IDiscountService discountService,
                  IManufacturerService manufacturerService,
                  CurrencySettings currencySettings,
                  IStoreService storeService,
                  ILocalizationService localizationService,
                  IUrlRecordService urlRecordService,
                  IProductTagService productTagService,
                  ITaxCategoryService taxCategoryService,
                  ISettingService settingService,
                  IShipmentService shipmentService,
                  IOrderService orderService,
                  IAddressService addressService,
                  ISpecificationAttributeService specificationAttributeService,
                  IGenericAttributeService genericAttributeService,
                  MediaSettings mediaSettings,
                  CustomerSettings customerSettings,
                  IReviewTypeService reviewTypeService)
 {
     _specificationAttributeService = specificationAttributeService;
     _productService            = productService;
     _aclService                = aclService;
     _storeMappingService       = storeMappingService;
     _pictureService            = pictureService;
     _productAttributeService   = productAttributeService;
     _customerApiService        = customerApiService;
     _customerService           = customerService;
     _productAttributeConverter = productAttributeConverter;
     _languageService           = languageService;
     _currencyService           = currencyService;
     _currencySettings          = currencySettings;
     _storeService              = storeService;
     _localizationService       = localizationService;
     _urlRecordService          = urlRecordService;
     _productTagService         = productTagService;
     _taxCategoryService        = taxCategoryService;
     _settingService            = settingService;
     _discountService           = discountService;
     _manufacturerService       = manufacturerService;
     _orderService              = orderService;
     _shipmentService           = shipmentService;
     _addressService            = addressService;
     _genericAttributeService   = genericAttributeService;
     _mediaSettings             = mediaSettings;
     _customerSettings          = customerSettings;
     _reviewTypeService         = reviewTypeService;
 }
Example #9
0
 public SpecificationAttributeController(ISpecificationAttributeService specificationAttributeService,
                                         ILanguageService languageService,
                                         ILocalizationService localizationService,
                                         ICustomerActivityService customerActivityService)
 {
     this._specificationAttributeService = specificationAttributeService;
     this._languageService         = languageService;
     this._localizationService     = localizationService;
     this._customerActivityService = customerActivityService;
 }
Example #10
0
        public SpecificationAttributeApiService(IMongoDBContext mongoDBContext, ISpecificationAttributeService specificationAttributeService,
                                                ILocalizationService localizationService, ICustomerActivityService customerActivityService)
        {
            _mongoDBContext = mongoDBContext;
            _specificationAttributeService = specificationAttributeService;
            _localizationService           = localizationService;
            _customerActivityService       = customerActivityService;

            _specificationAttribute = _mongoDBContext.Database().GetCollection <SpecificationAttributeDto>(typeof(Core.Domain.Catalog.SpecificationAttribute).Name);
        }
 public SpecificationAttributeModelFactory(IBaseAdminModelFactory baseAdminModelFactory,
                                           ILocalizationService localizationService,
                                           ILocalizedModelFactory localizedModelFactory,
                                           ISpecificationAttributeService specificationAttributeService)
 {
     _baseAdminModelFactory         = baseAdminModelFactory;
     _localizationService           = localizationService;
     _localizedModelFactory         = localizedModelFactory;
     _specificationAttributeService = specificationAttributeService;
 }
Example #12
0
 public AdminTabConsumer(
     ISettingService settingService,
     ISpecificationAttributeService specificationAttributeService,
     ICcService ccService,
     IOrderService orderService)
 {
     _settingService = settingService;
     _specificationAttributeService = specificationAttributeService;
     _ccService    = ccService;
     _orderService = orderService;
 }
Example #13
0
            public virtual void LoadSpecsFilters(Category category,
                                                 ISpecificationAttributeService specificationAttributeService, IWebHelper webHelper,
                                                 IWorkContext workContext)
            {
                if (category == null)
                {
                    throw new ArgumentNullException("category");
                }

                var alreadyFilteredOptions = GetAlreadyFilteredSpecs(specificationAttributeService, webHelper, workContext);
                var notFilteredOptions     = GetNotFilteredSpecs(category.Id,
                                                                 specificationAttributeService, webHelper, workContext);

                if (alreadyFilteredOptions.Count > 0 || notFilteredOptions.Count > 0)
                {
                    this.Enabled = true;

                    this.AlreadyFilteredItems = alreadyFilteredOptions.ToList().Select(x =>
                    {
                        var item = new SpecificationFilterItem();
                        item.SpecificationAttributeName       = x.SpecificationAttributeName;
                        item.SpecificationAttributeOptionName = x.SpecificationAttributeOptionName;
                        item.AttributeId = x.SpecificationAttributeId;
                        item.OptionId    = x.SpecificationAttributeOptionId;
                        return(item);
                    }).ToList();

                    this.NotFilteredItems = notFilteredOptions.ToList().Select(x =>
                    {
                        var item = new SpecificationFilterItem();
                        item.SpecificationAttributeName       = x.SpecificationAttributeName;
                        item.SpecificationAttributeOptionName = x.SpecificationAttributeOptionName;
                        item.AttributeId = x.SpecificationAttributeId;
                        item.OptionId    = x.SpecificationAttributeOptionId;
                        //filter URL
                        var alreadyFilteredOptionIds = GetAlreadyFilteredSpecOptionIds(webHelper);
                        if (!alreadyFilteredOptionIds.Contains(x.SpecificationAttributeOptionId))
                        {
                            alreadyFilteredOptionIds.Add(x.SpecificationAttributeOptionId);
                        }
                        string newQueryParam = GenerateFilteredSpecQueryParam(alreadyFilteredOptionIds);
                        string filterUrl     = webHelper.ModifyQueryString(webHelper.GetThisPageUrl(true), QUERYSTRINGPARAM + "=" + newQueryParam, null);
                        filterUrl            = ExcludeQueryStringParams(filterUrl, webHelper);
                        item.FilterUrl       = filterUrl;


                        return(item);
                    }).ToList();
                }
                else
                {
                    this.Enabled = false;
                }
            }
 public SpecificationAttributeController(ISpecificationAttributeService specificationAttributeService,
                                         ILanguageService languageService,
                                         ILocalizationService localizationService,
                                         ICustomerActivityService customerActivityService,
                                         SeoSettings seoSettings)
 {
     _specificationAttributeService = specificationAttributeService;
     _languageService         = languageService;
     _localizationService     = localizationService;
     _customerActivityService = customerActivityService;
     _seoSettings             = seoSettings;
 }
 public SpecificationAttributeController(ISpecificationAttributeService specificationAttributeService,
     ILanguageService languageService, ILocalizedEntityService localizedEntityService,
     ILocalizationService localizationService, ICustomerActivityService customerActivityService,
     IPermissionService permissionService)
 {
     this._specificationAttributeService = specificationAttributeService;
     this._languageService = languageService;
     this._localizedEntityService = localizedEntityService;
     this._localizationService = localizationService;
     this._customerActivityService = customerActivityService;
     this._permissionService = permissionService;
 }
 public WeekdayProductRotation(ISpecificationAttributeService specificationAttribute,
                               IDateTimeHelper dateTimeHelper,
                               IProductService productService,
                               ILogger logger,
                               ISettingService settingService)
 {
     this._specificationAttribute = specificationAttribute;
     this._dateTimeHelper         = dateTimeHelper;
     this._productService         = productService;
     this._logger         = logger;
     this._settingService = settingService;
 }
Example #17
0
 public AbcProductModelFactory(
     CaptchaSettings captchaSettings,
     CatalogSettings catalogSettings,
     CustomerSettings customerSettings,
     ICategoryService categoryService,
     ICurrencyService currencyService,
     ICustomerService customerService,
     IDateRangeService dateRangeService,
     IDateTimeHelper dateTimeHelper,
     IDownloadService downloadService,
     IGenericAttributeService genericAttributeService,
     ILocalizationService localizationService,
     IManufacturerService manufacturerService,
     IPermissionService permissionService,
     IPictureService pictureService,
     IPriceCalculationService priceCalculationService,
     IPriceFormatter priceFormatter,
     IProductAttributeParser productAttributeParser,
     IProductAttributeService productAttributeService,
     IProductService productService,
     IProductTagService productTagService,
     IProductTemplateService productTemplateService,
     IReviewTypeService reviewTypeService,
     ISpecificationAttributeService specificationAttributeService,
     IStaticCacheManager staticCacheManager,
     IStoreContext storeContext,
     IShoppingCartModelFactory shoppingCartModelFactory,
     ITaxService taxService,
     IUrlRecordService urlRecordService,
     IVendorService vendorService,
     IWebHelper webHelper,
     IWorkContext workContext,
     MediaSettings mediaSettings,
     OrderSettings orderSettings,
     SeoSettings seoSettings,
     ShippingSettings shippingSettings,
     VendorSettings vendorSettings,
     IAbcMattressListingPriceService abcMattressListingPriceService)
     : base(captchaSettings, catalogSettings, customerSettings,
            categoryService, currencyService, customerService, dateRangeService,
            dateTimeHelper, downloadService, genericAttributeService, localizationService,
            manufacturerService, permissionService, pictureService, priceCalculationService,
            priceFormatter, productAttributeParser, productAttributeService, productService,
            productTagService, productTemplateService, reviewTypeService, specificationAttributeService,
            staticCacheManager, storeContext, shoppingCartModelFactory, taxService, urlRecordService,
            vendorService, webHelper, workContext, mediaSettings, orderSettings, seoSettings,
            shippingSettings, vendorSettings
            )
 {
     _webHelper = webHelper;
     _abcMattressListingPriceService = abcMattressListingPriceService;
     _priceFormatter = priceFormatter;
 }
Example #18
0
        public void AddUpdateProductVariantsToNebim(IList <ProductVariant> productVariants)
        {
            var nebimIntegrationProvider = LoadNebimIntegrationServiceBySystemName("Misc.Nebim");
            IProductAttributeParser        productAttributeParser        = EngineContext.Current.Resolve <IProductAttributeParser>();
            ITaxService                    taxService                    = EngineContext.Current.Resolve <ITaxService>();
            IWorkContext                   workContext                   = EngineContext.Current.Resolve <IWorkContext>();
            ISpecificationAttributeService specificationAttributeService = EngineContext.Current.Resolve <ISpecificationAttributeService>();

            foreach (var pv in productVariants)
            {
                AddUpdateProductVariantToNebim(pv);
            }
        }
Example #19
0
 public GetBrandHandler(
     IMediator mediator,
     ICacheBase cacheBase,
     ISpecificationAttributeService specificationAttributeService,
     IHttpContextAccessor httpContextAccessor,
     CatalogSettings catalogSettings)
 {
     _mediator  = mediator;
     _cacheBase = cacheBase;
     _specificationAttributeService = specificationAttributeService;
     _httpContextAccessor           = httpContextAccessor;
     _catalogSettings = catalogSettings;
 }
 public SpecificationAttributeController(
     ISpecificationAttributeService specificationAttributeService,
     ILanguageService languageService,
     ILocalizedEntityService localizedEntityService,
     ICustomerActivityService customerActivityService,
     AdminAreaSettings adminAreaSettings)
 {
     _specificationAttributeService = specificationAttributeService;
     _languageService         = languageService;
     _localizedEntityService  = localizedEntityService;
     _customerActivityService = customerActivityService;
     _adminAreaSettings       = adminAreaSettings;
 }
Example #21
0
 public CatalogController(
     ICommonServices services,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IProductService productService,
     ICategoryTemplateService categoryTemplateService,
     IManufacturerTemplateService manufacturerTemplateService,
     ICurrencyService currencyService,
     IOrderReportService orderReportService,
     IProductTagService productTagService,
     IRecentlyViewedProductsService recentlyViewedProductsService,
     IPictureService pictureService,
     IPriceFormatter priceFormatter,
     ISpecificationAttributeService specificationAttributeService,
     ICompareProductsService compareProductsService,
     IGenericAttributeService genericAttributeService,
     IAclService aclService,
     IStoreMappingService storeMappingService,
     ICatalogSearchService catalogSearchService,
     MediaSettings mediaSettings,
     CatalogSettings catalogSettings,
     Lazy <ILanguageService> languageService,
     CatalogHelper helper,
     IBreadcrumb breadcrumb,
     IPromotionProductsService promotionService)
 {
     _services                      = services;
     _categoryService               = categoryService;
     _manufacturerService           = manufacturerService;
     _productService                = productService;
     _categoryTemplateService       = categoryTemplateService;
     _manufacturerTemplateService   = manufacturerTemplateService;
     _currencyService               = currencyService;
     _orderReportService            = orderReportService;
     _productTagService             = productTagService;
     _recentlyViewedProductsService = recentlyViewedProductsService;
     _compareProductsService        = compareProductsService;
     _pictureService                = pictureService;
     _priceFormatter                = priceFormatter;
     _specificationAttributeService = specificationAttributeService;
     _genericAttributeService       = genericAttributeService;
     _aclService                    = aclService;
     _storeMappingService           = storeMappingService;
     _catalogSearchService          = catalogSearchService;
     _mediaSettings                 = mediaSettings;
     _catalogSettings               = catalogSettings;
     _languageService               = languageService;
     _helper                = helper;
     _breadcrumb            = breadcrumb;
     this._promotionService = promotionService;
 }
 public CatalogModelFactory(BlogSettings blogSettings,
                            CatalogSettings catalogSettings,
                            DisplayDefaultMenuItemSettings displayDefaultMenuItemSettings,
                            ForumSettings forumSettings,
                            ICategoryService categoryService,
                            ICategoryTemplateService categoryTemplateService,
                            ICurrencyService currencyService,
                            IEventPublisher eventPublisher,
                            IHttpContextAccessor httpContextAccessor,
                            ILocalizationService localizationService,
                            IManufacturerService manufacturerService,
                            IManufacturerTemplateService manufacturerTemplateService,
                            IPictureService pictureService,
                            ISearchTermService searchTermService,
                            ISpecificationAttributeService specificationAttributeService,
                            IStaticCacheManager cacheManager,
                            IStoreContext storeContext,
                            ITopicService topicService,
                            IUrlRecordService urlRecordService,
                            IVendorService vendorService,
                            IWebHelper webHelper,
                            IWorkContext workContext,
                            MediaSettings mediaSettings,
                            VendorSettings vendorSettings)
 {
     this._blogSettings    = blogSettings;
     this._catalogSettings = catalogSettings;
     this._displayDefaultMenuItemSettings = displayDefaultMenuItemSettings;
     this._forumSettings                 = forumSettings;
     this._categoryService               = categoryService;
     this._categoryTemplateService       = categoryTemplateService;
     this._currencyService               = currencyService;
     this._eventPublisher                = eventPublisher;
     this._httpContextAccessor           = httpContextAccessor;
     this._localizationService           = localizationService;
     this._manufacturerService           = manufacturerService;
     this._manufacturerTemplateService   = manufacturerTemplateService;
     this._pictureService                = pictureService;
     this._searchTermService             = searchTermService;
     this._specificationAttributeService = specificationAttributeService;
     this._cacheManager     = cacheManager;
     this._storeContext     = storeContext;
     this._topicService     = topicService;
     this._urlRecordService = urlRecordService;
     this._vendorService    = vendorService;
     this._webHelper        = webHelper;
     this._workContext      = workContext;
     this._mediaSettings    = mediaSettings;
     this._vendorSettings   = vendorSettings;
 }
Example #23
0
 public SpecificationAttributeController(ISpecificationAttributeService specificationAttributeService,
                                         ILanguageService languageService, ILocalizedEntityService localizedEntityService,
                                         ILocalizationService localizationService, ICustomerActivityService customerActivityService,
                                         IPermissionService permissionService,
                                         AdminAreaSettings adminAreaSettings)
 {
     this._specificationAttributeService = specificationAttributeService;
     this._languageService         = languageService;
     this._localizedEntityService  = localizedEntityService;
     this._localizationService     = localizationService;
     this._customerActivityService = customerActivityService;
     this._permissionService       = permissionService;
     this._adminAreaSettings       = adminAreaSettings;
 }
Example #24
0
        public CustomProductController(
            IAclService aclService,
            IBackInStockSubscriptionService backInStockSubscriptionService,
            ICategoryService categoryService,
            ICopyProductService copyProductService,
            ICustomerActivityService customerActivityService,
            ICustomerService customerService,
            IDiscountService discountService,
            IDownloadService downloadService,
            IExportManager exportManager,
            IImportManager importManager,
            ILanguageService languageService,
            ILocalizationService localizationService,
            ILocalizedEntityService localizedEntityService,
            IManufacturerService manufacturerService,
            INopFileProvider fileProvider,
            INotificationService notificationService,
            IPdfService pdfService,
            IPermissionService permissionService,
            IPictureService pictureService,
            IProductAttributeParser productAttributeParser,
            IProductAttributeService productAttributeService,
            IProductAttributeFormatter productAttributeFormatter,
            IProductModelFactory productModelFactory,
            IProductService productService,
            IProductTagService productTagService,
            ISettingService settingService,
            IShippingService shippingService,
            IShoppingCartService shoppingCartService,
            ISpecificationAttributeService specificationAttributeService,
            IStoreContext storeContext,
            IUrlRecordService urlRecordService,
            IGenericAttributeService genericAttributeService,
            IWorkContext workContext,
            VendorSettings vendorSettings

            ) : base(aclService, backInStockSubscriptionService, categoryService,
                     copyProductService, customerActivityService, customerService,
                     discountService, downloadService, exportManager, importManager,
                     languageService, localizationService, localizedEntityService,
                     manufacturerService, fileProvider, notificationService,
                     pdfService, permissionService, pictureService, productAttributeParser,
                     productAttributeService, productAttributeFormatter, productModelFactory,
                     productService, productTagService, settingService, shippingService,
                     shoppingCartService, specificationAttributeService, storeContext,
                     urlRecordService, genericAttributeService, workContext, vendorSettings)
        {
            _genericAttributeService = genericAttributeService;
            _productService          = productService;
        }
Example #25
0
 public SimilarProductsSizesBlockViewComponent(IAclService aclService,
                                               IProductModelFactory productModelFactory,
                                               IProductService productService,
                                               ISpecificationAttributeService specificationAttributeService,
                                               IStoreContext storeContext,
                                               IStoreMappingService storeMappingService)
 {
     this._specificationAttributeService = specificationAttributeService;
     this._aclService          = aclService;
     this._productModelFactory = productModelFactory;
     this._productService      = productService;
     this._storeContext        = storeContext;
     this._storeMappingService = storeMappingService;
 }
 public SpecificationAttributeController(ICustomerActivityService customerActivityService,
                                         ILocalizationService localizationService,
                                         ILocalizedEntityService localizedEntityService,
                                         IPermissionService permissionService,
                                         ISpecificationAttributeModelFactory specificationAttributeModelFactory,
                                         ISpecificationAttributeService specificationAttributeService)
 {
     this._customerActivityService            = customerActivityService;
     this._localizationService                = localizationService;
     this._localizedEntityService             = localizedEntityService;
     this._permissionService                  = permissionService;
     this._specificationAttributeModelFactory = specificationAttributeModelFactory;
     this._specificationAttributeService      = specificationAttributeService;
 }
 public ProductController(IProductService productService, 
     IProductTemplateService productTemplateService,
     ICategoryService categoryService, IManufacturerService manufacturerService,
     ICustomerService customerService,
     IUrlRecordService urlRecordService, IWorkContext workContext, ILanguageService languageService,
     ILocalizationService localizationService, ILocalizedEntityService localizedEntityService,
     ISpecificationAttributeService specificationAttributeService, IPictureService pictureService,
     ITaxCategoryService taxCategoryService, IProductTagService productTagService,
     ICopyProductService copyProductService, IPdfService pdfService,
     IExportManager exportManager, IImportManager importManager,
     ICustomerActivityService customerActivityService,
     IPermissionService permissionService, IAclService aclService,
     IStoreService storeService, IStoreMappingService storeMappingService,
     IVendorService vendorService,
     ICurrencyService currencyService, CurrencySettings currencySettings,
     IMeasureService measureService, MeasureSettings measureSettings,
     PdfSettings pdfSettings, AdminAreaSettings adminAreaSettings)
 {
     this._productService = productService;
     this._productTemplateService = productTemplateService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._customerService = customerService;
     this._urlRecordService = urlRecordService;
     this._workContext = workContext;
     this._languageService = languageService;
     this._localizationService = localizationService;
     this._localizedEntityService = localizedEntityService;
     this._specificationAttributeService = specificationAttributeService;
     this._pictureService = pictureService;
     this._taxCategoryService = taxCategoryService;
     this._productTagService = productTagService;
     this._copyProductService = copyProductService;
     this._pdfService = pdfService;
     this._exportManager = exportManager;
     this._importManager = importManager;
     this._customerActivityService = customerActivityService;
     this._permissionService = permissionService;
     this._aclService = aclService;
     this._storeService = storeService;
     this._storeMappingService = storeMappingService;
     this._vendorService = vendorService;
     this._currencyService = currencyService;
     this._currencySettings = currencySettings;
     this._measureService = measureService;
     this._measureSettings = measureSettings;
     this._pdfSettings = pdfSettings;
     this._adminAreaSettings = adminAreaSettings;
 }
Example #28
0
 public CatalogSearchQueryAliasMapper(
     ICacheManager cacheManager,
     IRepository <LocalizedProperty> localizedPropertyRepository,
     IRepository <ProductVariantAttributeValue> productVariantAttributeValueRepository,
     ISpecificationAttributeService specificationAttributeService,
     ISettingService settingService,
     ILanguageService languageService)
 {
     _cacheManager = cacheManager;
     _localizedPropertyRepository            = localizedPropertyRepository;
     _productVariantAttributeValueRepository = productVariantAttributeValueRepository;
     _specificationAttributeService          = specificationAttributeService;
     _settingService  = settingService;
     _languageService = languageService;
 }
Example #29
0
 public SpecificationAttributeController(ISpecificationAttributeService specificationAttributeService,
                                         ILanguageService languageService,
                                         ILocalizedEntityService localizedEntityService,
                                         ILocalizationService localizationService,
                                         ICustomerActivityService customerActivityService,
                                         IPermissionService permissionService, IProductService productService)
 {
     this._specificationAttributeService = specificationAttributeService;
     this._languageService         = languageService;
     this._localizedEntityService  = localizedEntityService;
     this._localizationService     = localizationService;
     this._customerActivityService = customerActivityService;
     this._permissionService       = permissionService;
     this._productService          = productService;
 }
Example #30
0
 public ImportManager(CatalogSettings catalogSettings,
                      ICategoryService categoryService,
                      ICountryService countryService,
                      ICustomerActivityService customerActivityService,
                      IDataProvider dataProvider,
                      IEncryptionService encryptionService,
                      ILocalizationService localizationService,
                      ILogger logger,
                      IManufacturerService manufacturerService,
                      IMeasureService measureService,
                      INewsLetterSubscriptionService newsLetterSubscriptionService,
                      IGSFileProvider fileProvider,
                      IPictureService pictureService,
                      IServiceScopeFactory serviceScopeFactory,
                      ISpecificationAttributeService specificationAttributeService,
                      IStateProvinceService stateProvinceService,
                      IStoreContext storeContext,
                      IStoreMappingService storeMappingService,
                      IUrlRecordService urlRecordService,
                      IVendorService vendorService,
                      IWorkContext workContext,
                      MediaSettings mediaSettings,
                      VendorSettings vendorSettings)
 {
     this._catalogSettings         = catalogSettings;
     this._categoryService         = categoryService;
     this._countryService          = countryService;
     this._customerActivityService = customerActivityService;
     this._dataProvider            = dataProvider;
     this._encryptionService       = encryptionService;
     this._fileProvider            = fileProvider;
     this._localizationService     = localizationService;
     this._logger = logger;
     this._manufacturerService           = manufacturerService;
     this._measureService                = measureService;
     this._newsLetterSubscriptionService = newsLetterSubscriptionService;
     this._pictureService                = pictureService;
     this._serviceScopeFactory           = serviceScopeFactory;
     this._specificationAttributeService = specificationAttributeService;
     this._stateProvinceService          = stateProvinceService;
     this._storeContext        = storeContext;
     this._storeMappingService = storeMappingService;
     this._urlRecordService    = urlRecordService;
     this._vendorService       = vendorService;
     this._workContext         = workContext;
     this._mediaSettings       = mediaSettings;
     this._vendorSettings      = vendorSettings;
 }
        public CatalogController(
			ICommonServices services,
			ICategoryService categoryService,
            IManufacturerService manufacturerService, 
			IProductService productService,
            ICategoryTemplateService categoryTemplateService,
            IManufacturerTemplateService manufacturerTemplateService,
			ICurrencyService currencyService,
			IOrderReportService orderReportService,
			IProductTagService productTagService,
			IRecentlyViewedProductsService recentlyViewedProductsService,
            IPictureService pictureService,
            IPriceFormatter priceFormatter,
            ISpecificationAttributeService specificationAttributeService,
			ICompareProductsService compareProductsService,
			IGenericAttributeService genericAttributeService,
			IAclService aclService,
			IStoreMappingService storeMappingService,
            MediaSettings mediaSettings, 
			CatalogSettings catalogSettings,
			IFilterService filterService,
 			CatalogHelper helper)
        {
            this._services = services;
            this._categoryService = categoryService;
            this._manufacturerService = manufacturerService;
            this._productService = productService;
            this._categoryTemplateService = categoryTemplateService;
            this._manufacturerTemplateService = manufacturerTemplateService;
            this._currencyService = currencyService;
            this._orderReportService = orderReportService;
            this._productTagService = productTagService;
            this._recentlyViewedProductsService = recentlyViewedProductsService;
            this._compareProductsService = compareProductsService;
            this._pictureService = pictureService;
            this._priceFormatter = priceFormatter;
            this._specificationAttributeService = specificationAttributeService;
            this._genericAttributeService = genericAttributeService;
            this._aclService = aclService;
            this._storeMappingService = storeMappingService;
            this._filterService = filterService;
            this._mediaSettings = mediaSettings;
            this._catalogSettings = catalogSettings;

            this._helper = helper;

            T = NullLocalizer.Instance;
        }
 public BaseAdminModelFactory(ICategoryService categoryService,
                              ICategoryTemplateService categoryTemplateService,
                              ICountryService countryService,
                              ICurrencyService currencyService,
                              ICustomerActivityService customerActivityService,
                              ICustomerService customerService,
                              IDateRangeService dateRangeService,
                              IDateTimeHelper dateTimeHelper,
                              IEmailAccountService emailAccountService,
                              ILanguageService languageService,
                              ILocalizationService localizationService,
                              IManufacturerService manufacturerService,
                              IManufacturerTemplateService manufacturerTemplateService,
                              IPluginService pluginService,
                              IProductTemplateService productTemplateService,
                              ISpecificationAttributeService specificationAttributeService,
                              IShippingService shippingService,
                              IStateProvinceService stateProvinceService,
                              IStaticCacheManager staticCacheManager,
                              IStoreService storeService,
                              ITaxCategoryService taxCategoryService,
                              ITopicTemplateService topicTemplateService,
                              IVendorService vendorService)
 {
     _categoryService             = categoryService;
     _categoryTemplateService     = categoryTemplateService;
     _countryService              = countryService;
     _currencyService             = currencyService;
     _customerActivityService     = customerActivityService;
     _customerService             = customerService;
     _dateRangeService            = dateRangeService;
     _dateTimeHelper              = dateTimeHelper;
     _emailAccountService         = emailAccountService;
     _languageService             = languageService;
     _localizationService         = localizationService;
     _manufacturerService         = manufacturerService;
     _manufacturerTemplateService = manufacturerTemplateService;
     _pluginService                 = pluginService;
     _productTemplateService        = productTemplateService;
     _specificationAttributeService = specificationAttributeService;
     _shippingService               = shippingService;
     _stateProvinceService          = stateProvinceService;
     _staticCacheManager            = staticCacheManager;
     _storeService         = storeService;
     _taxCategoryService   = taxCategoryService;
     _topicTemplateService = topicTemplateService;
     _vendorService        = vendorService;
 }
 public SpecificationAttributesController(ICustomerService customerService,
                                          ILanguageService languageService,
                                          ISettingService settingService,
                                          IStoreService storeService,
                                          IWorkContext workContext,
                                          ILocalizationService localizationService,
                                          IGenericAttributeService genericAttributeService,
                                          IVendorService vendorService,
                                          IProductService productService,
                                          IStoreContext storeContext,
                                          ISpecificationAttributeService specificationAttributeService,
                                          IWebHelper webHelper,
                                          IPriceFormatter priceFormatter,
                                          ICurrencyService currencyService,
                                          CatalogSettings catalogSettings,
                                          ICategoryService categoryService,
                                          ICacheManager cacheManager,
                                          MediaSettings mediaSettings,
                                          IPriceCalculationService priceCalculationService,
                                          IPermissionService permissionService,
                                          ITaxService taxService,
                                          IPictureService pictureService,
                                          IMeasureService measureService)
 {
     _customerService               = customerService;
     _languageService               = languageService;
     _settingService                = settingService;
     _storeService                  = storeService;
     _localizationService           = localizationService;
     _workContext                   = workContext;
     _genericAttributeService       = genericAttributeService;
     _vendorService                 = vendorService;
     _productService                = productService;
     _storeContext                  = storeContext;
     _specificationAttributeService = specificationAttributeService;
     _webHelper               = webHelper;
     _priceFormatter          = priceFormatter;
     _currencyService         = currencyService;
     _catalogSettings         = catalogSettings;
     _categoryService         = categoryService;
     _cacheManager            = cacheManager;
     _mediaSettings           = mediaSettings;
     _priceCalculationService = priceCalculationService;
     _permissionService       = permissionService;
     _taxService              = taxService;
     _pictureService          = pictureService;
     _measureService          = measureService;
 }
Example #34
0
        //private readonly ISpecificationAttributeService _specificationAttributeService;

        public LoadFilters(
            IStoreContext storeContext,
            IPluginFinder pluginFinder,
            IProductAttributeParser productAttributeParser,
            IProductService productService,
            ISpecificationAttributeService specificationAttributeService,
            IWorkContext workContext,
            IOrderService orderService)
        {
            this._storeContext           = storeContext;
            this._pluginFinder           = pluginFinder;
            this._productAttributeParser = productAttributeParser;
            this._productService         = productService;
            this._workContext            = workContext;
            this._orderService           = orderService;
        }
 public SpecificationAttributeController(IBaseService baseService, ILogger logger, IWebHelper webHelper,
                                         ISpecificationAttributeService specificationAttributeService,
                                         ILanguageService languageService,
                                         ILocalizedEntityService localizedEntityService,
                                         ILocalizationService localizationService,
                                         ICustomerActivityService customerActivityService,
                                         IPermissionService permissionService)
     : base(baseService, logger, webHelper)
 {
     this._specificationAttributeService = specificationAttributeService;
     this._languageService         = languageService;
     this._localizedEntityService  = localizedEntityService;
     this._localizationService     = localizationService;
     this._customerActivityService = customerActivityService;
     this._permissionService       = permissionService;
 }
Example #36
0
        public void AddUpdateProductsToNebim(IList <Product> products)
        {
            var nebimIntegrationProvider = LoadNebimIntegrationServiceBySystemName("Misc.Nebim");
            IProductAttributeParser        productAttributeParser        = EngineContext.Current.Resolve <IProductAttributeParser>();
            ITaxService                    taxService                    = EngineContext.Current.Resolve <ITaxService>();
            IWorkContext                   workContext                   = EngineContext.Current.Resolve <IWorkContext>();
            ISpecificationAttributeService specificationAttributeService = EngineContext.Current.Resolve <ISpecificationAttributeService>();

            foreach (var pv in products)
            {
                AddUpdateProductToNebim(pv);
            }


            // we had better add some document properties to the spreadsheet
        }
Example #37
0
 public SpecificationAttributesController(IJsonFieldsSerializer jsonFieldsSerializer,
                                          ICustomerActivityService customerActivityService,
                                          ILocalizationService localizationService,
                                          IAclService aclService,
                                          IStoreMappingService storeMappingService,
                                          IStoreService storeService,
                                          ICustomerService customerService,
                                          IDiscountService discountService,
                                          IPictureService pictureService,
                                          ISpecificationAttributeService specificationAttributeService,
                                          ISpecificationAttributeApiService specificationAttributesApiService,
                                          IDTOHelper dtoHelper) : base(jsonFieldsSerializer, aclService, customerService, storeMappingService, storeService, discountService, customerActivityService, localizationService, pictureService)
 {
     _specificationAttributeService    = specificationAttributeService;
     _specificationAttributeApiService = specificationAttributesApiService;
     _dtoHelper = dtoHelper;
 }
Example #38
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
        }
Example #39
0
        public static IList<ProductSpecificationModel> PrepareProductSpecificationModel(this Controller controller,
            IWorkContext workContext,
            ISpecificationAttributeService specificationAttributeService,
            ICacheManager cacheManager,
            Product product)
        {
            if (product == null)
                throw new ArgumentNullException("product");

            string cacheKey = string.Format(ModelCacheEventConsumer.PRODUCT_SPECS_MODEL_KEY, product.Id, workContext.WorkingLanguage.Id);
            return cacheManager.Get(cacheKey, () =>
                specificationAttributeService.GetProductSpecificationAttributes(product.Id, 0, null, true)
                .Select(psa =>
                {
                    var m = new ProductSpecificationModel
                    {
                        SpecificationAttributeId = psa.SpecificationAttributeOption.SpecificationAttributeId,
                        SpecificationAttributeName = psa.SpecificationAttributeOption.SpecificationAttribute.GetLocalized(x => x.Name),
                        ColorSquaresRgb = psa.SpecificationAttributeOption.ColorSquaresRgb
                    };

                    switch (psa.AttributeType)
                    {
                        case SpecificationAttributeType.Option:
                            m.ValueRaw = HttpUtility.HtmlEncode(psa.SpecificationAttributeOption.GetLocalized(x => x.Name));
                            break;
                        case SpecificationAttributeType.CustomText:
                            m.ValueRaw = HttpUtility.HtmlEncode(psa.CustomValue);
                            break;
                        case SpecificationAttributeType.CustomHtmlText:
                            m.ValueRaw = psa.CustomValue;
                            break;
                        case SpecificationAttributeType.Hyperlink:
                            m.ValueRaw = string.Format("<a href='{0}' target='_blank'>{0}</a>", psa.CustomValue);
                            break;
                        default:
                            break;
                    }
                    return m;
                }).ToList()
            );
        }
Example #40
0
        //product service
        //image service
        //specification attribute service
        //category service ?
        //manufacturers services ?
        //ILocalizationService
        //ICustomerActivityService
        //Tag Services

        public ProductResolver(IProductService productService, IProductTagService tagService,
            ISpecificationAttributeService attributeService,
            ICategoryService categoryService, IManufacturerService manufacturerService, IPictureService pictureService,
            IUrlRecordService urlRecordService, ILogger logger)
        {
            if (productService == null) throw new ArgumentNullException("productService");
            if (pictureService == null) throw new ArgumentNullException("pictureService");
            if (tagService == null) throw new ArgumentNullException("tagService");
            if (attributeService == null) throw new ArgumentNullException("attributeService");
            if (categoryService == null) throw new ArgumentNullException("categoryService");
            if (manufacturerService == null) throw new ArgumentNullException("manufacturerService");
            if (urlRecordService == null) throw new ArgumentNullException("urlRecordService");

            _productService = productService;
            _tagService = tagService;
            _attributeService = attributeService;
            _categoryService = categoryService;
            _manufacturerService = manufacturerService;
            _pictureService = pictureService;
            _urlRecordService = urlRecordService;
            _logger = logger;
        }
 public CollectibleImportService(IProductService productService, 
      ISpecificationAttributeService specificationAttributeService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IPictureService pictureService,
     IUrlRecordService urlRecordService,
     IStoreContext storeContext,
     INewsLetterSubscriptionService newsLetterSubscriptionService,
     ICountryService countryService,   //not used
     IStateProvinceService stateProvinceService,
     IConsignorService consignorService,
     IAuthenticationService authenticationService,
     ILogger logger,
     IRepository<AUCountryLotRecord> countrylotRepo,
     IRepository<AUStateProvinceLotRecord> stateprovincelotRepo,
     IRepository<SpecificationAttribute> specificationAttributeRepo,
      IRepository<SpecificationAttributeOption> specificationAttributeOptionRepo
     )
 {
     this._productService = productService;
     this._specificationAttributeService = specificationAttributeService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._pictureService = pictureService;
     this._urlRecordService = urlRecordService;
     this._storeContext = storeContext;
     this._newsLetterSubscriptionService = newsLetterSubscriptionService;
     this._countryService = countryService;
     this._stateProvinceService = stateProvinceService;
     this._consignorService = consignorService;
     this._authenticationService = authenticationService;
     this._logger = logger;                          //NJM: AUConsignor
     this._countrylotRepo = countrylotRepo;
     this._stateprovincelotRepo = stateprovincelotRepo;
     this._specificationAttributeRepo = specificationAttributeRepo;
     this._specificationAttributeOptionRepo = specificationAttributeOptionRepo;
 }
 public GroupDealsController(
     IProductService productService,
     IProductTemplateService productTemplateService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     ICustomerService customerService,
     IUrlRecordService urlRecordService,
     IWorkContext workContext,
     ILanguageService languageService,
     ILocalizationService localizationService,
     ILocalizedEntityService localizedEntityService,
     ISpecificationAttributeService specificationAttributeService,
     IPictureService pictureService,
     ITaxCategoryService taxCategoryService,
     IProductTagService productTagService,
     ICopyProductService copyProductService,
     IPdfService pdfService,
     IExportManager exportManager,
     IImportManager importManager,
     ICustomerActivityService customerActivityService,
     IPermissionService permissionService,
     IAclService aclService,
     IStoreService storeService,
     IOrderService orderService,
     IStoreMappingService storeMappingService,
     IVendorService vendorService,
     IShippingService shippingService,
     IShipmentService shipmentService,
     ICurrencyService currencyService,
     CurrencySettings currencySettings,
     IMeasureService measureService,
     MeasureSettings measureSettings,
     AdminAreaSettings adminAreaSettings,
     IDateTimeHelper dateTimeHelper,
     IDiscountService discountService,
     IProductAttributeService productAttributeService,
     IBackInStockSubscriptionService backInStockSubscriptionService,
     IShoppingCartService shoppingCartService,
     IProductAttributeFormatter productAttributeFormatter,
     IProductAttributeParser productAttributeParser,
     IDownloadService downloadService,
     IRepository<GroupDeal> groupDealRepo,
     IRepository<GroupdealPicture> groupdealPictureRepo,
     IGroupDealService groupdealService,
     IGenericAttributeService genericAttributeService)
     : base(productService,
     productTemplateService,
     categoryService,
     manufacturerService,
     customerService,
     urlRecordService,
     workContext,
     languageService,
     localizationService,
     localizedEntityService,
     specificationAttributeService,
     pictureService,
     taxCategoryService,
     productTagService,
     copyProductService,
     pdfService,
     exportManager,
     importManager,
     customerActivityService,
     permissionService,
     aclService,
     storeService,
     orderService,
     storeMappingService,
     vendorService,
     shippingService,
     shipmentService,
     currencyService,
     currencySettings,
     measureService,
     measureSettings,
     adminAreaSettings,
     dateTimeHelper,
     discountService,
     productAttributeService,
     backInStockSubscriptionService,
     shoppingCartService,
     productAttributeFormatter,
     productAttributeParser,
     downloadService,
     groupDealRepo,
     groupdealPictureRepo,
     groupdealService,
     genericAttributeService)
 { }
        public CatalogController(ICommonServices services,
			ICategoryService categoryService,
            IManufacturerService manufacturerService, IProductService productService,
            IProductTemplateService productTemplateService,
            ICategoryTemplateService categoryTemplateService,
            IManufacturerTemplateService manufacturerTemplateService,
            IProductAttributeService productAttributeService, IProductAttributeParser productAttributeParser,
			IProductAttributeFormatter productAttributeFormatter,
			ITaxService taxService, ICurrencyService currencyService,
            IPictureService pictureService,
            IPriceCalculationService priceCalculationService, IPriceFormatter priceFormatter,
            ISpecificationAttributeService specificationAttributeService,
            ICustomerContentService customerContentService, IDateTimeHelper dateTimeHelper,
            IShoppingCartService shoppingCartService,
            IRecentlyViewedProductsService recentlyViewedProductsService, ICompareProductsService compareProductsService,
            IWorkflowMessageService workflowMessageService, IProductTagService productTagService,
            IOrderReportService orderReportService, IGenericAttributeService genericAttributeService,
            IBackInStockSubscriptionService backInStockSubscriptionService, IAclService aclService,
			IStoreMappingService storeMappingService,
            IPermissionService permissionService, IDownloadService downloadService,
            MediaSettings mediaSettings, CatalogSettings catalogSettings,
            ShoppingCartSettings shoppingCartSettings,
            LocalizationSettings localizationSettings, CustomerSettings customerSettings,
			CurrencySettings currencySettings,
            CaptchaSettings captchaSettings,
            /* codehint: sm-add */
            IMeasureService measureService, MeasureSettings measureSettings, TaxSettings taxSettings, IFilterService filterService,
            IDeliveryTimeService deliveryTimeService, ISettingService settingService,
			ICustomerActivityService customerActivityService
            )
        {
			this._services = services;
			this._categoryService = categoryService;
            this._manufacturerService = manufacturerService;
            this._productService = productService;
            this._productTemplateService = productTemplateService;
            this._categoryTemplateService = categoryTemplateService;
            this._manufacturerTemplateService = manufacturerTemplateService;
            this._productAttributeService = productAttributeService;
            this._productAttributeParser = productAttributeParser;
			this._productAttributeFormatter = productAttributeFormatter;
            this._workContext = _services.WorkContext;
			this._storeContext = _services.StoreContext;
            this._taxService = taxService;
            this._currencyService = currencyService;
            this._pictureService = pictureService;
            this._localizationService = _services.Localization;
            this._priceCalculationService = priceCalculationService;
            this._priceFormatter = priceFormatter;
            this._webHelper = _services.WebHelper;
            this._specificationAttributeService = specificationAttributeService;
            this._customerContentService = customerContentService;
            this._dateTimeHelper = dateTimeHelper;
            this._shoppingCartService = shoppingCartService;
            this._recentlyViewedProductsService = recentlyViewedProductsService;
            this._compareProductsService = compareProductsService;
            this._workflowMessageService = workflowMessageService;
            this._productTagService = productTagService;
            this._orderReportService = orderReportService;
            this._genericAttributeService = genericAttributeService;
            this._backInStockSubscriptionService = backInStockSubscriptionService;
            this._aclService = aclService;
			this._storeMappingService = storeMappingService;
            this._permissionService = permissionService;
            this._downloadService = downloadService;
			this._customerActivityService = customerActivityService;

            //codehint: sm-edit begin
            this._measureService = measureService;
            this._measureSettings = measureSettings;
            this._taxSettings = taxSettings;
            this._filterService = filterService;
            this._deliveryTimeService = deliveryTimeService;
            this._dbContext = _services.DbContext;
            this._settingService = settingService;
            this._eventPublisher = _services.EventPublisher;
            //codehint: sm-edit end

            this._mediaSettings = mediaSettings;
            this._catalogSettings = catalogSettings;
            this._shoppingCartSettings = shoppingCartSettings;
            this._localizationSettings = localizationSettings;
            this._customerSettings = customerSettings;
            this._captchaSettings = captchaSettings;
			this._currencySettings = currencySettings;
            this._cacheManager = _services.Cache;

			T = NullLocalizer.Instance;
        }
 public ProductController(IProductService productService, 
     IProductTemplateService productTemplateService,
     ICategoryService categoryService, 
     IManufacturerService manufacturerService,
     ICustomerService customerService,
     IUrlRecordService urlRecordService, 
     IWorkContext workContext, 
     ILanguageService languageService, 
     ILocalizationService localizationService, 
     ILocalizedEntityService localizedEntityService,
     ISpecificationAttributeService specificationAttributeService, 
     IPictureService pictureService,
     ITaxCategoryService taxCategoryService, 
     IProductTagService productTagService,
     ICopyProductService copyProductService, 
     IPdfService pdfService,
     IExportManager exportManager, 
     IImportManager importManager,
     ICustomerActivityService customerActivityService,
     IPermissionService permissionService, 
     IAclService aclService,
     IStoreService storeService,
     IOrderService orderService,
     IStoreMappingService storeMappingService,
      IVendorService vendorService,
     IShippingService shippingService,
     IShipmentService shipmentService,
     ICurrencyService currencyService, 
     CurrencySettings currencySettings,
     IMeasureService measureService,
     MeasureSettings measureSettings,
     AdminAreaSettings adminAreaSettings,
     IDateTimeHelper dateTimeHelper,
     IDiscountService discountService,
     IProductAttributeService productAttributeService,
     IBackInStockSubscriptionService backInStockSubscriptionService,
     IShoppingCartService shoppingCartService,
     IProductAttributeFormatter productAttributeFormatter,
     IProductAttributeParser productAttributeParser,
     IDownloadService downloadService)
 {
     this._productService = productService;
     this._productTemplateService = productTemplateService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._customerService = customerService;
     this._urlRecordService = urlRecordService;
     this._workContext = workContext;
     this._languageService = languageService;
     this._localizationService = localizationService;
     this._localizedEntityService = localizedEntityService;
     this._specificationAttributeService = specificationAttributeService;
     this._pictureService = pictureService;
     this._taxCategoryService = taxCategoryService;
     this._productTagService = productTagService;
     this._copyProductService = copyProductService;
     this._pdfService = pdfService;
     this._exportManager = exportManager;
     this._importManager = importManager;
     this._customerActivityService = customerActivityService;
     this._permissionService = permissionService;
     this._aclService = aclService;
     this._storeService = storeService;
     this._orderService = orderService;
     this._storeMappingService = storeMappingService;
     this._vendorService = vendorService;
     this._shippingService = shippingService;
     this._shipmentService = shipmentService;
     this._currencyService = currencyService;
     this._currencySettings = currencySettings;
     this._measureService = measureService;
     this._measureSettings = measureSettings;
     this._adminAreaSettings = adminAreaSettings;
     this._dateTimeHelper = dateTimeHelper;
     this._discountService = discountService;
     this._productAttributeService = productAttributeService;
     this._backInStockSubscriptionService = backInStockSubscriptionService;
     this._shoppingCartService = shoppingCartService;
     this._productAttributeFormatter = productAttributeFormatter;
     this._productAttributeParser = productAttributeParser;
     this._downloadService = downloadService;
 }
            protected virtual IList<SpecificationAttributeOptionFilter> GetNotFilteredSpecs(int categoryId, 
                ISpecificationAttributeService specificationAttributeService, IWebHelper webHelper, IWorkContext workContext)
            {
                //get all
                var result = specificationAttributeService.GetSpecificationAttributeOptionFilter(categoryId, workContext);

                //remove already filtered
                var alreadyFilteredOptions = GetAlreadyFilteredSpecs(specificationAttributeService, webHelper, workContext);
                foreach (var saof1 in alreadyFilteredOptions)
                {
                    var query = from s in result
                                where s.SpecificationAttributeId == saof1.SpecificationAttributeId
                                select s;

                    var toRemove = query.ToList();
                    foreach (var saof2 in toRemove)
                        result.Remove(saof2);
                }
                return result;
            }
 public CatalogController(ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IProductService productService,
     IVendorService vendorService,
     ICategoryTemplateService categoryTemplateService,
     IManufacturerTemplateService manufacturerTemplateService,
     IWorkContext workContext,
     IStoreContext storeContext,
     ITaxService taxService,
     ICurrencyService currencyService,
     IPictureService pictureService,
     ILocalizationService localizationService,
     IPriceCalculationService priceCalculationService,
     IPriceFormatter priceFormatter,
     IWebHelper webHelper,
     ISpecificationAttributeService specificationAttributeService,
     IProductTagService productTagService,
     IGenericAttributeService genericAttributeService,
     IAclService aclService,
     IStoreMappingService storeMappingService,
     IPermissionService permissionService,
     ICustomerActivityService customerActivityService,
     ITopicService topicService,
     IEventPublisher eventPublisher,
     ISearchTermService searchTermService,
     MediaSettings mediaSettings,
     CatalogSettings catalogSettings,
     VendorSettings vendorSettings,
     BlogSettings blogSettings,
     ForumSettings forumSettings,
     ICacheManager cacheManager)
     : base (categoryService,
     manufacturerService,
     productService,
     vendorService,
     categoryTemplateService,
     manufacturerTemplateService,
     workContext,
     storeContext,
     taxService,
     currencyService,
     pictureService,
     localizationService,
     priceCalculationService,
     priceFormatter,
     webHelper,
     specificationAttributeService,
     productTagService,
     genericAttributeService,
     aclService,
     storeMappingService,
     permissionService,
     customerActivityService,
     topicService,
     eventPublisher,
     searchTermService,
     mediaSettings,
     catalogSettings,
     vendorSettings,
     blogSettings,
      forumSettings,
     cacheManager)
 {
 }
            protected virtual IList<SpecificationAttributeOptionFilter> GetAlreadyFilteredSpecs(ISpecificationAttributeService specificationAttributeService, 
                IWebHelper webHelper, IWorkContext workContext)
            {
                var result = new List<SpecificationAttributeOptionFilter>();

                var optionIds = GetAlreadyFilteredSpecOptionIds(webHelper);
                foreach (var id in optionIds)
                {
                    var sao = specificationAttributeService.GetSpecificationAttributeOptionById(id);
                    if (sao != null)
                    {
                        var sa = sao.SpecificationAttribute;
                        if (sa != null)
                        {
                            result.Add(new SpecificationAttributeOptionFilter
                            {
                                SpecificationAttributeId = sa.Id,
                                SpecificationAttributeName = sa.GetLocalized(x => x.Name),
                                DisplayOrder = sa.DisplayOrder,
                                SpecificationAttributeOptionId = sao.Id,
                                SpecificationAttributeOptionName = sao.GetLocalized(x => x.Name)
                            });
                        }
                    }
                }

                return result;
            }
            public virtual void PrepareSpecsFilters(IList<string> alreadyFilteredSpecOptionIds,
                IList<string> filterableSpecificationAttributeOptionIds,
                ISpecificationAttributeService specificationAttributeService, 
                IWebHelper webHelper,
                IWorkContext workContext,
                ICacheManager cacheManager)
            {
                string cacheKey = string.Format(ModelCacheEventConsumer.SPECS_FILTER_MODEL_KEY,
                    filterableSpecificationAttributeOptionIds != null ? string.Join(",", filterableSpecificationAttributeOptionIds) : "",
                    workContext.WorkingLanguage.Id);

                var allFilters = cacheManager.Get(cacheKey, () =>
                {
                    var _allFilters = new List<SpecificationAttributeOptionFilter>();
                    foreach (var sao in filterableSpecificationAttributeOptionIds)
                    {
                        int _specificationAttributeId = Convert.ToInt32(sao.Split(':').FirstOrDefault().ToString());
                        int _specificationAttributeOptionId = Convert.ToInt32(sao.Split(':').LastOrDefault().ToString());
                        var sa = EngineContext.Current.Resolve<ISpecificationAttributeService>().GetSpecificationAttributeById(_specificationAttributeId);
                        if (sa != null)
                        {
                            _allFilters.Add(new SpecificationAttributeOptionFilter
                            {
                                SpecificationAttributeId = sa.Id,
                                SpecificationAttributeName = sa.GetLocalized(x => x.Name, workContext.WorkingLanguage.Id),
                                SpecificationAttributeDisplayOrder = sa.DisplayOrder,
                                SpecificationAttributeOptionId = sao, //_specificationAttributeOptionId.ToString(),  //sa.SpecificationAttributeOptions.FirstOrDefault(x=>x.Id == ),
                                SpecificationAttributeOptionName = sa.SpecificationAttributeOptions.FirstOrDefault(x => x.Id == _specificationAttributeOptionId).GetLocalized(x => x.Name, workContext.WorkingLanguage.Id),
                                SpecificationAttributeOptionDisplayOrder = sa.SpecificationAttributeOptions.FirstOrDefault(x => x.Id == _specificationAttributeOptionId).DisplayOrder
                            });
                        }
                    }
                    return _allFilters.ToList();
                });

                //sort loaded options
                allFilters = allFilters.OrderBy(saof => saof.SpecificationAttributeDisplayOrder)
                    .ThenBy(saof => saof.SpecificationAttributeName)
                    .ThenBy(saof => saof.SpecificationAttributeOptionDisplayOrder)
                    .ThenBy(saof => saof.SpecificationAttributeOptionName).ToList();

                //get already filtered specification options
                var alreadyFilteredOptions = allFilters
                    .Where(x => alreadyFilteredSpecOptionIds.Contains(x.SpecificationAttributeOptionId))
                    .Select(x => x)
                    .ToList();

                //get not filtered specification options
                var notFilteredOptions = new List<SpecificationAttributeOptionFilter>();
                foreach (var saof in allFilters)
                {
                    //do not add already filtered specification options
                    if (alreadyFilteredOptions.FirstOrDefault(x => x.SpecificationAttributeId == saof.SpecificationAttributeId) != null)
                        continue;

                    //else add it
                    notFilteredOptions.Add(saof);
                }

                //prepare the model properties
                if (alreadyFilteredOptions.Count > 0 || notFilteredOptions.Count > 0)
                {
                    this.Enabled = true;

                    this.AlreadyFilteredItems = alreadyFilteredOptions.ToList().Select(x =>
                    {
                        var item = new SpecificationFilterItem();
                        item.SpecificationAttributeName = x.SpecificationAttributeName;
                        item.SpecificationAttributeOptionName = x.SpecificationAttributeOptionName;

                        return item;
                    }).ToList();

                    this.NotFilteredItems = notFilteredOptions.ToList().Select(x =>
                    {
                        var item = new SpecificationFilterItem();
                        item.SpecificationAttributeName = x.SpecificationAttributeName;
                        item.SpecificationAttributeOptionName = x.SpecificationAttributeOptionName;

                        //filter URL
                        var alreadyFilteredOptionIds = GetAlreadyFilteredSpecOptionIds(webHelper);
                        if (!alreadyFilteredOptionIds.Contains(x.SpecificationAttributeOptionId.ToString()))
                            alreadyFilteredOptionIds.Add(x.SpecificationAttributeOptionId.ToString());
                        string newQueryParam = GenerateFilteredSpecQueryParam(alreadyFilteredOptionIds);
                        string filterUrl = webHelper.ModifyQueryString(webHelper.GetThisPageUrl(true), QUERYSTRINGPARAM + "=" + newQueryParam, null);
                        filterUrl = ExcludeQueryStringParams(filterUrl, webHelper);
                        item.FilterUrl = filterUrl;

                        return item;
                    }).ToList();

                    //remove filter URL
                    string removeFilterUrl = webHelper.RemoveQueryString(webHelper.GetThisPageUrl(true), QUERYSTRINGPARAM);
                    removeFilterUrl = ExcludeQueryStringParams(removeFilterUrl, webHelper);
                    this.RemoveFilterUrl = removeFilterUrl;
                }
                else
                {
                    this.Enabled = false;
                }
            }
            public virtual void PrepareSpecsFilters(IList<int> alreadyFilteredSpecOptionIds,
                IList<int> filterableSpecificationAttributeOptionIds,
                ISpecificationAttributeService specificationAttributeService, 
                IWebHelper webHelper,
                IWorkContext workContext)
            {
                var allFilters = new List<SpecificationAttributeOptionFilter>();
                var specificationAttributeOptions = specificationAttributeService
                    .GetSpecificationAttributeOptionsByIds(filterableSpecificationAttributeOptionIds != null ?
                    filterableSpecificationAttributeOptionIds.ToArray() : null);
                foreach (var sao in specificationAttributeOptions)
                {
                    var sa = sao.SpecificationAttribute;
                    if (sa != null)
                    {
                        allFilters.Add(new SpecificationAttributeOptionFilter
                        {
                            SpecificationAttributeId = sa.Id,
                            SpecificationAttributeName = sa.GetLocalized(x => x.Name, workContext.WorkingLanguage.Id),
                            SpecificationAttributeDisplayOrder = sa.DisplayOrder,
                            SpecificationAttributeOptionId = sao.Id,
                            SpecificationAttributeOptionName = sao.GetLocalized(x => x.Name, workContext.WorkingLanguage.Id),
                            SpecificationAttributeOptionDisplayOrder = sao.DisplayOrder
                        });
                    }
                }

                //sort loaded options
                allFilters = allFilters.OrderBy(saof => saof.SpecificationAttributeDisplayOrder)
                    .ThenBy(saof => saof.SpecificationAttributeName)
                    .ThenBy(saof => saof.SpecificationAttributeOptionDisplayOrder)
                    .ThenBy(saof => saof.SpecificationAttributeOptionName).ToList();

                //get already filtered specification options
                var alreadyFilteredOptions = allFilters
                    .Where(x => alreadyFilteredSpecOptionIds.Contains(x.SpecificationAttributeOptionId))
                    .Select(x => x)
                    .ToList();

                //get not filtered specification options
                var notFilteredOptions = new List<SpecificationAttributeOptionFilter>();
                foreach (var saof in allFilters)
                {
                    //do not add already filtered specification options
                    if (alreadyFilteredOptions.FirstOrDefault(x => x.SpecificationAttributeId == saof.SpecificationAttributeId) != null)
                        continue;

                    //else add it
                    notFilteredOptions.Add(saof);
                }

                //prepare the model properties
                if (alreadyFilteredOptions.Count > 0 || notFilteredOptions.Count > 0)
                {
                    this.Enabled = true;

                    this.AlreadyFilteredItems = alreadyFilteredOptions.ToList().Select(x =>
                    {
                        var item = new SpecificationFilterItem();
                        item.SpecificationAttributeName = x.SpecificationAttributeName;
                        item.SpecificationAttributeOptionName = x.SpecificationAttributeOptionName;

                        return item;
                    }).ToList();

                    this.NotFilteredItems = notFilteredOptions.ToList().Select(x =>
                    {
                        var item = new SpecificationFilterItem();
                        item.SpecificationAttributeName = x.SpecificationAttributeName;
                        item.SpecificationAttributeOptionName = x.SpecificationAttributeOptionName;

                        //filter URL
                        var alreadyFilteredOptionIds = GetAlreadyFilteredSpecOptionIds(webHelper);
                        if (!alreadyFilteredOptionIds.Contains(x.SpecificationAttributeOptionId))
                            alreadyFilteredOptionIds.Add(x.SpecificationAttributeOptionId);
                        string newQueryParam = GenerateFilteredSpecQueryParam(alreadyFilteredOptionIds);
                        string filterUrl = webHelper.ModifyQueryString(webHelper.GetThisPageUrl(true), QUERYSTRINGPARAM + "=" + newQueryParam, null);
                        filterUrl = ExcludeQueryStringParams(filterUrl, webHelper);
                        item.FilterUrl = filterUrl;

                        return item;
                    }).ToList();

                    //remove filter URL
                    string removeFilterUrl = webHelper.RemoveQueryString(webHelper.GetThisPageUrl(true), QUERYSTRINGPARAM);
                    removeFilterUrl = ExcludeQueryStringParams(removeFilterUrl, webHelper);
                    this.RemoveFilterUrl = removeFilterUrl;
                }
                else
                {
                    this.Enabled = false;
                }
            }
 public ProductController(ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IProductService productService,
     IVendorService vendorService,
     IProductTemplateService productTemplateService,
     IProductAttributeService productAttributeService,
     IWorkContext workContext,
     IStoreContext storeContext,
     ITaxService taxService,
     ICurrencyService currencyService,
     IPictureService pictureService,
     ILocalizationService localizationService,
     IMeasureService measureService,
     IPriceCalculationService priceCalculationService,
     IPriceFormatter priceFormatter,
     IWebHelper webHelper,
     ISpecificationAttributeService specificationAttributeService,
     IDateTimeHelper dateTimeHelper,
     IRecentlyViewedProductsService recentlyViewedProductsService,
     ICompareProductsService compareProductsService,
     IWorkflowMessageService workflowMessageService,
     IProductTagService productTagService,
     IOrderReportService orderReportService,
     IAclService aclService,
     IStoreMappingService storeMappingService,
     IPermissionService permissionService,
     IDownloadService downloadService,
     ICustomerActivityService customerActivityService,
     IProductAttributeParser productAttributeParser,
     IShippingService shippingService,
     IEventPublisher eventPublisher,
     MediaSettings mediaSettings,
     CatalogSettings catalogSettings,
     VendorSettings vendorSettings,
     ShoppingCartSettings shoppingCartSettings,
     LocalizationSettings localizationSettings,
     CustomerSettings customerSettings,
     CaptchaSettings captchaSettings,
     SeoSettings seoSettings,
     ICacheManager cacheManager)
 {
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._productService = productService;
     this._vendorService = vendorService;
     this._productTemplateService = productTemplateService;
     this._productAttributeService = productAttributeService;
     this._workContext = workContext;
     this._storeContext = storeContext;
     this._taxService = taxService;
     this._currencyService = currencyService;
     this._pictureService = pictureService;
     this._localizationService = localizationService;
     this._measureService = measureService;
     this._priceCalculationService = priceCalculationService;
     this._priceFormatter = priceFormatter;
     this._webHelper = webHelper;
     this._specificationAttributeService = specificationAttributeService;
     this._dateTimeHelper = dateTimeHelper;
     this._recentlyViewedProductsService = recentlyViewedProductsService;
     this._compareProductsService = compareProductsService;
     this._workflowMessageService = workflowMessageService;
     this._productTagService = productTagService;
     this._orderReportService = orderReportService;
     this._aclService = aclService;
     this._storeMappingService = storeMappingService;
     this._permissionService = permissionService;
     this._downloadService = downloadService;
     this._customerActivityService = customerActivityService;
     this._productAttributeParser = productAttributeParser;
     this._shippingService = shippingService;
     this._eventPublisher = eventPublisher;
     this._mediaSettings = mediaSettings;
     this._catalogSettings = catalogSettings;
     this._vendorSettings = vendorSettings;
     this._shoppingCartSettings = shoppingCartSettings;
     this._localizationSettings = localizationSettings;
     this._customerSettings = customerSettings;
     this._captchaSettings = captchaSettings;
     this._seoSettings = seoSettings;
     this._cacheManager = cacheManager;
 }
Example #51
0
        public CatalogController(ICategoryService categoryService, 
            IManufacturerService manufacturerService, IProductService productService, 
            IProductTemplateService productTemplateService,
            ICategoryTemplateService categoryTemplateService,
            IManufacturerTemplateService manufacturerTemplateService,
            IProductAttributeService productAttributeService, IProductAttributeParser productAttributeParser, 
            IWorkContext workContext, ITaxService taxService, ICurrencyService currencyService,
            IPictureService pictureService, ILocalizationService localizationService,
            IPriceCalculationService priceCalculationService, IPriceFormatter priceFormatter,
            IWebHelper webHelper, ISpecificationAttributeService specificationAttributeService,
            ICustomerContentService customerContentService, IDateTimeHelper dateTimeHelper,
            IShoppingCartService shoppingCartService,
            IRecentlyViewedProductsService recentlyViewedProductsService, ICompareProductsService compareProductsService,
            IWorkflowMessageService workflowMessageService, IProductTagService productTagService,
            IOrderReportService orderReportService, ICustomerService customerService,
            IBackInStockSubscriptionService backInStockSubscriptionService,
            IPermissionService permissionService, IDownloadService downloadService,
            MediaSettings mediaSetting, CatalogSettings catalogSettings,
            ShoppingCartSettings shoppingCartSettings, StoreInformationSettings storeInformationSettings,
            LocalizationSettings localizationSettings, CustomerSettings customerSettings, 
            CaptchaSettings captchaSettings,
            ICacheManager cacheManager)
        {
            this._categoryService = categoryService;
            this._manufacturerService = manufacturerService;
            this._productService = productService;
            this._productTemplateService = productTemplateService;
            this._categoryTemplateService = categoryTemplateService;
            this._manufacturerTemplateService = manufacturerTemplateService;
            this._productAttributeService = productAttributeService;
            this._productAttributeParser = productAttributeParser;
            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._customerContentService = customerContentService;
            this._dateTimeHelper = dateTimeHelper;
            this._shoppingCartService = shoppingCartService;
            this._recentlyViewedProductsService = recentlyViewedProductsService;
            this._compareProductsService = compareProductsService;
            this._workflowMessageService = workflowMessageService;
            this._productTagService = productTagService;
            this._orderReportService = orderReportService;
            this._customerService = customerService;
            this._backInStockSubscriptionService = backInStockSubscriptionService;
            this._permissionService = permissionService;
            this._downloadService = downloadService;

            this._mediaSetting = mediaSetting;
            this._catalogSettings = catalogSettings;
            this._shoppingCartSettings = shoppingCartSettings;
            this._storeInformationSettings = storeInformationSettings;
            this._localizationSettings = localizationSettings;
            this._customerSettings = customerSettings;
            this._captchaSettings = captchaSettings;

            this._cacheManager = cacheManager;
        }
        //I think this is the method that uses dependancy injection to create the repos - as opposed to manual
        //see:http://alexwolfthoughts.com/creating-a-generic-repository-with-entity-framework-and-mvc
        public AUPublicController(IRepository<AUConsignorRecord> consignorRepo,
                                        IRepository<AUConsignmentRecord> consignmentRepo,
                                        IRepository<AUConsignorConsignmentRecord> consignorconsignmentRepo,
                                        IRepository<AUConsignorList> consignorlistRepo,
                                        IRepository<AUSaleRecord> saleRepo,
                                        IRepository<AUSessionRecord> sessionRepo,
                                        IRepository<AUIncrementRecord> incrementRepo,
                                        IRepository<AUAddressRecord> addressRepo,
                                        IRepository<AUCombAddress> combAddressRepo,
                                        IRepository<AULotList> lotlistRepo,
                                        IRepository<AUFeesRecord> feesRepo,
                                        IRepository<AUBidHistoryRecord> bidhistoryRepo,

                                        ICacheManager cacheManager,
                                        IPictureService pictureService,
                                        IConsignmentService consignmentservice,
                                        ILotService lotService,
                                        IForumService forumservice,

                                        IConsignorService consignorservice,
                                        IDateTimeHelper dateTimeHelper,
                                        IAuthenticationService authenticationService,
                                        ILocalizationService localizationService,
                                        ICountryService countryService,
                                        IStateProvinceService stateProvinceService, 
                                        IWorkContext workContext,                                        
                                        ICollectibleImportService collectibleimportService, 
                                        //IRepository<AUCombConsignorConsignment> combinedRepo,
                                        ICategoryService categoryService,
                                        IStoreService storeService,
                                        IShippingService shippingService,
                                        IPermissionService permissionService,
                                        IEventPublisher eventPublisher,
                                        ISettingService settings,
                                        IProductService productService,
                                        IDbContext dbContext,
                                        IPhilatelicPdfService philatelicpdfService,
                                        ICollectibleExportService collectibleexportService,
                                        IAUSaleService ausaleService,
                                        IAclService aclService,
                                        IStoreMappingService storeMappingService,
                                        CatalogSettings catalogSettings,
                                        IWebHelper webHelper,
                                        IPriceFormatter priceFormatter,
                                        ICurrencyService currencyService,
                                        IStoreContext storeContext,
                                        MediaSettings mediaSettings,
                                        IPriceCalculationService priceCalculationService,
                                        ISpecificationAttributeService specificationAttributeService,
                                        ITaxService taxService,
                                        ICategoryTemplateService categoryTemplateService,
                                        ICustomerActivityService customerActivityService,
                                        ShoppingCartSettings shoppingCartSettings,
                                        IAUCatalogService AUcatalogService,     
                                        IForumService forumService,             
                                        ICustomerService customerService,      
                                        ForumSettings forumSettings,          
                                        ILogger logger,
                                        IRecentlyViewedProductsService recentlyViewedProductsService,
                                        SeoSettings seoSettings,
                                        IVendorService vendorService,
                                        VendorSettings vendorSettings,
                                        IProductTagService productTagService,
                                        IProductTemplateService productTemplateService,
                                        IProductAttributeParser productAttributeParser,
                                        IManufacturerService manufacturerService,
                                        IMeasureService measureService,
                                        IProductAttributeService productAttributeService,
                                        CustomerSettings customerSettings,
                                        IGenericAttributeService genericAttributeService,
                                        ISearchTermService searchTermService,
                                        IShoppingCartService shoppingCartService,
                                        IProductAttributeFormatter productAttributeFormatter)                         
        {
            _cacheManager = cacheManager;
            _pictureService = pictureService;
            _lotService = lotService;
            _forumservice = forumservice;

            _consignorRepo = consignorRepo;
            _consignmentRepo = consignmentRepo;
            _consignorconsignmentRepo = consignorconsignmentRepo;
            _consignorService = consignorservice;
            _consignmentService = consignmentservice;
            _consignorlistRepo = consignorlistRepo;
            _saleRepo = saleRepo;
            _sessionRepo = sessionRepo;
            _incrementRepo = incrementRepo;
            _addressRepo = addressRepo;
            _combAddressRepo = combAddressRepo;
            _lotlistRepo = lotlistRepo;
            _feesRepo = feesRepo;
            _bidhistoryRepo = bidhistoryRepo;
            _dateTimeHelper = dateTimeHelper;
            _authenticationService = authenticationService;
            _localizationService = localizationService;
            _countryService = countryService;
            _stateProvinceService = stateProvinceService;
            _workContext = workContext;
            _collectibleimportService = collectibleimportService;
            _categoryService = categoryService;
            _storeService = storeService;
            _shippingService = shippingService;
            _permissionService = permissionService;
            _eventPublisher = eventPublisher;
            _settings = settings;
            _productService = productService;
            _dbContext = dbContext;
            _philatelicpdfService = philatelicpdfService;
            _collectibleexportService = collectibleexportService;
            _ausaleService = ausaleService;
            _aclService = aclService;
            _storeMappingService = storeMappingService;
            _catalogSettings = catalogSettings;
            _webHelper = webHelper;
            _priceFormatter = priceFormatter;
            _currencyService = currencyService;
            _storeContext = storeContext;
            _mediaSettings = mediaSettings;
            _priceCalculationService = priceCalculationService;
            _specificationAttributeService = specificationAttributeService;
            _taxService = taxService;
            _categoryTemplateService = categoryTemplateService;
            _customerActivityService = customerActivityService;
            _shoppingCartSettings = shoppingCartSettings;
            _AUcatalogService = AUcatalogService;      
            _forumService = forumService;              
            _customerService = customerService;       
            _forumSettings = forumSettings;            
            _logger = logger;
            _recentlyViewedProductsService = recentlyViewedProductsService;          
            _seoSettings = seoSettings;
            _vendorService = vendorService;
            _vendorSettings = vendorSettings;
            _productTemplateService = productTemplateService;
            _productTagService = productTagService;
            _productAttributeParser = productAttributeParser;
            _manufacturerService = manufacturerService;
            _measureService = measureService;
            _productAttributeService = productAttributeService;
            _customerSettings = customerSettings;
            _genericAttributeService = genericAttributeService;
            _searchTermService = searchTermService;
            _shoppingCartService = shoppingCartService;
            _productAttributeFormatter = productAttributeFormatter;
        }
            public virtual void LoadSpecsFilters(Category category, 
                ISpecificationAttributeService specificationAttributeService, IWebHelper webHelper, 
                IWorkContext workContext)
            {
                if (category == null)
                    throw new ArgumentNullException("category");

                var alreadyFilteredOptions = GetAlreadyFilteredSpecs(specificationAttributeService, webHelper, workContext);
                var notFilteredOptions = GetNotFilteredSpecs(category.Id,
                    specificationAttributeService, webHelper, workContext);

                if (alreadyFilteredOptions.Count > 0 || notFilteredOptions.Count > 0)
                {
                    this.Enabled = true;

                    this.AlreadyFilteredItems = alreadyFilteredOptions.ToList().Select(x =>
                    {
                        var item = new SpecificationFilterItem();
                        item.SpecificationAttributeName = x.SpecificationAttributeName;
                        item.SpecificationAttributeOptionName = x.SpecificationAttributeOptionName;

                        return item;
                    }).ToList();

                    this.NotFilteredItems = notFilteredOptions.ToList().Select(x =>
                    {
                        var item = new SpecificationFilterItem();
                        item.SpecificationAttributeName = x.SpecificationAttributeName;
                        item.SpecificationAttributeOptionName = x.SpecificationAttributeOptionName;

                        //filter URL
                        var alreadyFilteredOptionIds = GetAlreadyFilteredSpecOptionIds(webHelper);
                        if (!alreadyFilteredOptionIds.Contains(x.SpecificationAttributeOptionId))
                            alreadyFilteredOptionIds.Add(x.SpecificationAttributeOptionId);
                        string newQueryParam = GenerateFilteredSpecQueryParam(alreadyFilteredOptionIds);
                        string filterUrl = webHelper.ModifyQueryString(webHelper.GetThisPageUrl(true), QUERYSTRINGPARAM + "=" + newQueryParam, null);
                        filterUrl = ExcludeQueryStringParams(filterUrl, webHelper);
                        item.FilterUrl = filterUrl;

                        return item;
                    }).ToList();

                    //remove filter URL
                    string removeFilterUrl = webHelper.RemoveQueryString(webHelper.GetThisPageUrl(true), QUERYSTRINGPARAM);
                    removeFilterUrl = ExcludeQueryStringParams(removeFilterUrl, webHelper);
                    this.RemoveFilterUrl = removeFilterUrl;
                }
                else
                {
                    this.Enabled = false;
                }
            }
            /// <summary>
            /// Prepare model
            /// </summary>
            /// <param name="alreadyFilteredSpecOptionIds">IDs of already filtered specification options</param>
            /// <param name="filterableSpecificationAttributeOptionIds">IDs of filterable specification options</param>
            /// <param name="specificationAttributeService"></param>
            /// <param name="webHelper">Web helper</param>
            /// <param name="workContext">Work context</param>
            /// <param name="cacheManager">Cache manager</param>
            public virtual void PrepareSpecsFilters(IList<int> alreadyFilteredSpecOptionIds,
                int[] filterableSpecificationAttributeOptionIds,
                ISpecificationAttributeService specificationAttributeService, 
                IWebHelper webHelper, IWorkContext workContext, ICacheManager cacheManager)
            {
                Enabled = false;
                var optionIds = filterableSpecificationAttributeOptionIds != null
                    ? string.Join(",", filterableSpecificationAttributeOptionIds) : string.Empty;
                var cacheKey = string.Format(ModelCacheEventConsumer.SPECS_FILTER_MODEL_KEY, optionIds, workContext.WorkingLanguage.Id);

                var allOptions = specificationAttributeService.GetSpecificationAttributeOptionsByIds(filterableSpecificationAttributeOptionIds);
                var allFilters = cacheManager.Get(cacheKey, () => allOptions.Select(sao =>
                    new SpecificationAttributeOptionFilter
                    {
                        SpecificationAttributeId = sao.SpecificationAttribute.Id,
                        SpecificationAttributeName = sao.SpecificationAttribute.GetLocalized(x => x.Name, workContext.WorkingLanguage.Id),
                        SpecificationAttributeDisplayOrder = sao.SpecificationAttribute.DisplayOrder,
                        SpecificationAttributeOptionId = sao.Id,
                        SpecificationAttributeOptionName = sao.GetLocalized(x => x.Name, workContext.WorkingLanguage.Id),
                        SpecificationAttributeOptionColorRgb = sao.ColorSquaresRgb,
                        SpecificationAttributeOptionDisplayOrder = sao.DisplayOrder
                    }).ToList());

                if (!allFilters.Any())
                    return;

                //sort loaded options
                allFilters = allFilters.OrderBy(saof => saof.SpecificationAttributeDisplayOrder)
                    .ThenBy(saof => saof.SpecificationAttributeName)
                    .ThenBy(saof => saof.SpecificationAttributeOptionDisplayOrder)
                    .ThenBy(saof => saof.SpecificationAttributeOptionName).ToList();

                //prepare the model properties
                Enabled = true;
                var removeFilterUrl = webHelper.RemoveQueryString(webHelper.GetThisPageUrl(true), QUERYSTRINGPARAM);
                RemoveFilterUrl = ExcludeQueryStringParams(removeFilterUrl, webHelper);

                //get already filtered specification options
                var alreadyFilteredOptions = allFilters.Where(x => alreadyFilteredSpecOptionIds.Contains(x.SpecificationAttributeOptionId));
                AlreadyFilteredItems = alreadyFilteredOptions.Select(x =>
                    new SpecificationFilterItem
                    {
                        SpecificationAttributeName = x.SpecificationAttributeName,
                        SpecificationAttributeOptionName = x.SpecificationAttributeOptionName,
                        SpecificationAttributeOptionColorRgb = x.SpecificationAttributeOptionColorRgb
                    }).ToList();

                //get not filtered specification options
                NotFilteredItems = allFilters.Except(alreadyFilteredOptions).Select(x =>
                {
                    //filter URL
                    var alreadyFiltered = alreadyFilteredSpecOptionIds.Concat(new List<int> { x.SpecificationAttributeOptionId });
                    var queryString = string.Format("{0}={1}", QUERYSTRINGPARAM, GenerateFilteredSpecQueryParam(alreadyFiltered.ToList()));
                    var filterUrl = webHelper.ModifyQueryString(webHelper.GetThisPageUrl(true), queryString, null);

                    return new SpecificationFilterItem()
                    {
                        SpecificationAttributeName = x.SpecificationAttributeName,
                        SpecificationAttributeOptionName = x.SpecificationAttributeOptionName,
                        SpecificationAttributeOptionColorRgb = x.SpecificationAttributeOptionColorRgb,
                        FilterUrl = ExcludeQueryStringParams(filterUrl, webHelper)
                    };
                }).ToList();
            }
        public CatalogHelper(
			ICommonServices services,
			ICategoryService categoryService,
			IManufacturerService manufacturerService,
			IProductService productService,
			IProductTemplateService productTemplateService,
			IProductAttributeService productAttributeService,
			IProductAttributeParser productAttributeParser,
			IProductAttributeFormatter productAttributeFormatter,
			ITaxService taxService,
			ICurrencyService currencyService,
			IPictureService pictureService,
			IPriceCalculationService priceCalculationService,
			IPriceFormatter priceFormatter,
			ISpecificationAttributeService specificationAttributeService,
			IDateTimeHelper dateTimeHelper,
			IBackInStockSubscriptionService backInStockSubscriptionService,
			IDownloadService downloadService,
			MediaSettings mediaSettings,
			CatalogSettings catalogSettings,
			CustomerSettings customerSettings,
			CaptchaSettings captchaSettings,
			IMeasureService measureService,
            IQuantityUnitService quantityUnitService,
			MeasureSettings measureSettings,
			TaxSettings taxSettings,
			IDeliveryTimeService deliveryTimeService,
			ISettingService settingService,
			Lazy<IMenuPublisher> _menuPublisher,
			Lazy<ITopicService> topicService,
			HttpRequestBase httpRequest,
			UrlHelper urlHelper)
        {
            this._services = services;
            this._categoryService = categoryService;
            this._manufacturerService = manufacturerService;
            this._productService = productService;
            this._productTemplateService = productTemplateService;
            this._productAttributeService = productAttributeService;
            this._productAttributeParser = productAttributeParser;
            this._productAttributeFormatter = productAttributeFormatter;
            this._taxService = taxService;
            this._currencyService = currencyService;
            this._pictureService = pictureService;
            this._localizationService = _services.Localization;
            this._priceCalculationService = priceCalculationService;
            this._priceFormatter = priceFormatter;
            this._specificationAttributeService = specificationAttributeService;
            this._dateTimeHelper = dateTimeHelper;
            this._backInStockSubscriptionService = backInStockSubscriptionService;
            this._downloadService = downloadService;
            this._measureService = measureService;
            this._quantityUnitService = quantityUnitService;
            this._measureSettings = measureSettings;
            this._taxSettings = taxSettings;
            this._deliveryTimeService = deliveryTimeService;
            this._settingService = settingService;
            this._mediaSettings = mediaSettings;
            this._catalogSettings = catalogSettings;
            this._customerSettings = customerSettings;
            this._captchaSettings = captchaSettings;
            this._menuPublisher = _menuPublisher;
            this._topicService = topicService;
            this._httpRequest = httpRequest;
            this._urlHelper = urlHelper;

            T = NullLocalizer.Instance;
        }
        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;
        }
Example #57
0
 public CatalogController(ICategoryService categoryService, 
     IManufacturerService manufacturerService,
     IProductService productService, 
     IVendorService vendorService,
     ICategoryTemplateService categoryTemplateService,
     IManufacturerTemplateService manufacturerTemplateService,
     IWorkContext workContext, 
     IStoreContext storeContext,
     ITaxService taxService, 
     ICurrencyService currencyService,
     IPictureService pictureService, 
     ILocalizationService localizationService,
     IPriceCalculationService priceCalculationService,
     IPriceFormatter priceFormatter,
     IWebHelper webHelper, 
     ISpecificationAttributeService specificationAttributeService,
     IProductTagService productTagService,
     IGenericAttributeService genericAttributeService,
     IAclService aclService,
     IStoreMappingService storeMappingService,
     IPermissionService permissionService, 
     ICustomerActivityService customerActivityService,
     ITopicService topicService,
     IEventPublisher eventPublisher,
     ISearchTermService searchTermService,
     MediaSettings mediaSettings,
     CatalogSettings catalogSettings,
     VendorSettings vendorSettings,
     BlogSettings blogSettings,
     ForumSettings  forumSettings,
     ICacheManager cacheManager)
 {
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._productService = productService;
     this._vendorService = vendorService;
     this._categoryTemplateService = categoryTemplateService;
     this._manufacturerTemplateService = manufacturerTemplateService;
     this._workContext = workContext;
     this._storeContext = storeContext;
     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._productTagService = productTagService;
     this._genericAttributeService = genericAttributeService;
     this._aclService = aclService;
     this._storeMappingService = storeMappingService;
     this._permissionService = permissionService;
     this._customerActivityService = customerActivityService;
     this._topicService = topicService;
     this._eventPublisher = eventPublisher;
     this._searchTermService = searchTermService;
     this._mediaSettings = mediaSettings;
     this._catalogSettings = catalogSettings;
     this._vendorSettings = vendorSettings;
     this._blogSettings = blogSettings;
     this._forumSettings = forumSettings;
     this._cacheManager = cacheManager;
 }