Instantly share code, notes, and snippets.

View Search.js
'use strict';
/**
* Controller handling search, category, and suggestion pages.
*
* @module controllers/Search
*/
/* API Includes */
var PagingModel = require('dw/web/PagingModel');
View CatalogUtil.js
importPackage( dw.system );
importPackage( dw.customer );
importPackage( dw.util );
importPackage( dw.catalog );
importPackage( dw.object );
function GetCategoriesOverrides(Category)
{
if (empty(Category)) {
return;
View GetColorVariationGroup.js
importPackage( dw.util );
importPackage( dw.system );
importPackage( dw.catalog );
var ProductUtils = require('app_storefront_core/cartridge/scripts/product/ProductUtils.js');
function execute(Product, CurrentVariationModel) {
var pvm : ProductVariationModel = empty(CurrentVariationModel) ? Product.variationModel : CurrentVariationModel;
if (Product.isMaster()) {
//get the first selected variant
View shipping_order_advice_instruction_log_email.xml
<shipping_order_advice_request xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:demandware.com:bf:api:core:v1">
<instructions>
<instruction i:type="shipping_order_advice_instruction_log_email">
<body>body</body>
<creator>Shipment ASN Task</creator>
<date>date</date>
<is_html>true</is_html>
<reply_to>support@modcloth.com</reply_to>
<send>true</send>
<send_from>support@modcloth.com</send_from>
View template_merge_request.xml
<template_merge_request xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:demandware.com:bf:api:core:v1">
<object_key>
<id>object_id</id>
</object_key>
<object_type>object_type</object_type>
</template_merge_request>
View shipping_order_advice_instruction_adjust
<shipping_order_advice_request xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:demandware.com:bf:api:core:v1">
<instructions>
<instruction i:type="shipping_order_advice_instruction_adjust">
<shipping>total_shipping</shipping>
<handling>0</handling>
<reset>not_set</reset>
</instruction>
</instructions>
<key>
<guid>shipping_order_guid</guid>
View shipping_order_advice_instruction_fulfill.xml
<shipping_order_advice_request xmlns=“urn:demandware.com:bf:api:core:v1” xmlns:i=“http://www.w3.org/2001/XMLSchema-instance” i:dummy=“”>
<instructions>
<instruction i:type=“shipping_order_advice_instruction_fulfill”>
<items>
<item>
<key>
<id>item_id</id>
</key>
<quantity>qty</quantity>
</item>
View invoice_advice_instruction_sync_item.xml
<invoice_advice_request xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:demandware.com:bf:api:core:v1">
<instructions>
<instruction i:type="invoice_advice_instruction_sync_item">
<data>
<attributes>
<attribute>
<key>
<id>trackNumber</id>
</key>
<values>
View customer_advice_instruction_log_event.xml
<customer_advice_request xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:demandware.com:bf:api:core:v1">
<instructions>
<instruction i:type="customer_advice_instruction_log_event">
<description>Example Event</description>
<source>Location of event source</source>
</instruction>
</instructions>
<key>
<guid>customer_guid</guid>
</key>
View customer_advice_instruction_tag.xml
<customer_advice_request xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:demandware.com:bf:api:core:v1">
<instructions>
<instruction i:type="customer_advice_instruction_tag">
<id>FRCUST</id>
</instruction>
</instructions>
<key>
<guid>customer_guid</guid>
</key>
</customer_advice_request>