Ejemplo n.º 1
0
        public ActionResult AddToBasket(AddItemModel model)
        {
            // Add to Logical Basket
            // add Umbraco content id to Merchello Product extended data
            var extendedData = new ExtendedDataCollection();

            extendedData.SetValue("umbracoContentId", model.ContentId.ToString(CultureInfo.InvariantCulture));

            // get Merchello product
            var product = Services.ProductService.GetByKey(model.ProductKey);

            // add a single item of the Product to the logical Basket
            Basket.AddItem(product, product.Name, model.OrderAmount, extendedData);

            // Save to Database tables: merchItemCache, merchItemCacheItem
            Basket.Save();

            return RedirectToUmbracoPage(BasketContentId);
        }
Ejemplo n.º 2
0
 public ActionResult Display_BuyButton(AddItemModel product)
 {
     return PartialView("BuyButton", product);
 }