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
{ | |
"allOrNone": true, | |
"compositeRequest": [ | |
{ | |
"method": "POST", | |
"url": "/services/data/v58.0/sobjects/Order", | |
"referenceId": "refOrder", | |
"body": { | |
"Pricebook2Id": "01sHn000001aU8VIAU", | |
"Name": "Derek Emmett Brown", |
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
'use strict'; | |
exports.setApplicablePriceBooks = function () { | |
var CacheMgr = require('dw/system/CacheMgr'); | |
var Site = require('dw/system/Site'); | |
var cache = CacheMgr.getCache('customer-groups-with-pricebooks'); | |
var cacheKey = Site.getCurrent().ID + '-customer-groups-with-pricebooks'; | |
var customerGroupsWithPricebooks = cache.get(cacheKey, function () { |
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
'use strict'; | |
/** | |
* Job Step Type that calculates random price changes | |
* | |
* - Covers ~25% of all products (search hits) per job run | |
* - Throws the dice to generate +/- 5-30% price changes | |
*/ | |
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
const shortCode = 'abcdefgh'; | |
const tenant = 'zzzz_001'; | |
const clientId = '1234567-890a-bcde-f123-4567890abcd'; | |
const clientSecret = 'secret'; | |
const base = `https://${shortCode}.api.commercecloud.salesforce.com/shopper/auth/v1/organizations/${tenant}/oauth2/passwordless`; | |
/** Start Page with a little form, where you can enter your username **/ | |
function start() { |
This file has been truncated, but you can view the full file.
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
{ | |
"basePath": "/s/-/dw/shop/v22_4", | |
"consumes": [ | |
"application/json", | |
"text/xml", | |
"application/xml" | |
], | |
"definitions": { | |
"approaching_discount": { | |
"description": "Document representing a note to an object.", |
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
{ | |
"basePath": "/", | |
"consumes": [ | |
"application/json", | |
"text/xml", | |
"application/xml" | |
], | |
"definitions": { | |
"image": { | |
"properties": { |
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
/** | |
* Input: Line separated SKUs (e.g grepped from catalog export), inventory export | |
* Output: inventory import of all 0 item items | |
* | |
* Original use case: customer shows Back-in-Stock only if item has zero item inventory, however production cleaned 0 to null removing bis | |
*/ | |
const fs = require('fs'); | |
var readlines = require('n-readlines') |
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
// ==UserScript== | |
// @name Set Parcel Shop Id | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
if (window.location.href.includes('https://production-realm-customer.demandware.net/on/demandware.store/Sites-Site/')) { | |
function waitForElement(selector) { | |
return new Promise(function (resolve, reject) { |
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 customerPromotions = dw.campaign.PromotionMgr.getActiveCustomerPromotions(); | |
/** | |
* Converts a product into a extended object | |
*/ | |
function createExtendedProduct(productId) { | |
var staticCache = dw.system.CacheMgr.getCache('ProductExtendStatic'); | |
var product = dw.catalog.ProductMgr.getProduct(productId); | |
if (!product) { | |
return; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<shipping xmlns="http://www.demandware.com/xml/impex/shipping/2007-03-31"> | |
<shipping-method method-id="standardDHL_DE" default="false"> | |
<display-name xml:lang="x-default">DHL Standard</display-name> | |
<online-flag>true</online-flag> | |
<price-table> | |
<amount order-value="0">0.99</amount> | |
</price-table> | |
<excluded-addresses> | |
<included-addresses> |
NewerOlder