Example #1
0
 public ProductDetailsModel()
 {
     DefaultPictureModel   = new PictureModel();
     PictureModels         = new List <PictureModel>();
     AssociatedProducts    = new List <ProductDetailsModel>();
     VendorModel           = new VendorBriefInfoModel();
     Breadcrumb            = new ProductBreadcrumbModel();
     ProductTags           = new List <ProductTagModel>();
     ProductReviewOverview = new ProductReviewOverviewModel();
 }
 public ProductDetailsModel()
 {
     DefaultPictureModel = new PictureModel();
     PictureModels = new List<PictureModel>();
     GiftCard = new GiftCardModel();
     ProductPrice = new ProductPriceModel();
     AddToCart = new AddToCartModel();
     ProductVariantAttributes = new List<ProductVariantAttributeModel>();
     AssociatedProducts = new List<ProductDetailsModel>();
     VendorModel = new VendorBriefInfoModel();
 }
Example #3
0
 public ProductDetailsModel()
 {
     DefaultPictureModel      = new PictureModel();
     PictureModels            = new List <PictureModel>();
     GiftCard                 = new GiftCardModel();
     ProductPrice             = new ProductPriceModel();
     AddToCart                = new AddToCartModel();
     ProductVariantAttributes = new List <ProductVariantAttributeModel>();
     AssociatedProducts       = new List <ProductDetailsModel>();
     VendorModel              = new VendorBriefInfoModel();
 }
Example #4
0
 public ProductDetailsModel()
 {
     GiftCard              = new GiftCardModel();
     ProductPrice          = new ProductPriceModel();
     AddToCart             = new AddToCartModel();
     ProductAttributes     = new List <ProductAttributeModel>();
     AssociatedProducts    = new List <ProductDetailsModel>();
     VendorModel           = new VendorBriefInfoModel();
     Breadcrumb            = new ProductBreadcrumbModel();
     ProductTags           = new List <ProductTagModel>();
     ProductSpecifications = new List <ProductSpecificationModel>();
     ProductManufacturers  = new List <ManufacturerBriefInfoModel>();
     ProductReviewOverview = new ProductReviewOverviewModel();
     TierPrices            = new List <TierPriceModel>();
 }
 public ProductDetailsModel()
 {
     DefaultPictureModel = new PictureModel();
     PictureModels = new List<PictureModel>();
     GiftCard = new GiftCardModel();
     ProductPrice = new ProductPriceModel();
     AddToCart = new AddToCartModel();
     ProductAttributes = new List<ProductAttributeModel>();
     AssociatedProducts = new List<ProductDetailsModel>();
     VendorModel = new VendorBriefInfoModel();
     Breadcrumb = new ProductBreadcrumbModel();
     ProductTags = new List<ProductTagModel>();
     ProductSpecifications= new List<ProductSpecificationModel>();
     ProductManufacturers = new List<ManufacturerModel>();
     ProductReviewOverview = new ProductReviewOverviewModel();
     TierPrices = new List<TierPriceModel>();
 }
Example #6
0
        public ActionResult VendorNavigation(int currentVendorId)
        {
            var customerRolesIds = _workContext.CurrentCustomer.CustomerRoles
            .Where(cr => cr.Active).Select(cr => cr.Id).ToList();
            string cacheKey = string.Format(ModelCacheEventConsumer.VENDOR_NAVIGATION_MODEL_KEY, currentVendorId, _workContext.WorkingLanguage.Id, string.Join(",", customerRolesIds));
            var cacheModel = _cacheManager.Get(cacheKey, () =>
            {
                var currentVendor = _vendorService.GetVendorById(currentVendorId);

                var vendors = _vendorService.GetAllVendors();
                var model = new VendorNavigationModel()
                {
                    TotalVendors = vendors.Count
                };

                foreach (var vendor in vendors.Take(_catalogSettings.ManufacturersBlockItemsToDisplay))
                {
                    var modelMan = new VendorBriefInfoModel()
                    {
                        Id = vendor.Id,
                        Name = vendor.GetLocalized(x => x.Name),
                        SeName = vendor.GetSeName(),
                        IsActive = currentVendor != null && currentVendor.Id == vendor.Id,
                    };
                    model.Vendors.Add(modelMan);
                }
                return model;
            });

            return PartialView(cacheModel);
        }