This file contains hidden or 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 instockResource = new Mozu.Api.Resources.Commerce.InStockNotificationSubscriptionResource(_apiContext); | |
var notifications = instockResource.GetInStockNotificationSubscriptionsAsync().Result; | |
var notificationsForProduct = notifications.Items.Where(x => x.ProductCode == "MS-BTL-002-1"); | |
foreach(var notification in notificationsForProduct) | |
{ | |
Console.WriteLine(notification.Email); | |
} |
This file contains hidden or 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
namespace MozuExtensions | |
{ | |
public static class MozuExtensions | |
{ | |
/// <summary> | |
/// Retrieves all products from the master catalog using the tenant that was supplied when Mozu.Api.Resources.Commerce.Catalog.Admin.ProductResource was created. | |
/// <para /> | |
/// Accepts an optional pageSize parameter -- pageSize is set to 200 by default. | |
/// </summary> | |
/// <param name="productResource"></param> |
This file contains hidden or 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
module.exports = function(context, callback) { | |
console.log(context.get.order().items); | |
callback(); | |
}; |
This file contains hidden or 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
[TestMethod] | |
public void Search_Results() | |
{ | |
var searchTuningResource = new Mozu.Api.Resources.Commerce.Catalog.Admin.SearchResource(_apiContext); | |
var settings = searchTuningResource.GetSettingsAsync().Result; | |
settings.SiteSearchSettings[0].CustomFields.Add( | |
new SiteSearchRelevancyCustomField() | |
{ |
This file contains hidden or 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
[TestMethod] | |
public void Fulfill_Digital_Order() | |
{ | |
var orderResource = new Mozu.Api.Resources.Commerce.OrderResource(_apiContext); | |
var orderCollection = orderResource.GetOrdersAsync(filter: "orderNumber eq 393").Result; | |
var orderId = orderCollection.Items.Count > 0 ? orderCollection.Items[0].Id : null; | |
if (orderId != null) | |
{ |
This file contains hidden or 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 order = orderResource.GetOrderAsync(orderId).Result; | |
var digitalPackageResource = new Mozu.Api.Resources.Commerce.Orders.DigitalPackageResource(_apiContext); | |
var digitalPackageItem = new Mozu.Api.Contracts.CommerceRuntime.Fulfillment.DigitalPackageItem() | |
{ | |
ProductCode = order.Items[0].Product.ProductCode, | |
Quantity = order.Items[0].Quantity | |
}; | |
var digitalPackage = new Mozu.Api.Contracts.CommerceRuntime.Fulfillment.DigitalPackage() |
This file contains hidden or 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
/** | |
* This is a scaffold for unit tests for the custom function for | |
* `embedded.commerce.carts.addItem.before`. | |
* Modify the test conditions below. You may: | |
* - add special assertions for code actions from Simulator.assert | |
* - create a mock context with Simulator.context() and modify it | |
* - use and modify mock Mozu business objects from Simulator.fixtures | |
*/ | |
'use strict'; |
This file contains hidden or 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
grunt.registerTask('delActionDomain', 'Deleting the specified action domain...', function(actionDomainName) { | |
//Load the Yeoman file as a variable | |
var yoFile = grunt.file.readJSON('./.yo-rc.json'); | |
//Always delete dist folder and functions.json -- grunt build will recreate these files using manifests | |
grunt.file.delete('./assets/dist'); | |
grunt.file.delete('./assets/functions.json'); | |
if(actionDomainName) { | |
//Delete domain folder | |
grunt.file.delete('./assets/src/domains/' + actionDomainName); | |
//Retrieve each action listed in the Yeoman file |
OlderNewer