private static void AddSellableItemToCategory() { using (new SampleMethodScope()) { // Add Product2 to the category. EngineExtensions.AssertCategoryExists(CategoryId); EngineExtensions.AddSellableItem(Product2Id, CategoryId, CategoryName, CatalogName); } }
private static void AddSellableItemToCatalog() { using (new SampleMethodScope()) { // Add Product1 to the catalog root. EngineExtensions.AssertCatalogExists(CatalogId); EngineExtensions.AddSellableItem(Product1Id, CatalogId, CatalogName, CatalogName); } }
public static void RunScenarios() { using (new SampleScenarioScope("Composer UX")) { var partial = $"{Guid.NewGuid():N}".Substring(0, 5); _templateId = $"Entity-ComposerTemplate-MyConsoleTemplate{partial}"; _composerViewName = $"MyConsoleView{partial}"; _composerViewDisplayName = $"My Console View {partial}"; _templateName = $"MyConsoleTemplate{partial}"; _entityId = $"ConsoleComposerProduct{partial}".ToEntityId <Plugin.Catalog.SellableItem>(); EngineExtensions.AddSellableItem(_entityId, CatalogName.ToEntityId <Sitecore.Commerce.Plugin.Catalog.Catalog>(), CatalogName, CatalogName); var context = new CsrSheila().Context; context.Environment = EnvironmentConstants.AdventureWorksAuthoring; _authoringContainer = context.ShopsContainer(); var composerEntityViewItemId = AddChildView(); AddProperties(composerEntityViewItemId, _entityId); EditView(composerEntityViewItemId, _entityId); AddMinMaxPropertyConstraint(composerEntityViewItemId, _entityId); AddSelectionOptionPropertyConstraint(composerEntityViewItemId, _entityId); RemoveProperty(composerEntityViewItemId, _entityId); RemoveView(composerEntityViewItemId, _entityId); composerEntityViewItemId = AddChildView(); MakeTemplate(composerEntityViewItemId); RemoveView(composerEntityViewItemId, _entityId); composerEntityViewItemId = AddChildViewFromTemplate(); RemoveView(composerEntityViewItemId, _entityId); var composerTemplateViewItemId = GetTemplateViews(); ManageTemplateTags(); LinkTemplateToEntities(); AddProperties(composerTemplateViewItemId, _templateId); EditView(composerTemplateViewItemId, _templateId); AddMinMaxPropertyConstraint(composerTemplateViewItemId, _templateId); AddSelectionOptionPropertyConstraint(composerTemplateViewItemId, _templateId); RemoveProperty(composerTemplateViewItemId, _templateId); RemoveTemplate(); CreateTemplate(); } }
public static void RunScenarios() { using (new SampleScenarioScope(nameof(InventoryUX))) { var partial = $"{Guid.NewGuid():N}".Substring(0, 3); _catalog1Name = $"InventoryCatalog1{partial}"; _catalog2Name = $"InventoryCatalog2{partial}"; _inventorySet1Name = $"InventorySet1{partial}"; _inventorySet2Name = $"InventorySet2{partial}"; _inventorySet3Name = $"InventorySet3{partial}"; _productName = $"InventoryUXProduct{partial}"; _catalog1Id = _catalog1Name.ToEntityId <Catalog>(); _catalog2Id = _catalog2Name.ToEntityId <Catalog>(); _productId = _productName.ToEntityId <SellableItem>(); _inventorySet1Id = _inventorySet1Name.ToEntityId <InventorySet>(); _inventorySet2Id = _inventorySet2Name.ToEntityId <InventorySet>(); _inventorySet3Id = _inventorySet3Name.ToEntityId <InventorySet>(); _productInventoryInfo1Id = _productName.ToEntityId <InventoryInformation>(_inventorySet1Name); _productInventoryInfo2Id = _productName.ToEntityId <InventoryInformation>(_inventorySet2Name); _inventoryExportFilePath = Path.Combine(Path.GetTempPath(), "consoleinventory.zip"); EngineExtensions.AddCatalog(_catalog1Name, $"{_catalog1Name} Display Name"); EngineExtensions.AddCatalog(_catalog2Name, $"{_catalog2Name} Display Name"); EngineExtensions.AddSellableItem(_productId, _catalog1Id, _catalog1Name, _catalog1Name); EngineExtensions.AssociateSellableItem(_productId, _catalog2Id, _catalog2Name, _catalog2Name); AddInventorySet(); EditInventorySet(); AssociateCatalogToInventorySet(); AssociateSellableItemToInventorySet(); EditInventoryInformation1(); EditInventoryInformation2(); ExportInventorySetsFull().Wait(); TransferInventoryInformation(); DisassociateSellableItemFromInventorySet(); DisassociateCatalogFromInventorySet(); ImportInventorySetsReplace().Wait(); DeleteInventorySet(); } }
public static void RunScenarios() { using (new SampleScenarioScope(nameof(InventoryUX))) { EngineExtensions.AddCatalog(Catalog1Name, $"{Catalog1Name} Display Name"); EngineExtensions.AddCatalog(Catalog2Name, $"{Catalog2Name} Display Name"); EngineExtensions.AddSellableItem(ProductId, Catalog1Id, Catalog1Name, Catalog1Name); EngineExtensions.AssociateSellableItem(ProductId, Catalog2Id, Catalog2Name, Catalog2Name); AddInventorySet(); EditInventorySet(); AssociateCatalogToInventorySet(); AssociateSellableItemToInventorySet(); EditInventoryInformation1(); EditInventoryInformation2(); ExportInventorySetsFull().Wait(); TransferInventoryInformation(); DisassociateSellableItemFromInventorySet(); DisassociateCatalogFromInventorySet(); ImportInventorySetsReplace().Wait(); EngineExtensions.DeleteSellableItem(ProductId, Catalog1Id, Catalog1Name, Catalog1Name); EngineExtensions.DeleteCatalog(Catalog1Name); } }