public virtual ActionResult LanguageSwitch(string keywords, int page = 1, string sortBy = null, string sortDirection = null)
        {
            var languageSwitchViewModel = LanguageSwitchService.GetViewModel(cultureInfo =>
                                                                             BuildUrl(cultureInfo, keywords, page, sortBy, sortDirection), ComposerContext.CultureInfo);

            return(View("LanguageSwitch", languageSwitchViewModel));
        }
Ejemplo n.º 2
0
        public virtual ActionResult LanguageSwitch()
        {
            var pageId = SitemapNavigator.CurrentPageId;

            var languageSwitchViewModel = LanguageSwitchService.GetViewModel(ci => PageService.GetRendererPageUrl(pageId, ci), ComposerContext.CultureInfo);

            return(View("LanguageSwitch", languageSwitchViewModel));
        }
        public LanguageSwitchViewModel GetViewModel(Guid currentPageId, Guid currentHomePageId)
        {
            var languageSwitchViewModel = LanguageSwitchService.GetViewModel(cultureInfo => BuildUrl(
                                                                                 cultureInfo,
                                                                                 ProductContext.ViewModel.LocalizedDisplayNames[cultureInfo.Name],
                                                                                 ProductContext.ViewModel.ProductId,
                                                                                 ProductContext.ViewModel.SelectedVariantId, ProductContext.ViewModel.Sku),
                                                                             ComposerContext.CultureInfo);

            return(languageSwitchViewModel);
        }
        public LanguageSwitchViewModel GetViewModel(Guid currentPageId, Guid currentHomePageId)
        {
            var model   = StoreContext.ViewModel;
            var baseUrl = RequestUtils.GetBaseUrl(Request).ToString();

            return(LanguageSwitchService.GetViewModel(cultureInfo => BuildUrl(
                                                          baseUrl,
                                                          cultureInfo,
                                                          currentHomePageId,
                                                          model.LocalizedDisplayNames[cultureInfo.Name],
                                                          model.Number),
                                                      ComposerContext.CultureInfo));
        }
        public LanguageSwitchViewModel GetViewModel(Guid currentPageId, Guid currentHomePageId)
        {
            Func <CultureInfo, string> BuildUrl = (CultureInfo culture) =>
            {
                var pageUrl = PageService.GetPageUrl(currentPageId, culture);
                if (pageUrl == null)
                {
                    return(null);
                }
                var url = UrlFormatter.AppendQueryString(pageUrl, Request.Url.ParseQueryString());
                return(url);
            };

            return(LanguageSwitchService.GetViewModel(BuildUrl, ComposerContext.CultureInfo));
        }
Ejemplo n.º 6
0
        public virtual ActionResult LanguageSwitch()
        {
            var productViewModel = ProductContext.ViewModel;

            if (productViewModel == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.NotFound));
            }

            var languageSwitchViewModel = LanguageSwitchService.GetViewModel(cultureInfo => BuildUrl(
                                                                                 cultureInfo,
                                                                                 productViewModel.LocalizedDisplayNames[cultureInfo.Name],
                                                                                 productViewModel.ProductId,
                                                                                 productViewModel.SelectedVariantId, productViewModel.Sku),
                                                                             ComposerContext.CultureInfo);

            return(View("LanguageSwitch", languageSwitchViewModel));
        }
Ejemplo n.º 7
0
        public ActionResult LanguageSwitch()
        {
            var languageSwitchViewModel = LanguageSwitchService.GetViewModel(BuildUrl, ComposerContext.CultureInfo);

            return(View("LanguageSwitch", languageSwitchViewModel));
        }