Skip to content

Instantly share code, notes, and snippets.

using System.Collections.Generic;
using Microsoft.Extensions.Logging;
using Sitecore.Commerce.Core;
using Sitecore.Framework.Pipelines;
using Sitecore.Services.Examples.Catalog.Pipelines.Arguments;
namespace Sitecore.Services.Examples.Catalog.Pipelines
{
public class CreateUpdateSellableItemPipeline : CommercePipeline<List<CreateUpdateSellableItemArgument>, bool>, ICreateUpdateSellableItemPipeline
{
using System.Collections.Generic;
using Sitecore.Commerce.Core;
using Sitecore.Framework.Pipelines;
using Sitecore.Services.Examples.Catalog.Pipelines.Arguments;
namespace Sitecore.Services.Examples.Catalog.Pipelines
{
[PipelineDisplayName("CreateUpdateSellableItemPipeline")]
public interface ICreateUpdateSellableItemPipeline : IPipeline<List<CreateUpdateSellableItemArgument>, bool, CommercePipelineExecutionContext>
{
using System.Collections.Generic;
using Sitecore.Commerce.Core;
namespace Sitecore.Services.Examples.Catalog.Pipelines.Arguments
{
public class CreateUpdateSellableItemArgument : PipelineArgument
{
public CreateUpdateSellableItemArgument()
{
Variants = new List<CreateUpdateSellableItemVariantArgument>();
using Sitecore.Commerce.Core;
namespace Sitecore.Services.Examples.Catalog.Pipelines.Arguments
{
public class CreateUpdateSellableItemVariantArgument : PipelineArgument
{
public CreateUpdateSellableItemVariantArgument(string productId, string variantId)
{
ProductId = productId;
VariantId = variantId;
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Sitecore.Collections;
using Sitecore.Commerce.Engine.Connect.DataProvider;
using Sitecore.Commerce.Engine.Connect.SitecoreDataProvider.Extensions;
using Sitecore.Configuration;
using Sitecore.Data;
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore role:require="Standalone or ContentDelivery or ContentManagement">
<dataProviders>
<brandProvider role:require="Standalone or ContentManagement" type="Sitecore.Services.Examples.DataProvider.ReadOnlyBrandDataProvider, Sitecore.Services.Examples.DataProvider">
<param desc="targetDatabaseName">master</param>
<param desc="brandTemplateId">{746AAD00-457F-4644-9F28-6C8758FB97C1}</param>
<param desc="brandFolderTemplateId">{85D5B99D-CA7C-45D9-B5C8-23F97FEF5A20}</param>
</brandProvider>
<brandProvider role:require="ContentDelivery" type="Sitecore.Services.Examples.DataProvider.ReadOnlyBrandDataProvider, Sitecore.Services.Examples.DataProvider">
using System;
using System.Collections.Generic;
using Sitecore.Commerce.Core;
namespace Sitecore.Services.Examples.Entities.Entities
{
public class Brand : CommerceEntity
{
public Brand()
{
using Sitecore.Services.Examples.Entities.Pipelines.Blocks;
namespace Sitecore.Services.Examples.Entities
{
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
using Commerce.Core;
using Framework.Configuration;
using Sitecore.Framework.Pipelines.Definitions.Extensions;
using Commerce.EntityViews;
using System;
using System.Linq;
using System.Threading.Tasks;
using Sitecore.Commerce.Core;
using Sitecore.Commerce.EntityViews;
using Sitecore.Framework.Pipelines;
using Sitecore.Services.Examples.Entities.Entities;
namespace Sitecore.Services.Examples.Entities.Pipelines.Blocks
{
using System;
using System.Linq;
using System.Threading.Tasks;
using Sitecore.Commerce.Core;
using Sitecore.Commerce.EntityViews;
using Sitecore.Framework.Conditions;
using Sitecore.Framework.Pipelines;
using Sitecore.Services.Examples.Entities.Entities;
namespace Sitecore.Services.Examples.Entities.Pipelines.Blocks