コード例 #1
0
 public SearchController(
     ICatalogSearchQueryFactory queryFactory,
     ICatalogSearchService catalogSearchService,
     CatalogSettings catalogSettings,
     MediaSettings mediaSettings,
     SearchSettings searchSettings,
     IGenericAttributeService genericAttributeService,
     CatalogHelper catalogHelper,
     ILocalizedEntityService localizedEntityService,
     IUrlRecordService urlRecordService,
     Lazy <IFacetTemplateProvider> templateProvider,
     Lazy <IProductService> productService,
     ProductUrlHelper productUrlHelper)
 {
     _queryFactory            = queryFactory;
     _catalogSearchService    = catalogSearchService;
     _catalogSettings         = catalogSettings;
     _mediaSettings           = mediaSettings;
     _searchSettings          = searchSettings;
     _genericAttributeService = genericAttributeService;
     _catalogHelper           = catalogHelper;
     _localizedEntityService  = localizedEntityService;
     _urlRecordService        = urlRecordService;
     _templateProvider        = templateProvider;
     _productService          = productService;
     _productUrlHelper        = productUrlHelper;
 }
コード例 #2
0
        public ReturnRequestController(
            IOrderService orderService,
            IWorkContext workContext, IStoreContext storeContext,
            ICurrencyService currencyService, IPriceFormatter priceFormatter,
            IOrderProcessingService orderProcessingService,
            ILocalizationService localizationService,
            ICustomerService customerService,
            IWorkflowMessageService workflowMessageService,
            ProductUrlHelper productUrlHelper,
            LocalizationSettings localizationSettings,
            OrderSettings orderSettings)
        {
            this._orderService           = orderService;
            this._workContext            = workContext;
            this._storeContext           = storeContext;
            this._currencyService        = currencyService;
            this._priceFormatter         = priceFormatter;
            this._orderProcessingService = orderProcessingService;
            this._localizationService    = localizationService;
            this._customerService        = customerService;
            this._workflowMessageService = workflowMessageService;
            this._productUrlHelper       = productUrlHelper;

            this._localizationSettings = localizationSettings;
            this._orderSettings        = orderSettings;
        }
コード例 #3
0
 protected CartItemMapperBase(
     SmartDbContext db,
     ICommonServices services,
     ITaxService taxService,
     ICurrencyService currencyService,
     IPriceCalculationService priceCalculationService,
     IProductAttributeFormatter productAttributeFormatter,
     IProductAttributeMaterializer productAttributeMaterializer,
     IShoppingCartValidator shoppingCartValidator,
     ShoppingCartSettings shoppingCartSettings,
     CatalogSettings catalogSettings,
     MediaSettings mediaSettings,
     ProductUrlHelper productUrlHelper,
     Localizer t)
 {
     _db                           = db;
     _services                     = services;
     _taxService                   = taxService;
     _currencyService              = currencyService;
     _priceCalculationService      = priceCalculationService;
     _productAttributeFormatter    = productAttributeFormatter;
     _productAttributeMaterializer = productAttributeMaterializer;
     _shoppingCartValidator        = shoppingCartValidator;
     _shoppingCartSettings         = shoppingCartSettings;
     _catalogSettings              = catalogSettings;
     _mediaSettings                = mediaSettings;
     _productUrlHelper             = productUrlHelper;
     T = t;
 }
コード例 #4
0
 public ShoppingCartController(
     IProductAttributeMaterializer productAttributeMaterializer,
     IProductAttributeFormatter productAttributeFormatter,
     IPriceCalculationService priceCalculationService,
     IShoppingCartValidator shoppingCartValidator,
     IShoppingCartService shoppingCartService,
     ICurrencyService currencyService,
     IMediaService mediaService,
     ITaxService taxService,
     ShoppingCartSettings shoppingCartSettings,
     ProductUrlHelper productUrlHelper,
     CatalogSettings catalogSettings,
     OrderSettings orderSettings,
     MediaSettings mediaSettings,
     SmartDbContext db)
 {
     _productAttributeMaterializer = productAttributeMaterializer;
     _productAttributeFormatter    = productAttributeFormatter;
     _priceCalculationService      = priceCalculationService;
     _shoppingCartValidator        = shoppingCartValidator;
     _shoppingCartService          = shoppingCartService;
     _currencyService      = currencyService;
     _mediaService         = mediaService;
     _taxService           = taxService;
     _shoppingCartSettings = shoppingCartSettings;
     _productUrlHelper     = productUrlHelper;
     _catalogSettings      = catalogSettings;
     _orderSettings        = orderSettings;
     _mediaSettings        = mediaSettings;
     _db = db;
 }
コード例 #5
0
 public OrderHelper(
     ICommonServices services,
     IDateTimeHelper dateTimeHelper,
     PluginMediator pluginMediator,
     IPriceFormatter priceFormatter,
     ProductUrlHelper productUrlHelper,
     IProductAttributeParser productAttributeParser,
     IOrderService orderService,
     IOrderProcessingService orderProcessingService,
     IPaymentService paymentService,
     ICurrencyService currencyService,
     IQuantityUnitService quantityUnitService,
     IMediaService mediaService,
     IProductService productService,
     IEncryptionService encryptionService)
 {
     _services               = services;
     _dateTimeHelper         = dateTimeHelper;
     _pluginMediator         = pluginMediator;
     _priceFormatter         = priceFormatter;
     _productUrlHelper       = productUrlHelper;
     _productAttributeParser = productAttributeParser;
     _orderService           = orderService;
     _orderProcessingService = orderProcessingService;
     _paymentService         = paymentService;
     _currencyService        = currencyService;
     _quantityUnitService    = quantityUnitService;
     _mediaService           = mediaService;
     _productService         = productService;
     _encryptionService      = encryptionService;
 }
コード例 #6
0
 public MiniShoppingCartModelMapper(
     SmartDbContext db,
     ICommonServices services,
     IProductService productService,
     IMediaService mediaService,
     ICurrencyService currencyService,
     IPriceCalculationService priceCalculationService,
     IOrderCalculationService orderCalculationService,
     IProductAttributeFormatter productAttributeFormatter,
     ICheckoutAttributeMaterializer checkoutAttributeMaterializer,
     ProductUrlHelper productUrlHelper,
     ShoppingCartSettings shoppingCartSettings,
     CatalogSettings catalogSettings,
     MediaSettings mediaSettings,
     OrderSettings orderSettings)
 {
     _db                            = db;
     _services                      = services;
     _productService                = productService;
     _priceCalculationService       = priceCalculationService;
     _mediaService                  = mediaService;
     _currencyService               = currencyService;
     _orderCalculationService       = orderCalculationService;
     _productAttributeFormatter     = productAttributeFormatter;
     _checkoutAttributeMaterializer = checkoutAttributeMaterializer;
     _productUrlHelper              = productUrlHelper;
     _shoppingCartSettings          = shoppingCartSettings;
     _catalogSettings               = catalogSettings;
     _mediaSettings                 = mediaSettings;
     _orderSettings                 = orderSettings;
 }
コード例 #7
0
 public OrderHelper(
     SmartDbContext db,
     ICommonServices services,
     IDateTimeHelper dateTimeHelper,
     IMediaService mediaService,
     IOrderService orderService,
     IOrderProcessingService orderProcessingService,
     IPaymentService paymentService,
     ICurrencyService currencyService,
     ITaxService taxService,
     IGiftCardService giftCardService,
     IProductAttributeMaterializer productAttributeMaterializer,
     ProductUrlHelper productUrlHelper,
     IEncryptor encryptor)
 {
     _db                           = db;
     _services                     = services;
     _dateTimeHelper               = dateTimeHelper;
     _mediaService                 = mediaService;
     _orderService                 = orderService;
     _orderProcessingService       = orderProcessingService;
     _paymentService               = paymentService;
     _currencyService              = currencyService;
     _taxService                   = taxService;
     _giftCardService              = giftCardService;
     _productAttributeMaterializer = productAttributeMaterializer;
     _productUrlHelper             = productUrlHelper;
     _encryptor                    = encryptor;
 }
コード例 #8
0
        public OrderHelper(
            ICommonServices services,
            IDateTimeHelper dateTimeHelper,
            PluginMediator pluginMediator,
            IPriceFormatter priceFormatter,
            ProductUrlHelper productUrlHelper,
            IProductAttributeParser productAttributeParser,
            IOrderService orderService,
            IOrderProcessingService orderProcessingService,
            IPaymentService paymentService,
            ICurrencyService currencyService,
            IQuantityUnitService quantityUnitService,
            IPictureService pictureService,
            IProductService productService)
        {
            _services               = services;
            _dateTimeHelper         = dateTimeHelper;
            _pluginMediator         = pluginMediator;
            _priceFormatter         = priceFormatter;
            _productUrlHelper       = productUrlHelper;
            _productAttributeParser = productAttributeParser;
            _orderService           = orderService;
            _orderProcessingService = orderProcessingService;
            _paymentService         = paymentService;
            _currencyService        = currencyService;
            _quantityUnitService    = quantityUnitService;
            _pictureService         = pictureService;
            _productService         = productService;

            T = NullLocalizer.Instance;
        }
コード例 #9
0
 public ProductController(
     ICommonServices services,
     IProductService productService,
     IProductAttributeService productAttributeService,
     ITaxService taxService,
     IMediaService mediaService,
     ICustomerContentService customerContentService,
     ICustomerService customerService,
     IRecentlyViewedProductsService recentlyViewedProductsService,
     IProductTagService productTagService,
     IOrderReportService orderReportService,
     IBackInStockSubscriptionService backInStockSubscriptionService,
     IAclService aclService,
     IStoreMappingService storeMappingService,
     MediaSettings mediaSettings,
     SeoSettings seoSettings,
     CatalogSettings catalogSettings,
     ShoppingCartSettings shoppingCartSettings,
     LocalizationSettings localizationSettings,
     CaptchaSettings captchaSettings,
     CatalogHelper helper,
     IBreadcrumb breadcrumb,
     Lazy <PrivacySettings> privacySettings,
     Lazy <TaxSettings> taxSettings,
     ILocalizationService localizationService,
     IProductAttributeParser productAttributeParser,
     IDownloadService downloadService,
     ProductUrlHelper productUrlHelper,
     IProductAttributeFormatter productAttributeFormatter)
 {
     _services                       = services;
     _productService                 = productService;
     _productAttributeService        = productAttributeService;
     _taxService                     = taxService;
     _mediaService                   = mediaService;
     _customerContentService         = customerContentService;
     _customerService                = customerService;
     _recentlyViewedProductsService  = recentlyViewedProductsService;
     _productTagService              = productTagService;
     _orderReportService             = orderReportService;
     _backInStockSubscriptionService = backInStockSubscriptionService;
     _aclService                     = aclService;
     _storeMappingService            = storeMappingService;
     _mediaSettings                  = mediaSettings;
     _seoSettings                    = seoSettings;
     _catalogSettings                = catalogSettings;
     _shoppingCartSettings           = shoppingCartSettings;
     _localizationSettings           = localizationSettings;
     _captchaSettings                = captchaSettings;
     _helper                    = helper;
     _breadcrumb                = breadcrumb;
     _privacySettings           = privacySettings;
     _taxSettings               = taxSettings;
     _localizationService       = localizationService;
     _downloadService           = downloadService;
     _productAttributeParser    = productAttributeParser;
     _productUrlHelper          = productUrlHelper;
     _productAttributeFormatter = productAttributeFormatter;
 }
コード例 #10
0
 public OrderController(
     IOrderService orderService,
     IShipmentService shipmentService,
     ICurrencyService currencyService,
     IPriceFormatter priceFormatter,
     IOrderProcessingService orderProcessingService,
     IDateTimeHelper dateTimeHelper,
     IPaymentService paymentService,
     IPdfConverter pdfConverter,
     IShippingService shippingService,
     ICountryService countryService,
     ICheckoutAttributeFormatter checkoutAttributeFormatter,
     IStoreService storeService,
     IProductService productService,
     IProductAttributeFormatter productAttributeFormatter,
     PluginMediator pluginMediator,
     ICommonServices services,
     IQuantityUnitService quantityUnitService,
     ProductUrlHelper productUrlHelper,
     IProductAttributeParser productAttributeParser,
     IPictureService pictureService,
     CatalogSettings catalogSettings,
     MediaSettings mediaSettings,
     ShoppingCartSettings shoppingCartSettings)
 {
     this._orderService               = orderService;
     this._shipmentService            = shipmentService;
     this._currencyService            = currencyService;
     this._priceFormatter             = priceFormatter;
     this._orderProcessingService     = orderProcessingService;
     this._dateTimeHelper             = dateTimeHelper;
     this._paymentService             = paymentService;
     this._pdfConverter               = pdfConverter;
     this._shippingService            = shippingService;
     this._countryService             = countryService;
     this._productService             = productService;
     this._productAttributeFormatter  = productAttributeFormatter;
     this._storeService               = storeService;
     this._checkoutAttributeFormatter = checkoutAttributeFormatter;
     this._pluginMediator             = pluginMediator;
     this._services               = services;
     this._quantityUnitService    = quantityUnitService;
     this._productUrlHelper       = productUrlHelper;
     this._pictureService         = pictureService;
     this._catalogSettings        = catalogSettings;
     this._productAttributeParser = productAttributeParser;
     this._mediaSettings          = mediaSettings;
     this._shoppingCartSettings   = shoppingCartSettings;
 }
コード例 #11
0
 public ReturnRequestController(
     SmartDbContext db,
     IOrderProcessingService orderProcessingService,
     ICurrencyService currencyService,
     ProductUrlHelper productUrlHelper,
     IMessageFactory messageFactory,
     OrderSettings orderSettings,
     LocalizationSettings localizationSettings)
 {
     _db = db;
     _orderProcessingService = orderProcessingService;
     _currencyService        = currencyService;
     _productUrlHelper       = productUrlHelper;
     _messageFactory         = messageFactory;
     _orderSettings          = orderSettings;
     _localizationSettings   = localizationSettings;
 }
コード例 #12
0
 public WishlistItemModelMapper(
     SmartDbContext db,
     ICommonServices services,
     ITaxService taxService,
     ICurrencyService currencyService,
     IPriceCalculationService priceCalculationService,
     IProductAttributeFormatter productAttributeFormatter,
     IProductAttributeMaterializer productAttributeMaterializer,
     IShoppingCartValidator shoppingCartValidator,
     ShoppingCartSettings shoppingCartSettings,
     CatalogSettings catalogSettings,
     MediaSettings mediaSettings,
     ProductUrlHelper productUrlHelper,
     Localizer t)
     : base(db, services, taxService, currencyService, priceCalculationService, productAttributeFormatter, productAttributeMaterializer,
            shoppingCartValidator, shoppingCartSettings, catalogSettings, mediaSettings, productUrlHelper, t)
 {
 }
コード例 #13
0
 public SearchController(
     CatalogHelper catalogHelper,
     ICatalogSearchService catalogSearchService,
     ILocalizedEntityService localizedEntityService,
     MediaSettings mediaSettings,
     SearchSettings searchSettings,
     CatalogSettings catalogSettings,
     Lazy <IProductService> productService,
     ProductUrlHelper productUrlHelper)
 {
     _catalogHelper          = catalogHelper;
     _catalogSearchService   = catalogSearchService;
     _localizedEntityService = localizedEntityService;
     _mediaSettings          = mediaSettings;
     _searchSettings         = searchSettings;
     _catalogSettings        = catalogSettings;
     _productService         = productService;
     _productUrlHelper       = productUrlHelper;
 }
コード例 #14
0
 public ReturnRequestController(
     IOrderService orderService,
     ICurrencyService currencyService,
     IPriceFormatter priceFormatter,
     IOrderProcessingService orderProcessingService,
     ICustomerService customerService,
     ProductUrlHelper productUrlHelper,
     LocalizationSettings localizationSettings,
     OrderSettings orderSettings)
 {
     _orderService           = orderService;
     _currencyService        = currencyService;
     _priceFormatter         = priceFormatter;
     _orderProcessingService = orderProcessingService;
     _customerService        = customerService;
     _productUrlHelper       = productUrlHelper;
     _localizationSettings   = localizationSettings;
     _orderSettings          = orderSettings;
 }
コード例 #15
0
 public OrderController(
     SmartDbContext db,
     IOrderProcessingService orderProcessingService,
     IPaymentService paymentService,
     IProductAttributeMaterializer productAttributeMaterializer,
     OrderHelper orderHelper,
     IDateTimeHelper dateTimeHelper,
     IProviderManager providerManager,
     ProductUrlHelper productUrlHelper,
     PdfSettings pdfSettings)
 {
     _db = db;
     _orderProcessingService       = orderProcessingService;
     _paymentService               = paymentService;
     _productAttributeMaterializer = productAttributeMaterializer;
     _orderHelper      = orderHelper;
     _dateTimeHelper   = dateTimeHelper;
     _providerManager  = providerManager;
     _productUrlHelper = productUrlHelper;
     _pdfSettings      = pdfSettings;
 }
コード例 #16
0
ファイル: OrderController.cs プロジェクト: krreddy123/appcode
 public OrderController(
     IDateTimeHelper dateTimeHelper,
     IPdfConverter pdfConverter,
     ProductUrlHelper productUrlHelper,
     OrderHelper orderHelper,
     IOrderService orderService,
     IShipmentService shipmentService,
     IOrderProcessingService orderProcessingService,
     IPaymentService paymentService,
     IShippingService shippingService,
     ICountryService countryService)
 {
     _dateTimeHelper         = dateTimeHelper;
     _pdfConverter           = pdfConverter;
     _productUrlHelper       = productUrlHelper;
     _orderHelper            = orderHelper;
     _orderService           = orderService;
     _shipmentService        = shipmentService;
     _orderProcessingService = orderProcessingService;
     _paymentService         = paymentService;
     _shippingService        = shippingService;
     _countryService         = countryService;
 }
コード例 #17
0
        public override async Task MapAsync(OrganizedShoppingCartItem from, TModel to, dynamic parameters = null)
        {
            Guard.NotNull(from, nameof(from));
            Guard.NotNull(to, nameof(to));

            var item             = from.Item;
            var product          = from.Item.Product;
            var customer         = item.Customer;
            var currency         = _services.WorkContext.WorkingCurrency;
            var shoppingCartType = item.ShoppingCartType;
            var productSeName    = await product.GetActiveSlugAsync();

            var taxFormat    = parameters?.TaxFormat as string;
            var batchContext = parameters?.BatchContext as ProductBatchContext;

            await _productAttributeMaterializer.MergeWithCombinationAsync(product, item.AttributeSelection);

            // General model data.
            to.Id            = item.Id;
            to.Sku           = product.Sku;
            to.ProductId     = product.Id;
            to.ProductName   = product.GetLocalized(x => x.Name);
            to.ProductSeName = productSeName;
            to.ProductUrl    = await ProductUrlHelper.GetProductUrlAsync(productSeName, from);

            to.EnteredQuantity     = item.Quantity;
            to.MinOrderAmount      = product.OrderMinimumQuantity;
            to.MaxOrderAmount      = product.OrderMaximumQuantity;
            to.QuantityStep        = product.QuantityStep > 0 ? product.QuantityStep : 1;
            to.ShortDesc           = product.GetLocalized(x => x.ShortDescription);
            to.ProductType         = product.ProductType;
            to.VisibleIndividually = product.Visibility != ProductVisibility.Hidden;
            to.CreatedOnUtc        = item.UpdatedOnUtc;

            if (item.BundleItem != null)
            {
                to.BundleItem.Id             = item.BundleItem.Id;
                to.BundleItem.DisplayOrder   = item.BundleItem.DisplayOrder;
                to.BundleItem.HideThumbnail  = item.BundleItem.HideThumbnail;
                to.BundlePerItemPricing      = item.BundleItem.BundleProduct.BundlePerItemPricing;
                to.BundlePerItemShoppingCart = item.BundleItem.BundleProduct.BundlePerItemShoppingCart;

                to.AttributeInfo = await ProductAttributeFormatter.FormatAttributesAsync(
                    item.AttributeSelection,
                    product,
                    customer,
                    includePrices : false,
                    includeGiftCardAttributes : true,
                    includeHyperlinks : true,
                    batchContext : batchContext);

                var bundleItemName = item.BundleItem.GetLocalized(x => x.Name);
                if (bundleItemName.Value.HasValue())
                {
                    to.ProductName = bundleItemName;
                }

                var bundleItemShortDescription = item.BundleItem.GetLocalized(x => x.ShortDescription);
                if (bundleItemShortDescription.Value.HasValue())
                {
                    to.ShortDesc = bundleItemShortDescription;
                }

                var calculationOptions = _priceCalculationService.CreateDefaultOptions(false, customer, null, batchContext);
                var calculationContext = await _priceCalculationService.CreateCalculationContextAsync(from, calculationOptions);

                var(bundleItemUnitPrice, bundleItemSubtotal) = await _priceCalculationService.CalculateSubtotalAsync(calculationContext);

                if (to.BundlePerItemPricing && to.BundlePerItemShoppingCart)
                {
                    to.BundleItem.PriceWithDiscount = bundleItemSubtotal.FinalPrice.ToString();
                }

                to.BasePrice = _priceCalculationService.GetBasePriceInfo(product, bundleItemUnitPrice.FinalPrice);
            }
            else
            {
                to.AttributeInfo = await ProductAttributeFormatter.FormatAttributesAsync(item.AttributeSelection, product, customer, batchContext : batchContext);
            }

            var allowedQuantities = product.ParseAllowedQuantities();

            foreach (var quantity in allowedQuantities)
            {
                to.AllowedQuantities.Add(new SelectListItem
                {
                    Text     = quantity.ToString(),
                    Value    = quantity.ToString(),
                    Selected = item.Quantity == quantity
                });
            }

            var quantityUnit = await Db.QuantityUnits.GetQuantityUnitByIdAsync(product.QuantityUnitId ?? 0, _catalogSettings.ShowDefaultQuantityUnit);

            if (quantityUnit != null)
            {
                to.QuantityUnitName = quantityUnit.GetLocalized(x => x.Name);
            }

            if (product.IsRecurring)
            {
                to.RecurringInfo = T("ShoppingCart.RecurringPeriod", product.RecurringCycleLength, product.RecurringCyclePeriod.GetLocalizedEnum());
            }

            if (product.CallForPrice)
            {
                to.UnitPrice = to.UnitPrice.WithPostFormat(T("Products.CallForPrice"));
                to.SubTotal  = to.UnitPrice;
            }
            else if (item.BundleItem == null)
            {
                if (shoppingCartType == ShoppingCartType.ShoppingCart)
                {
                    var subtotal = parameters?.CartSubtotal as ShoppingCartSubtotal;
                    var lineItem = subtotal.LineItems.FirstOrDefault(x => x.Item.Item.Id == item.Id);

                    var unitPrice = CurrencyService.ConvertFromPrimaryCurrency(lineItem.UnitPrice.FinalPrice.Amount, currency);
                    to.UnitPrice = unitPrice.WithPostFormat(taxFormat);

                    var itemSubtotal = CurrencyService.ConvertFromPrimaryCurrency(lineItem.Subtotal.FinalPrice.Amount, currency);
                    to.SubTotal = itemSubtotal.WithPostFormat(taxFormat);

                    if (lineItem.Subtotal.DiscountAmount > 0)
                    {
                        var itemDiscount = CurrencyService.ConvertFromPrimaryCurrency(lineItem.Subtotal.DiscountAmount.Amount, currency);
                        to.Discount = itemDiscount.WithPostFormat(taxFormat);
                    }

                    to.BasePrice = _priceCalculationService.GetBasePriceInfo(product, unitPrice);
                }
                else
                {
                    var calculationOptions = _priceCalculationService.CreateDefaultOptions(false, customer, null, batchContext);
                    var calculationContext = await _priceCalculationService.CreateCalculationContextAsync(from, calculationOptions);

                    var(unitPrice, itemSubtotal) = await _priceCalculationService.CalculateSubtotalAsync(calculationContext);

                    to.UnitPrice = unitPrice.FinalPrice;
                    to.SubTotal  = itemSubtotal.FinalPrice;

                    if (itemSubtotal.DiscountAmount > 0)
                    {
                        to.Discount = itemSubtotal.DiscountAmount;
                    }
                }
            }

            if (item.BundleItem != null)
            {
                if (_shoppingCartSettings.ShowProductBundleImagesOnShoppingCart)
                {
                    await from.MapAsync(to.Image, MediaSettings.CartThumbBundleItemPictureSize, to.ProductName);
                }
            }
            else
            {
                if (_shoppingCartSettings.ShowProductImagesOnShoppingCart)
                {
                    await from.MapAsync(to.Image, MediaSettings.CartThumbPictureSize, to.ProductName);
                }
            }

            var itemWarnings = new List <string>();
            var isValid      = await ShoppingCartValidator.ValidateCartItemsAsync(new[] { from }, itemWarnings);

            if (!isValid)
            {
                to.Warnings.AddRange(itemWarnings);
            }

            var cart = await ShoppingCartService.GetCartItemsAsync(customer, shoppingCartType, _services.StoreContext.CurrentStore.Id);

            var attrWarnings = new List <string>();

            isValid = await ShoppingCartValidator.ValidateProductAttributesAsync(item, cart, attrWarnings);

            if (!isValid)
            {
                to.Warnings.AddRange(attrWarnings);
            }
        }
コード例 #18
0
 public CatalogHelper(
     SmartDbContext db,
     ICommonServices services,
     IMenuService menuService,
     IManufacturerService manufacturerService,
     IProductService productService,
     //IProductTemplateService productTemplateService,
     IProductAttributeService productAttributeService,
     IProductAttributeMaterializer productAttributeMaterializer,
     IProductAttributeFormatter productAttributeFormatter,
     ITaxService taxService,
     ICurrencyService currencyService,
     IMediaService mediaService,
     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,
     PerformanceSettings performanceSettings,
     IDeliveryTimeService deliveryTimeService,
     Lazy <IDataExporter> dataExporter,
     ICatalogSearchService catalogSearchService,
     ICatalogSearchQueryFactory catalogSearchQueryFactory,
     IUrlHelper urlHelper,
     ProductUrlHelper productUrlHelper,
     ILocalizedEntityService localizedEntityService,
     IUrlService urlService,
     ILinkResolver linkResolver)
 {
     _db                  = db;
     _services            = services;
     _workContext         = services.WorkContext;
     _storeContext        = services.StoreContext;
     _cache               = services.Cache;
     _menuService         = menuService;
     _manufacturerService = manufacturerService;
     _productService      = productService;
     //_productTemplateService = productTemplateService;
     _productAttributeService      = productAttributeService;
     _productAttributeMaterializer = productAttributeMaterializer;
     _productAttributeFormatter    = productAttributeFormatter;
     _taxService              = taxService;
     _currencyService         = currencyService;
     _mediaService            = mediaService;
     _localizationService     = _services.Localization;
     _priceCalculationService = priceCalculationService;
     //_priceFormatter = priceFormatter;
     //_specificationAttributeService = specificationAttributeService;
     _dateTimeHelper = dateTimeHelper;
     //_backInStockSubscriptionService = backInStockSubscriptionService;
     _downloadService = downloadService;
     _measureService  = measureService;
     //_quantityUnitService = quantityUnitService;
     _measureSettings           = measureSettings;
     _taxSettings               = taxSettings;
     _performanceSettings       = performanceSettings;
     _deliveryTimeService       = deliveryTimeService;
     _mediaSettings             = mediaSettings;
     _catalogSettings           = catalogSettings;
     _customerSettings          = customerSettings;
     _captchaSettings           = captchaSettings;
     _dataExporter              = dataExporter;
     _catalogSearchService      = catalogSearchService;
     _catalogSearchQueryFactory = catalogSearchQueryFactory;
     _urlHelper              = urlHelper;
     _productUrlHelper       = productUrlHelper;
     _localizedEntityService = localizedEntityService;
     _urlService             = urlService;
     _linkResolver           = linkResolver;
     _httpRequest            = _urlHelper.ActionContext.HttpContext.Request;
 }
コード例 #19
0
 public LoginController(
     ICommonServices services,
     IAdCampaignService adCampaignService,
     IAuthenticationService authenticationService,
     IDateTimeHelper dateTimeHelper,
     DateTimeSettings dateTimeSettings, TaxSettings taxSettings,
     ILocalizationService localizationService,
     IWorkContext workContext, IStoreContext storeContext,
     ICustomerService customerService,
     IGenericAttributeService genericAttributeService,
     ICustomerRegistrationService customerRegistrationService,
     ITaxService taxService, RewardPointsSettings rewardPointsSettings,
     CustomerSettings customerSettings, AddressSettings addressSettings, ForumSettings forumSettings,
     OrderSettings orderSettings, IAddressService addressService,
     ICountryService countryService, IStateProvinceService stateProvinceService,
     IOrderTotalCalculationService orderTotalCalculationService,
     IOrderProcessingService orderProcessingService, IOrderService orderService,
     ICurrencyService currencyService,
     IPaymentService paymentService,
     IPriceFormatter priceFormatter,
     IPictureService pictureService, INewsLetterSubscriptionService newsLetterSubscriptionService,
     IForumService forumService, IShoppingCartService shoppingCartService,
     IOpenAuthenticationService openAuthenticationService,
     IBackInStockSubscriptionService backInStockSubscriptionService,
     IDownloadService downloadService, IWebHelper webHelper,
     ICustomerActivityService customerActivityService,
     ProductUrlHelper productUrlHelper,
     MediaSettings mediaSettings,
     LocalizationSettings localizationSettings,
     //CaptchaSettings captchaSettings,
     ExternalAuthenticationSettings externalAuthenticationSettings,
     PluginMediator pluginMediator,
     IPermissionService permissionService,
     IProductService productService)
 {
     _services = services;
     _authenticationService       = authenticationService;
     _dateTimeHelper              = dateTimeHelper;
     _dateTimeSettings            = dateTimeSettings;
     _taxSettings                 = taxSettings;
     _localizationService         = localizationService;
     _workContext                 = workContext;
     _storeContext                = storeContext;
     _customerService             = customerService;
     _genericAttributeService     = genericAttributeService;
     _customerRegistrationService = customerRegistrationService;
     _taxService                     = taxService;
     _rewardPointsSettings           = rewardPointsSettings;
     _customerSettings               = customerSettings;
     _addressSettings                = addressSettings;
     _forumSettings                  = forumSettings;
     _orderSettings                  = orderSettings;
     _addressService                 = addressService;
     _countryService                 = countryService;
     _stateProvinceService           = stateProvinceService;
     _orderProcessingService         = orderProcessingService;
     _orderTotalCalculationService   = orderTotalCalculationService;
     _orderService                   = orderService;
     _currencyService                = currencyService;
     _paymentService                 = paymentService;
     _priceFormatter                 = priceFormatter;
     _pictureService                 = pictureService;
     _newsLetterSubscriptionService  = newsLetterSubscriptionService;
     _forumService                   = forumService;
     _shoppingCartService            = shoppingCartService;
     _openAuthenticationService      = openAuthenticationService;
     _backInStockSubscriptionService = backInStockSubscriptionService;
     _downloadService                = downloadService;
     _webHelper = webHelper;
     _customerActivityService = customerActivityService;
     _productUrlHelper        = productUrlHelper;
     _adCampaignService       = adCampaignService;
     _mediaSettings           = mediaSettings;
     _localizationSettings    = localizationSettings;
     //_captchaSettings = captchaSettings;
     _externalAuthenticationSettings = externalAuthenticationSettings;
     _pluginMediator    = pluginMediator;
     _permissionService = permissionService;
     _productService    = productService;
 }
コード例 #20
0
 public ProductController(
     SmartDbContext db,
     IProductService productService,
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     ICustomerService customerService,
     IUrlService urlService,
     IWorkContext workContext,
     ILanguageService languageService,
     ILocalizationService localizationService,
     ILocalizedEntityService localizedEntityService,
     IMediaService mediaService,
     IProductTagService productTagService,
     IProductCloner productCloner,
     IActivityLogger activityLogger,
     IAclService aclService,
     IStoreContext storeContext,
     IStoreMappingService storeMappingService,
     AdminAreaSettings adminAreaSettings,
     IDateTimeHelper dateTimeHelper,
     IDiscountService discountService,
     IProductAttributeService productAttributeService,
     //IBackInStockSubscriptionService backInStockSubscriptionService,
     IShoppingCartService shoppingCartService,
     IProductAttributeFormatter productAttributeFormatter,
     //IProductAttributeParser productAttributeParser,
     CatalogSettings catalogSettings,
     IDownloadService downloadService,
     IDeliveryTimeService deliveryTimesService,
     IMeasureService measureService,
     MeasureSettings measureSettings,
     IEventPublisher eventPublisher,
     IGenericAttributeService genericAttributeService,
     ICommonServices services,
     ICatalogSearchService catalogSearchService,
     ProductUrlHelper productUrlHelper,
     SeoSettings seoSettings,
     MediaSettings mediaSettings,
     SearchSettings searchSettings)
 {
     _db                      = db;
     _productService          = productService;
     _categoryService         = categoryService;
     _manufacturerService     = manufacturerService;
     _customerService         = customerService;
     _urlService              = urlService;
     _workContext             = workContext;
     _languageService         = languageService;
     _localizationService     = localizationService;
     _localizedEntityService  = localizedEntityService;
     _mediaService            = mediaService;
     _productTagService       = productTagService;
     _productCloner           = productCloner;
     _activityLogger          = activityLogger;
     _aclService              = aclService;
     _storeContext            = storeContext;
     _storeMappingService     = storeMappingService;
     _adminAreaSettings       = adminAreaSettings;
     _dateTimeHelper          = dateTimeHelper;
     _discountService         = discountService;
     _productAttributeService = productAttributeService;
     //_backInStockSubscriptionService = backInStockSubscriptionService;
     _shoppingCartService       = shoppingCartService;
     _productAttributeFormatter = productAttributeFormatter;
     //_productAttributeParser = productAttributeParser;
     _catalogSettings         = catalogSettings;
     _downloadService         = downloadService;
     _deliveryTimesService    = deliveryTimesService;
     _measureService          = measureService;
     _measureSettings         = measureSettings;
     _eventPublisher          = eventPublisher;
     _genericAttributeService = genericAttributeService;
     _services             = services;
     _catalogSearchService = catalogSearchService;
     _productUrlHelper     = productUrlHelper;
     _seoSettings          = seoSettings;
     _mediaSettings        = mediaSettings;
     _searchSettings       = searchSettings;
 }