/// <summary> /// Initializes a new instance of the <see cref="TransientOrderManager" /> class. /// </summary> /// <param name="innerRepository">The inner repository.</param> /// <param name="orderConverter">The order converter.</param> /// <param name="orderIdGenerator">The order id generator.</param> /// <param name="customerManager">The customer manager.</param> /// <param name="entityHelper">The entity helper.</param> /// <param name="transactionData">The transaction data.</param> /// <param name="shopContext">The shop context.</param> public TransientOrderManager(VisitorOrderManager innerRepository, TransientOrderConverter orderConverter, OrderIDGenerator orderIdGenerator, ICustomerManager <CustomerInfo> customerManager, EntityHelper entityHelper, ITransactionData transactionData, ShopContext shopContext) { this.innerRepository = innerRepository; this.orderConverter = orderConverter; this.orderIDGenerator = orderIdGenerator; this.customerManager = customerManager; this.entityHelper = entityHelper; this.transactionData = transactionData; this.shopContext = shopContext; }
/// <summary> /// Generates the specified args. /// </summary> /// <param name="args">The arguments.</param> /// <returns>The string.</returns> public string Generate(ServiceClientArgs args) { SiteContext site = Utils.GetExistingSiteContext(args); using (new SiteContextSwitcher(site)) { OrderIDGenerator orderIdGenerator = Context.Entity.Resolve <OrderIDGenerator>(); return(orderIdGenerator.Generate()); } }
/// <summary> /// Initializes a new instance of the <see cref="DefaultOrderFactory"/> class. /// </summary> /// <param name="idGenerator">The id generator.</param> /// <param name="shopContext">The shop context.</param> /// <param name="stateConfiguration">The state configuration.</param> /// <param name="currencyProvider">The currency provider.</param> public DefaultOrderFactory([NotNull] OrderIDGenerator idGenerator, [NotNull] ShopContext shopContext, [NotNull] CoreOrderStateConfiguration stateConfiguration, [NotNull] IEntityProvider <Currency> currencyProvider) { Assert.ArgumentNotNull(idGenerator, "idGenerator"); Assert.ArgumentNotNull(shopContext, "shopContext"); Assert.ArgumentNotNull(stateConfiguration, "stateConfiguration"); Assert.ArgumentNotNull(currencyProvider, "currencyProvider"); this.idGenerator = idGenerator; this.shopContext = shopContext; this.stateConfiguration = stateConfiguration; this.currencyProvider = currencyProvider; }
/// <summary> /// Initializes a new instance of the <see cref="OrderManager<T>"/> class. /// </summary> /// <param name="searchProvider">The search provider.</param> /// <param name="orderIdGenerator">The order id generator.</param> public OrderManager(ISearchProvider searchProvider, OrderIDGenerator orderIdGenerator) { this.entityHelper = Context.Entity.Resolve <EntityHelper>(); this.searchProvider = searchProvider; this.OrderIDGenerator = orderIdGenerator; BusinessCatalogSettings settings = Context.Entity.GetConfiguration <BusinessCatalogSettings>(); Assert.IsNotNull(settings, typeof(BusinessCatalogSettings), "Unable initialize BusinessCatalogSettings."); Assert.IsNotNullOrEmpty(settings.OrdersLink, "Unable initialize Orders root item."); this.Database = Sitecore.Context.ContentDatabase; this.ItemId = settings.OrdersLink; }