Пример #1
0
        private CheckoutViewModel PaymentErrorSetup()
        {
            ViewBag.Title     = "Checkout Payment Error";
            ViewBag.BodyClass = "store-checkout-page";

            CheckoutViewModel model = new CheckoutViewModel();

            LoadPendingOrder(model);

            // Buttons
            ThemeManager themes = MTApp.ThemeManager();

            model.ButtonCheckoutUrl = themes.ButtonUrl("PlaceOrder", Request.IsSecureConnection);
            model.ButtonCancelUrl   = themes.ButtonUrl("Cancel", Request.IsSecureConnection);

            // Populate Countries
            model.Countries = MTApp.CurrentStore.Settings.FindActiveCountries();
            model.PaymentViewModel.AcceptedCardTypes = MTApp.CurrentStore.Settings.PaymentAcceptedCards;

            // Render Side Column
            var columnRender = new code.TemplateEngine.TagHandlers.ContentColumn();

            model.SideColumn = columnRender.RenderColumnToString("601", MTApp, ViewBag);

            ViewData["PassedAnalyticsTop"] += "<script type=\"text/javascript\" src=\"" + Url.Content("~/js/checkout.js") + "\" ></script>";
            return(model);
        }
Пример #2
0
        private CheckoutViewModel IndexSetup()
        {
            ViewBag.Title     = "Checkout";
            ViewBag.BodyClass = "store-checkout-page";

            CheckoutViewModel model = new CheckoutViewModel();

            model.CurrentOrder = SessionManager.CurrentShoppingCart(MTApp.OrderServices, MTApp.CurrentStore);

            // Buttons
            ThemeManager themes = MTApp.ThemeManager();

            model.ButtonCheckoutUrl = themes.ButtonUrl("PlaceOrder", Request.IsSecureConnection);
            model.ButtonCancelUrl   = themes.ButtonUrl("keepshopping", Request.IsSecureConnection);
            model.ButtonLoginUrl    = themes.ButtonUrl("edit", Request.IsSecureConnection);

            // Agree Checkbox
            if (MTApp.CurrentStore.Settings.ForceTermsAgreement)
            {
                model.ShowAgreeToTerms         = true;
                model.AgreedToTerms            = false;
                model.AgreedToTermsDescription = SiteTerms.GetTerm(SiteTermIds.TermsAndConditionsAgreement);
                model.LabelTerms = SiteTerms.GetTerm(SiteTermIds.TermsAndConditions);
            }
            else
            {
                model.ShowAgreeToTerms = false;
                model.AgreedToTerms    = true;
            }

            // Populate Countries
            model.Countries = MTApp.CurrentStore.Settings.FindActiveCountries();

            return(model);
        }
Пример #3
0
        private void LoadButtonImages(CartViewModel model)
        {
            ThemeManager tm = MTApp.ThemeManager();

            model.KeepShoppingButtonUrl     = tm.ButtonUrl("keepshopping", Request.IsSecureConnection);
            model.CheckoutButtonUrl         = tm.ButtonUrl("securecheckout", Request.IsSecureConnection);
            model.AddCouponButtonUrl        = tm.ButtonUrl("new", Request.IsSecureConnection);
            model.DeleteButtonUrl           = tm.ButtonUrl("x", Request.IsSecureConnection);
            model.EstimateShippingButtonUrl = tm.ButtonUrl("estimateshipping", Request.IsSecureConnection);
        }
        public ActionResult TopReviews(int howMany, List <ProductReview> reviews)
        {
            ProductReviewsViewModel model = new ProductReviewsViewModel();

            // Trim List of reviews
            if (reviews != null)
            {
                if (reviews.Count > howMany)
                {
                    model.Reviews = reviews.Take(howMany).ToList();
                }
                else
                {
                    model.Reviews = reviews;
                }
            }

            // Load ratings buttons
            ThemeManager tm = MTApp.ThemeManager();

            ViewBag.Star0Url = tm.ButtonUrl("Stars0", Request.IsSecureConnection);
            ViewBag.Star1Url = tm.ButtonUrl("Stars1", Request.IsSecureConnection);
            ViewBag.Star2Url = tm.ButtonUrl("Stars2", Request.IsSecureConnection);
            ViewBag.Star3Url = tm.ButtonUrl("Stars3", Request.IsSecureConnection);
            ViewBag.Star4Url = tm.ButtonUrl("Stars4", Request.IsSecureConnection);
            ViewBag.Star5Url = tm.ButtonUrl("Stars5", Request.IsSecureConnection);

            ViewBag.AvgLabel = SiteTerms.GetTerm(SiteTermIds.AverageRating);
            int avg = CalculateAverageRating(reviews);

            ViewBag.Avg      = avg;
            ViewBag.AvgImage = tm.ButtonUrl("Stars" + avg.ToString(), Request.IsSecureConnection);

            return(View(model));
        }
Пример #5
0
        private CheckoutViewModel PaymentErrorSetup()
        {
            ViewBag.Title     = "Checkout Payment Error";
            ViewBag.BodyClass = "store-checkout-page";

            CheckoutViewModel model = new CheckoutViewModel();

            LoadPendingOrder(model);

            // Buttons
            ThemeManager themes = MTApp.ThemeManager();

            model.ButtonCheckoutUrl = themes.ButtonUrl("PlaceOrder", Request.IsSecureConnection);
            model.ButtonCancelUrl   = themes.ButtonUrl("Cancel", Request.IsSecureConnection);

            // Populate Countries
            model.Countries = MTApp.CurrentStore.Settings.FindActiveCountries();
            model.PaymentViewModel.AcceptedCardTypes = MTApp.CurrentStore.Settings.PaymentAcceptedCards;

            return(model);
        }
        //
        // GET: /ProductReviews/
        public ActionResult Index(string slug)
        {
            ProductReviewsViewModel model = new ProductReviewsViewModel();

            Product p = GetProductFromSlug(slug);

            if (p == null)
            {
                return(Redirect("~/"));
            }

            model.ProductView = new SingleProductViewModel(p, MTApp);

            // Titles
            ViewBag.Title = p.MetaTitle;
            if (((string)ViewBag.Title).Trim().Length < 1)
            {
                ViewBag.Title = p.ProductName;
            }
            ViewBag.Title           = "Reviews: " + ViewBag.Title;
            ViewBag.MetaTitle       = "Reviews: " + p.MetaTitle;
            ViewBag.MetaDescription = "Reviews: " + p.MetaDescription;
            ViewBag.MetaKeywords    = "reviews," + p.MetaKeywords;

            List <ProductReview> reviews = p.ReviewsApproved;

            if (reviews == null)
            {
                return(Redirect("~/"));
            }
            if (reviews.Count < 1)
            {
                return(Redirect("~/"));
            }
            model.Reviews = reviews;

            // Load ratings buttons
            ThemeManager tm = MTApp.ThemeManager();

            ViewBag.Star0Url = tm.ButtonUrl("Stars0", Request.IsSecureConnection);
            ViewBag.Star1Url = tm.ButtonUrl("Stars1", Request.IsSecureConnection);
            ViewBag.Star2Url = tm.ButtonUrl("Stars2", Request.IsSecureConnection);
            ViewBag.Star3Url = tm.ButtonUrl("Stars3", Request.IsSecureConnection);
            ViewBag.Star4Url = tm.ButtonUrl("Stars4", Request.IsSecureConnection);
            ViewBag.Star5Url = tm.ButtonUrl("Stars5", Request.IsSecureConnection);

            ViewBag.AvgLabel = SiteTerms.GetTerm(SiteTermIds.AverageRating);
            int avg = CalculateAverageRating(reviews);

            ViewBag.Avg      = avg;
            ViewBag.AvgImage = tm.ButtonUrl("Stars" + avg.ToString(), Request.IsSecureConnection);

            return(View(model));
        }
Пример #7
0
        private CheckoutViewModel IndexSetup()
        {
            ViewBag.Title     = "Checkout";
            ViewBag.BodyClass = "store-checkout-page";

            CheckoutViewModel model = new CheckoutViewModel();

            LoadOrder(model);
            CheckForPoints(model);

            // Buttons
            ThemeManager themes = MTApp.ThemeManager();

            model.ButtonCheckoutUrl = themes.ButtonUrl("PlaceOrder", Request.IsSecureConnection);
            model.ButtonLoginUrl    = MTApp.ThemeManager().ButtonUrl("Login", Request.IsSecureConnection);

            // Labels
            model.LabelRewardPoints = MTApp.CurrentStore.Settings.RewardsPointsName;

            // Agree Checkbox
            if (MTApp.CurrentStore.Settings.ForceTermsAgreement)
            {
                model.ShowAgreeToTerms         = true;
                model.AgreedToTerms            = false;
                model.AgreedToTermsDescription = SiteTerms.GetTerm(SiteTermIds.TermsAndConditionsAgreement);
                model.LabelTerms = SiteTerms.GetTerm(SiteTermIds.TermsAndConditions);
            }
            else
            {
                model.ShowAgreeToTerms = false;
                model.AgreedToTerms    = true;
            }

            // Populate Countries
            model.Countries = MTApp.CurrentStore.Settings.FindActiveCountries();
            model.PaymentViewModel.AcceptedCardTypes = MTApp.CurrentStore.Settings.PaymentAcceptedCards;

            ViewData["PassedAnalyticsTop"] += "<script type=\"text/javascript\" src=\"" + Url.Content("~/js/checkout.js") + "\" ></script>";

            // Render Side Column
            var columnRender = new code.TemplateEngine.TagHandlers.ContentColumn();

            model.SideColumn = columnRender.RenderColumnToString("601", MTApp, ViewBag);

            return(model);
        }
Пример #8
0
        private CheckoutViewModel IndexSetup()
        {
            ViewBag.Title     = "Checkout";
            ViewBag.BodyClass = "store-checkout-page";

            CheckoutViewModel model = new CheckoutViewModel();

            LoadOrder(model);
            CheckForPoints(model);

            // Buttons
            ThemeManager themes = MTApp.ThemeManager();

            model.ButtonCheckoutUrl = themes.ButtonUrl("PlaceOrder", Request.IsSecureConnection);
            model.ButtonLoginUrl    = MTApp.ThemeManager().ButtonUrl("Login", Request.IsSecureConnection);

            // Labels
            model.LabelRewardPoints = MTApp.CurrentStore.Settings.RewardsPointsName;

            // Agree Checkbox
            if (MTApp.CurrentStore.Settings.ForceTermsAgreement)
            {
                model.ShowAgreeToTerms         = true;
                model.AgreedToTerms            = false;
                model.AgreedToTermsDescription = SiteTerms.GetTerm(SiteTermIds.TermsAndConditionsAgreement);
                model.LabelTerms = SiteTerms.GetTerm(SiteTermIds.TermsAndConditions);
            }
            else
            {
                model.ShowAgreeToTerms = false;
                model.AgreedToTerms    = true;
            }

            // Populate Countries
            model.Countries = MTApp.CurrentStore.Settings.FindActiveCountries();
            model.PaymentViewModel.AcceptedCardTypes = MTApp.CurrentStore.Settings.PaymentAcceptedCards;

            return(model);
        }