Skip to content

Instantly share code, notes, and snippets.

@websterian
websterian / RunSellableItemIntervalStrategy.ps1
Last active Jan 6, 2020
Runs the Sellable item Interval Asynchronous Strategy
View RunSellableItemIntervalStrategy.ps1
#Change these for your environment...
$pathToKernel = 'C:\inetpub\wwwroot\XP0.sc\bin\Sitecore.Kernel.dll'
$indexName = "sitecore_master_index"
$strategyName = "sellableItemsIntervalAsynchronousStrategyMaster"
#Loads the kernel...
try
{
Add-Type -Path $pathToKernel
}
View local.settings.json
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "",
"AzureWebJobsDashboard": "",
"shopsServiceUrl": "https://localhost:5000/api/",
"commerceOpsServiceUrl": "https://localhost:5000/commerceops/",
"defaultEnvironment": "HabitatAuthoring",
"defaultShopName": "storefront",
"defaultShopCurrency": "USD",
View CreateProductRequest.cs
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Azure.WebJobs.Host;
using Sitecore.Commerce.ServiceProxy;
using System;
using Sitecore.Commerce.Engine;
View PostmanExampleCreateUpdateItem.json
{
"info": {
"_postman_id": "4ea2f3c9-d8e0-4ca0-95c2-acf232ee5ef2",
"name": "Examples",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "InventoryUpdate",
"request": {
View SampleJSONBody.json
{
"products" :
[
{
"productid": "Product1",
"listprice": "10.99",
"description": "Product 1 is the best!!!",
"variants" :
[
{
View ConfigureSitecore.cs
using Sitecore.Services.Examples.Catalog.Pipelines;
using Sitecore.Services.Examples.Catalog.Pipelines.Blocks;
namespace Sitecore.Services.Examples.Catalog
{
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
using Commerce.Core;
using Framework.Configuration;
using Sitecore.Framework.Pipelines.Definitions.Extensions;
View ConfigureServiceApiBlock.cs
using Sitecore.Commerce.Core.Commands;
using Sitecore.Commerce.Plugin.Catalog;
namespace Sitecore.Services.Examples.Catalog
{
using System.Threading.Tasks;
using Microsoft.AspNetCore.OData.Builder;
using Commerce.Core;
View ApiController.cs
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Web.Http.OData;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using Sitecore.Commerce.Core;
using Sitecore.Services.Examples.Catalog.Commands;
using Sitecore.Services.Examples.Catalog.Pipelines.Arguments;
View CreateUpdateSellableItemCommand.cs
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Sitecore.Commerce.Core;
using Sitecore.Commerce.Core.Commands;
using Sitecore.Services.Examples.Catalog.Pipelines;
using Sitecore.Services.Examples.Catalog.Pipelines.Arguments;
namespace Sitecore.Services.Examples.Catalog.Commands
{
View CreateUpdateSellableItemBlock.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Sitecore.Commerce.Core;
using Sitecore.Commerce.Plugin.Catalog;
using Sitecore.Commerce.Plugin.Pricing;
using Sitecore.Framework.Conditions;
using Sitecore.Framework.Pipelines;
using Sitecore.Services.Examples.Catalog.Pipelines.Arguments;
You can’t perform that action at this time.