protected string GetBasketText() { var helper = new BasketHelper(); var basket = helper.GetBasket(); return string.Format("My Basket ({0})", helper.GetProductCount()); }
protected string GetBasketTotal() { var helper = new BasketHelper(); var total = helper.GetBasketTotal(); return total.ToString("F"); }
protected void Page_Load(object sender, EventArgs e) { var helper = new BasketHelper(); rptOrderHistory.DataSource = helper.GetAllPurchasedProducts(); rptOrderHistory.DataBind(); rptCurrentOrders.DataSource = helper.GetAllProducts(); rptCurrentOrders.DataBind(); }
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}"); }
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(); } }