Compare commits

...

9 Commits

Author SHA1 Message Date
6c858da354 Updated Readme again! 2022-01-04 11:03:19 -07:00
bb01b190df Updated Readme with all topics covered in course 2022-01-04 10:59:23 -07:00
0636939cc7 Beefed up .gitignore
Added sample files folder
Working on pants import job example
Added instructions on how to use node, tested with existing project
2021-12-22 17:33:29 -07:00
e28f44fe57 restructured learning cartridge so it is correctly registered with prophet 2021-12-22 17:06:51 -07:00
Isaac Vallee
d162ce8ed6 Update folder structure & remove unecessary redundant directory 2021-12-22 13:39:34 -08:00
Isaac Vallee
ade208263e Merge branch 'master' of http://24.121.68.9:3333/max/LearningSalesForceCommerceCloud 2021-12-22 10:32:44 -08:00
0825ca85a7 Added Ocapi settings example json 2021-12-22 11:21:12 -07:00
Isaac Vallee
91355f8903 Properly extends ContactUs controller 2021-12-22 10:20:13 -08:00
Isaac Vallee
8a0742d9a8 change append to prepend 2021-12-22 10:05:38 -08:00
46 changed files with 505 additions and 11 deletions

42
.gitignore vendored
View File

@@ -2,4 +2,44 @@ node_modules/
static/
dw.json
.DS_Store
.vscode
.vscode
cartridges/app_storefront_base/cartridge/static/default/css/
cartridges/app_storefront_base/cartridge/static/default/js/
cartridges/app_storefront_base/cartridge/static/default/fonts/
cartridges/app_storefront_base/cartridge/static/fr_FR/css/
cartridges/app_storefront_base/cartridge/static/fr_FR/js/
cartridges/app_storefront_base/cartridge/static/fr_FR/fonts/
cartridges/app_storefront_base/cartridge/static/it_IT/css/
cartridges/app_storefront_base/cartridge/static/it_IT/js/
cartridges/app_storefront_base/cartridge/static/it_IT/fonts/
cartridges/app_storefront_base/cartridge/static/ja_JP/css/
cartridges/app_storefront_base/cartridge/static/ja_JP/js/
cartridges/app_storefront_base/cartridge/static/ja_JP/fonts/
cartridges/app_storefront_base/cartridge/static/zh_CN/css/
cartridges/app_storefront_base/cartridge/static/zh_CN/js/
cartridges/app_storefront_base/cartridge/static/zh_CN/fonts/
cartridges/app_storefront_base/cartridge/static/en_GB/css/
cartridges/app_storefront_base/cartridge/static/en_GB/js/
cartridges/app_storefront_base/cartridge/static/en_GB/fonts/
coverage/
npm-debug.log
cartridges.zip
.idea/
sitegenesisdata/
mobilefirstdata/
storefrontdata/
demo_data_sfra/
demo_data_sfra.zip
test/appium/webdriver/config.json
.history
*.iml
.idea
test/acceptance/report
test/integration/config.json

View File

@@ -0,0 +1,32 @@
{
"_v": "21.9a",
"clients": [
{
"allowed_origins": [
"http://www.sitegenesis.com",
"https://secure.sitegenesis.com"
],
"client_id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"resources": [
{
"resource_id": "/product_search",
"methods": [
"get"
],
"read_attributes": "(**)",
"write_attributes": "(**)",
"cache_time": 900
},
{
"resource_id": "/products/*",
"methods": [
"get"
],
"read_attributes": "(**)",
"write_attributes": "(**)",
"cache_time": 900
}
]
}
]
}

312
Example Files/pants-import.xml Executable file
View File

@@ -0,0 +1,312 @@
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="http://www.demandware.com/xml/impex/catalog/2006-10-31" catalog-id="apparel-m-catalog">
<header>
<image-settings>
<internal-location base-path="/images"/>
<view-types>
<view-type>swatch</view-type>
<view-type>large</view-type>
<view-type>medium</view-type>
<view-type>small</view-type>
</view-types>
<variation-attribute-id>color</variation-attribute-id>
<alt-pattern>${productname}, ${variationvalue}, ${viewtype}</alt-pattern>
<title-pattern>${productname}, ${variationvalue}</title-pattern>
</image-settings>
</header>
<product product-id="blue-pants-1">
<ean/>
<upc/>
<unit/>
<min-order-quantity>1.0</min-order-quantity>
<step-quantity>1.0</step-quantity>
<display-name xml:lang="x-default">Blue Pants</display-name>
<long-description xml:lang="x-default">Blue pants made of denim. Also known as Jeans.</long-description>
<store-force-price-flag>false</store-force-price-flag>
<store-non-inventory-flag>false</store-non-inventory-flag>
<store-non-revenue-flag>false</store-non-revenue-flag>
<store-non-discountable-flag>false</store-non-discountable-flag>
<online-flag>true</online-flag>
<available-flag>false</available-flag>
<searchable-flag>true</searchable-flag>
<searchable-if-unavailable-flag>false</searchable-if-unavailable-flag>
<page-attributes/>
<custom-attributes>
<custom-attribute attribute-id="color">blue</custom-attribute>
<custom-attribute attribute-id="refinementColor">blue</custom-attribute>
<custom-attribute attribute-id="size">S</custom-attribute>
</custom-attributes>
<pinterest-enabled-flag>false</pinterest-enabled-flag>
<facebook-enabled-flag>false</facebook-enabled-flag>
<store-attributes>
<force-price-flag>false</force-price-flag>
<non-inventory-flag>false</non-inventory-flag>
<non-revenue-flag>false</non-revenue-flag>
<non-discountable-flag>false</non-discountable-flag>
</store-attributes>
</product>
<product product-id="red-pants-1">
<ean/>
<upc/>
<unit/>
<min-order-quantity>1</min-order-quantity>
<step-quantity>1</step-quantity>
<display-name xml:lang="x-default">Red Pants</display-name>
<short-description xml:lang="x-default">Matador style pants</short-description>
<long-description xml:lang="x-default">Perfect gift for your bullfighter friend.</long-description>
<store-force-price-flag>false</store-force-price-flag>
<store-non-inventory-flag>false</store-non-inventory-flag>
<store-non-revenue-flag>false</store-non-revenue-flag>
<store-non-discountable-flag>false</store-non-discountable-flag>
<online-flag>true</online-flag>
<available-flag>false</available-flag>
<searchable-flag>true</searchable-flag>
<searchable-if-unavailable-flag>false</searchable-if-unavailable-flag>
<page-attributes/>
<custom-attributes>
<custom-attribute attribute-id="color">red</custom-attribute>
<custom-attribute attribute-id="refinementColor">red</custom-attribute>
<custom-attribute attribute-id="size">S</custom-attribute>
</custom-attributes>
<pinterest-enabled-flag>false</pinterest-enabled-flag>
<facebook-enabled-flag>false</facebook-enabled-flag>
<store-attributes>
<force-price-flag>false</force-price-flag>
<non-inventory-flag>false</non-inventory-flag>
<non-revenue-flag>false</non-revenue-flag>
<non-discountable-flag>false</non-discountable-flag>
</store-attributes>
</product>
<product product-id="blue-pants-2">
<ean/>
<upc/>
<unit/>
<min-order-quantity>1</min-order-quantity>
<step-quantity>1</step-quantity>
<display-name xml:lang="x-default">Blue Pants</display-name>
<long-description xml:lang="x-default">Specifically tailored to camouflage in a pool.</long-description>
<store-force-price-flag>false</store-force-price-flag>
<store-non-inventory-flag>false</store-non-inventory-flag>
<store-non-revenue-flag>false</store-non-revenue-flag>
<store-non-discountable-flag>false</store-non-discountable-flag>
<online-flag>true</online-flag>
<available-flag>false</available-flag>
<searchable-flag>true</searchable-flag>
<searchable-if-unavailable-flag>false</searchable-if-unavailable-flag>
<page-attributes/>
<custom-attributes>
<custom-attribute attribute-id="color">blue</custom-attribute>
<custom-attribute attribute-id="refinementColor">blue</custom-attribute>
<custom-attribute attribute-id="size">M</custom-attribute>
</custom-attributes>
<pinterest-enabled-flag>false</pinterest-enabled-flag>
<facebook-enabled-flag>false</facebook-enabled-flag>
<store-attributes>
<force-price-flag>false</force-price-flag>
<non-inventory-flag>false</non-inventory-flag>
<non-revenue-flag>false</non-revenue-flag>
<non-discountable-flag>false</non-discountable-flag>
</store-attributes>
</product>
<product product-id="white-pants-1">
<ean/>
<upc/>
<unit/>
<min-order-quantity>1</min-order-quantity>
<step-quantity>1</step-quantity>
<display-name xml:lang="x-default">White Pants</display-name>
<short-description xml:lang="x-default">The cleanest pants you have ever seen.</short-description>
<long-description xml:lang="x-default">Do not wear these pants while eating, walking or cleaning as they may get dirty.</long-description>
<store-force-price-flag>false</store-force-price-flag>
<store-non-inventory-flag>false</store-non-inventory-flag>
<store-non-revenue-flag>false</store-non-revenue-flag>
<store-non-discountable-flag>false</store-non-discountable-flag>
<online-flag>true</online-flag>
<available-flag>false</available-flag>
<searchable-flag>true</searchable-flag>
<searchable-if-unavailable-flag>false</searchable-if-unavailable-flag>
<page-attributes/>
<custom-attributes>
<custom-attribute attribute-id="color">white</custom-attribute>
<custom-attribute attribute-id="refinementColor">white</custom-attribute>
<custom-attribute attribute-id="size">S</custom-attribute>
</custom-attributes>
<pinterest-enabled-flag>false</pinterest-enabled-flag>
<facebook-enabled-flag>false</facebook-enabled-flag>
<store-attributes>
<force-price-flag>false</force-price-flag>
<non-inventory-flag>false</non-inventory-flag>
<non-revenue-flag>false</non-revenue-flag>
<non-discountable-flag>false</non-discountable-flag>
</store-attributes>
</product>
<product product-id="white-pants-2">
<ean/>
<upc/>
<unit/>
<min-order-quantity>1</min-order-quantity>
<step-quantity>1</step-quantity>
<display-name xml:lang="x-default">White Pants</display-name>
<short-description xml:lang="x-default">The sheen of the cosmos on your legs.</short-description>
<long-description xml:lang="x-default">A clean, blinding white. Color modeld after the sun. The very star that sustains this planet.</long-description>
<store-force-price-flag>false</store-force-price-flag>
<store-non-inventory-flag>false</store-non-inventory-flag>
<store-non-revenue-flag>false</store-non-revenue-flag>
<store-non-discountable-flag>false</store-non-discountable-flag>
<online-flag>true</online-flag>
<available-flag>false</available-flag>
<searchable-flag>true</searchable-flag>
<searchable-if-unavailable-flag>false</searchable-if-unavailable-flag>
<page-attributes/>
<custom-attributes>
<custom-attribute attribute-id="color">white</custom-attribute>
<custom-attribute attribute-id="refinementColor">white</custom-attribute>
<custom-attribute attribute-id="size">M</custom-attribute>
</custom-attributes>
<pinterest-enabled-flag>false</pinterest-enabled-flag>
<facebook-enabled-flag>false</facebook-enabled-flag>
<store-attributes>
<force-price-flag>false</force-price-flag>
<non-inventory-flag>false</non-inventory-flag>
<non-revenue-flag>false</non-revenue-flag>
<non-discountable-flag>false</non-discountable-flag>
</store-attributes>
</product>
<product product-id="red-pants-2">
<ean/>
<upc/>
<unit/>
<min-order-quantity>1</min-order-quantity>
<step-quantity>1</step-quantity>
<display-name xml:lang="x-default">Red Pants</display-name>
<short-description xml:lang="x-default">Christmas Red</short-description>
<long-description xml:lang="x-default">Wear these pants with a green shirt and everyone will think you are an elf. </long-description>
<store-force-price-flag>false</store-force-price-flag>
<store-non-inventory-flag>false</store-non-inventory-flag>
<store-non-revenue-flag>false</store-non-revenue-flag>
<store-non-discountable-flag>false</store-non-discountable-flag>
<online-flag>true</online-flag>
<available-flag>false</available-flag>
<searchable-flag>true</searchable-flag>
<searchable-if-unavailable-flag>false</searchable-if-unavailable-flag>
<page-attributes/>
<custom-attributes>
<custom-attribute attribute-id="color">red</custom-attribute>
<custom-attribute attribute-id="refinementColor">red</custom-attribute>
<custom-attribute attribute-id="size">M</custom-attribute>
</custom-attributes>
<pinterest-enabled-flag>false</pinterest-enabled-flag>
<facebook-enabled-flag>false</facebook-enabled-flag>
<store-attributes>
<force-price-flag>false</force-price-flag>
<non-inventory-flag>false</non-inventory-flag>
<non-revenue-flag>false</non-revenue-flag>
<non-discountable-flag>false</non-discountable-flag>
</store-attributes>
</product>
<product product-id="red-pants-3">
<ean/>
<upc/>
<unit/>
<min-order-quantity>1</min-order-quantity>
<step-quantity>1</step-quantity>
<display-name xml:lang="x-default">Red Pants</display-name>
<short-description xml:lang="x-default">The color of fire and rage.</short-description>
<long-description xml:lang="x-default">Red Rage Pants. Perfert for fits of rage.</long-description>
<store-force-price-flag>false</store-force-price-flag>
<store-non-inventory-flag>false</store-non-inventory-flag>
<store-non-revenue-flag>false</store-non-revenue-flag>
<store-non-discountable-flag>false</store-non-discountable-flag>
<online-flag>true</online-flag>
<available-flag>false</available-flag>
<searchable-flag>true</searchable-flag>
<searchable-if-unavailable-flag>false</searchable-if-unavailable-flag>
<page-attributes/>
<custom-attributes>
<custom-attribute attribute-id="color">red</custom-attribute>
<custom-attribute attribute-id="refinementColor">red</custom-attribute>
<custom-attribute attribute-id="size">L</custom-attribute>
</custom-attributes>
<pinterest-enabled-flag>false</pinterest-enabled-flag>
<facebook-enabled-flag>false</facebook-enabled-flag>
<store-attributes>
<force-price-flag>false</force-price-flag>
<non-inventory-flag>false</non-inventory-flag>
<non-revenue-flag>false</non-revenue-flag>
<non-discountable-flag>false</non-discountable-flag>
</store-attributes>
</product>
<product product-id="white-pants-3">
<ean/>
<upc/>
<unit/>
<min-order-quantity>1.0</min-order-quantity>
<step-quantity>1.0</step-quantity>
<display-name xml:lang="x-default">White Pants</display-name>
<short-description xml:lang="x-default">All the colors combined.</short-description>
<long-description xml:lang="x-default">Mix all the colors together and you get the color of these pants.</long-description>
<store-force-price-flag>false</store-force-price-flag>
<store-non-inventory-flag>false</store-non-inventory-flag>
<store-non-revenue-flag>false</store-non-revenue-flag>
<store-non-discountable-flag>false</store-non-discountable-flag>
<online-flag>true</online-flag>
<available-flag>false</available-flag>
<searchable-flag>true</searchable-flag>
<searchable-if-unavailable-flag>false</searchable-if-unavailable-flag>
<page-attributes/>
<custom-attributes>
<custom-attribute attribute-id="color">white</custom-attribute>
<custom-attribute attribute-id="refinementColor">white</custom-attribute>
<custom-attribute attribute-id="size">L</custom-attribute>
</custom-attributes>
<pinterest-enabled-flag>false</pinterest-enabled-flag>
<facebook-enabled-flag>false</facebook-enabled-flag>
<store-attributes>
<force-price-flag>false</force-price-flag>
<non-inventory-flag>false</non-inventory-flag>
<non-revenue-flag>false</non-revenue-flag>
<non-discountable-flag>false</non-discountable-flag>
</store-attributes>
</product>
<product product-id="blue-pants-3">
<ean/>
<upc/>
<unit/>
<min-order-quantity>1</min-order-quantity>
<step-quantity>1</step-quantity>
<display-name xml:lang="x-default">Blue Pants</display-name>
<long-description xml:lang="x-default">They look like whale skin. Don't worry. They are vegan.</long-description>
<store-force-price-flag>false</store-force-price-flag>
<store-non-inventory-flag>false</store-non-inventory-flag>
<store-non-revenue-flag>false</store-non-revenue-flag>
<store-non-discountable-flag>false</store-non-discountable-flag>
<online-flag>true</online-flag>
<available-flag>false</available-flag>
<searchable-flag>true</searchable-flag>
<searchable-if-unavailable-flag>false</searchable-if-unavailable-flag>
<page-attributes/>
<custom-attributes>
<custom-attribute attribute-id="color">blue</custom-attribute>
<custom-attribute attribute-id="refinementColor">blue</custom-attribute>
<custom-attribute attribute-id="size">L</custom-attribute>
</custom-attributes>
<pinterest-enabled-flag>false</pinterest-enabled-flag>
<facebook-enabled-flag>false</facebook-enabled-flag>
<store-attributes>
<force-price-flag>false</force-price-flag>
<non-inventory-flag>false</non-inventory-flag>
<non-revenue-flag>false</non-revenue-flag>
<non-discountable-flag>false</non-discountable-flag>
</store-attributes>
</product>
</catalog>

View File

@@ -1,9 +1,15 @@
'use strict';
var base = module.superModule;
var server = require('server');
server.extend(base);
// First, let's extend the ContactUs-Landing route
// to add recaptcha data to the template view
server.append('Landing', function(req, res, next) {
res.setViewData({
// Recaptcha API script URL
recaptchaUrl: 'https://www.google.com/recaptcha/api.js',
siteKey: '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI' // Test Site Key from Google
});
@@ -11,21 +17,26 @@ server.append('Landing', function(req, res, next) {
next();
});
server.append('Subscribe', function(req, res, next) {
// Now we need to extend ContactUs-Subscribe, to add our logic
// that invokes the recaptcha service
// We prepend here to ensure that an invalid response is caught before the email is sent
server.prepend('Subscribe', function(req, res, next) {
var recaptchaService = require('*/cartridge/scripts/services/recaptcha');
// Token automatically added to request by recaptcha
var token = req.form['g-recaptcha-response'];
// Add required parameters for validation call
var params = {
// This is a test secret from Google
// In practice, do not hardcode this. It's better to store
// In a custom preference or service credential Configuration
secret: '6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe', // Test secret key from Google
// In practice, do not hardcode this.
// It's better to store in a custom preference or service credential configuration
secret: '6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe',
response: token
};
// Calls recaptcha service
// Returns a Service class instance
// (start with a hardcoded fail)
var validationResult = recaptchaService.call(params);
// Actual response from Google

View File

@@ -1,2 +1,73 @@
So you want to learn SFCC?
You have come to the right place
# Sales Force Commerce Cloud Training Course
Course Material can be found here [Confluence Page](https://confluence.ontrq.com/display/SA/SFCC+Engineer+Training)
## Topics Covered
1. Material in this guide
1. Introductory Material
1. Beginner Gochas
1. Get an On-Demand Sandbox setup
1. Setting up your Sandbox
1. Import a Demo Site
1. Configure Site Settings for development
1. Overview: Set up VSCode and Local environment
1. Download and Install Visual Studio Code (VS Code)
1. Install Prophet Extension
1. Download or Clone the SFRA storefront code from Github
1. Generate access keys in business manager to upload to allow code upload
1. Browse around the prophet debugger extension tab
1. Compile CSS and JS for storefront website
1. Setup Prophet Code Debugger and Breakpoints
1. Storefront Debug Tools
1. Cartridges and Activating Code Versions
1. Create a New Code Version
1. Create your first cartridge
1. Modify the Cartridge Path
1. Plugin Cartridges
1. Create your First Controller
1. Navigate to a new Route
1. Create another Controller
1. Extend a Controller
1. Customizing Existing Pages - Home Page
1. Middleware Scripts and Chaining
1. Middleware Chaining
1. Pages and Templates - Demo Page
1. Extending a Model
1. Using a decorator to extend a model
1. ISML Templates
1. ISML Template Includes
1. ISML Local Includes
1. ISML Loops
1. ISML Remote Include
1. ISML Debug and extending existing templates
1. Localization using resource bundles
1. Enable Localizations in Business Manager
1. Introduction to Content Slots
1. Create a content slot in a template
1. Setup a Content slot in business manager
1. The Page Designer
1. Create a new page in page designer
1. Layout a new page in page designer
1. Preview your new page, using the page designer previewer
1. Create a route/controller to render your new page designer page
1. Create a custom component for page designer
1. Use and Preview the Feedback Custom Page Designer Component
1. Page Caching
1. Define a Custom Object Type
1. Create a custom attribute group
1. Forms Framework
1. Transactions in a more depth
1. Enable Custom Logging
1. Integrate custom logging
1. View Custom Logs
1. Extend a system object and capture custom data
1. Notification Email - Using a custom hook
1. Making API calls with OCAPI - Open Commerce API
1. Uploading a Product Catalog XML file
1. Create a Job to Import pants.xml
1. Tracking performance of storefront
1. The Pipeline Profiler
1. The Code Profiler
1. Useful Global Variables
1. Acronyms
1. Reference

View File

@@ -1,4 +0,0 @@
## cartridge.properties for cartridge the_learning_cartridge
#Thu Jun 09 11:30:40 EDT 2016
demandware.cartridges.the_learning_cartridge.multipleLanguageStorefront=true
demandware.cartridges.the_learning_cartridge.id=the_learning_cartridge

View File

@@ -0,0 +1,17 @@
<?xml version='1.0' encoding='UTF-8'?>
<projectDescription>
<name>the_learning_cartridge</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.demandware.studio.core.beehiveElementBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.demandware.studio.core.beehiveNature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,11 @@
{
'ecmaVersion': 5,
'plugins': {
'guess-types': {
},
'outline': {
},
'demandware': {
}
}
}'

View File

@@ -0,0 +1,4 @@
## cartridge.properties for cartridge sacrifire
#Wed Nov 22 16:58:16 CEST 2021
demandware.cartridges.sacrifire.multipleLanguageStorefront=true
demandware.cartridges.sacrifire.id=the_learning_cartridge