JavaScript
プログラミング
Salesforce
CommerceCloud
ISML
0

【Salesforce Commerce Cloud】 デベロッパーのトレーニングを受けてきました。

挨拶

こんにちは、イエノカドです。
今回、Salesforce が提供しているCommerce Cloud Digital Developerのトレーニングを受講してきました。
あまり情報も載っていないので、備忘録として記述していきます。
結果的に4日間のトレーニングを受講した1週間後には、Commerce Cloud Digital Developerの資格を取得できました。

Salesforce Commerce Cloudとは

  • セールスフォース・ドットコムが2016年6月に買収したデマンドウェアの製品を基盤とした製品
  • クラウドECプラットフォーム
  • グローバル企業が導入している(アディダス, クロックス, アシックス

Commerce Cloudを開発するためには

  • Commerce Cloud Digital Developer のトレーニングを受講する(34万掛かります)
  • Commerce Cloudのサービスのライセンス契約をする(大手グローバル企業が主に参入しているためバカ高いと思われる)
  • Salesforce Commerce Cloudのパートナー企業となる(資格保有者が4人いる企業がなれるそうです)

開発環境

  • eclipse(Neon)
  • Windows 10 Pro

トレーニングの4日間の中で何を教えてもらえるか

  • Commerce Cloudのカスタマイズ方法(プログラミング)
    • Javascriptコントローラ
    • ISMLテンプレート

基本的に上記内容の通り、Commerce Cloudはサーバー言語がJavascriptで
テンプレートエンジンがISML(HTMLのようなもの)というものです。

トレーニングの中ではJavascriptでサーバー上の処理を書きますが、
JQueryみたいな書き方は基本なく、生書きするようなイメージです。

  • Javascriptコントローラ
JShowProduct.js
'use strict';

// テンプレートエンジンの呼び出し
var ISML = require('dw/template/ISML');
// 関数を新しい名前で設定できる
var guard = require('storefront_controllers/cartridge/scripts/guard');
// 商品マネージャー
var ProductMgr = require('dw/catalog/ProductMgr');

function start() {
    var parameterMap = request.httpParameterMap;
    // Getパラメータ「pid」から値を取得
    var parameterId = parameterMap.pid.stringValue
    // pidから商品データを取得 
    var product = ProductMgr.getProduct(parameterId);
    if (product == null) {
       // 商品情報がnullの場合、テンプレートにメッセージを渡す
       ISML.renderTemplate('productnotfound.isml', {message: 'product with id ' + parameterId +' not found'});  
    } else {
       // 商品データを取得できた場合、商品データをテンプレート変数に設定
       ISML.renderTemplate('productfound.isml', {myProduct: product});
    }
}

// URLの設定
exports.Start = guard.ensure(['get'], start);
  • Javascriptコントローラが実行されるURL
http://xxxx.demandware.net/on/demandware.store/Sites-xxx-Site/default/JShowProduct-Start
  • ISMLテンプレート(「pid」がnullの場合)
productnotfound.isml
<h1> ${pdict.message}  </h1>
  • 表示結果
    image.png

  • ISMLテンプレート(「pid」がある場合)

productfound.isml
<iscomment>Using a custom tag</iscomment>
<isdecorate template="product/pt_productdetails">
    <iscomment> Using the producttile custom tag </iscomment>
    <isinclude template="util/modules.isml" >   
    <isproducttile product="${pdict.myProduct}" showswatches="${true}" showpricing="${true}" showquickview="${false}">
</isdecorate>

<h1> ${pdict.myProduct.name} </h1>
  • 表示結果 image.png

まとめ

  • 基本的にはJavascriptHTML, CSSの理解があればコードは書けそう。
  • ただし、Commerce Cloudならではのお作法(ISML等)があるため、そこは色々試して知っていかなければならない。
  • Commerce Cloudライセンスを契約することはかなり大手(グローバル)企業でないと無理そう。
  • トレーニング費用が個人ではなかなかお高い額のため、「ちょっとやってみたい」ができない。

Commerce Cloud カスタマイズのための情報等がまだまだ日本語では少ないため、今後も調べていき、発信したいと思います。

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away