예제 #1
0
        protected string GetBasketText()
        {
            var helper = new BasketHelper();
            var basket = helper.GetBasket();

            return string.Format("My Basket ({0})", helper.GetProductCount());
        }
예제 #2
0
        protected string GetBasketTotal()
        {
            var helper = new BasketHelper();
            var total = helper.GetBasketTotal();

            return total.ToString("F");
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var helper = new BasketHelper();
            rptOrderHistory.DataSource = helper.GetAllPurchasedProducts();
            rptOrderHistory.DataBind();

            rptCurrentOrders.DataSource = helper.GetAllProducts();
            rptCurrentOrders.DataBind();
        }
예제 #4
0
        protected void AddToCart_Click(object sender, EventArgs e)
        {
            var helper = new BasketHelper();
            var basket = helper.GetBasket();

            if (basket != null)
            {
                // TODO: This doesn't work if there's already a historical product..
                helper.AddProductToBasket(basket, Sitecore.Context.Item.Name, 1);
            }

            var url = Sitecore.Web.WebUtil.GetRawUrl();
            Response.Redirect(url + "?sc_trk={4BEEC42D-0349-4264-93E4-A14C4075CFEF}");
        }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            helper = new BasketHelper();
            // Get basket based on tracker id
            basket = helper.GetBasket();

            if (basket != null)
            {
                rptProducts.DataSource = helper.GetAllProducts(basket);
                rptProducts.DataBind();
            }
        }