Created
October 27, 2015 11:59
-
-
Save lunchin/a8219d5fc228313be0cc to your computer and use it in GitHub Desktop.
OrderRepository 9.2.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cart = OrderRepository.LoadOrCreate<Cart>(PrincipalInfo.CurrentPrincipal.GetContactId(), Cart.DefaultName).FirstOrDefault(); | |
var price = PriceService.GetDefaultPrice(marketId, | |
DateTime.UtcNow, | |
new CatalogKey(new Guid(variation.ApplicationId), variation.Code), | |
SiteContext.Current.Currency); | |
var lineItem = CreateLineItem(variation, quantity, price.UnitPrice.Amount); | |
cart.Forms.First().Shipments.First().LineItems.Add(lineItem); | |
PromotionEngine.Run(cart); | |
OrderRepository.Save(cart); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment