2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Salesforce B2B / D2C Commerce でバリエーション商品をCSVで登録してみる

Last updated at Posted at 2023-07-27

※ これから記載する事項は、私が所属する会社とは一切関係のない事柄です。

今回は CSV インポートを利用して B2B / D2C Commerce へバリエーション商品を登録して行きたいと思います。

登録する商品

今回は1つの親商品と4つの子商品を登録し、エンジンと年でのバリエーション商品を作成したいと思います。

商品名 種類 エンジン
アクスル
アクスル 2021 CX2300 CX2300 2021
アクスル 2013 CX3100 CX3100 2013
アクスル 2021 CX3100 CX3100 2021
アクスル 2011 CX3100 CX3100 2011

その他登録時ポイント

完成時の商品詳細ページ

スクリーンショット 2023-07-27 13.34.02.png

1. 事前準備

商品属性の設定

設定 > オブジェクトマネージャ > 商品属性 に遷移し今回利用する属性を「選択リスト」として作成します。

登録の際は必ず利用する選択肢(例:2021, 2013)も作成してください。

スクリーンショット 2023-07-26 19.20.46.png

バリエーション属性セットの作成

次にコマースアプリケーションから [コマース設定] を選択し、 [バリエーション属性セット] タブをクリックし、さらに「新規」ボタンでポップアップを表示します。任意の名前(今回はAxle Attr Set)を入力し、先ほど作成した商品属性を選択します。

スクリーンショット 2023-07-26 19.22.26.png

2. CSV の作成

下記が作成した CSV です。

Product Name,Category 1,Category 2,Product isActive,Media Standard Url 1,Media Listing URL,SKU,Price (sales) JPY,Price (original) JPY,Variation AttributeSet,Variation Attribute Name 1,Variation Attribute Value 1,Variation Attribute Name 2,Variation Attribute Value 2,Variation Parent (StockKeepingUnit)
アクスル,その他/部品,全ての商品,true,https://s3.amazonaws.com/{省略},https://s3.amazonaws.com/{省略},1234,1000,1000,Axle_Attr_Set,,,,,
アクスル 2021 CX2300,,,true,https://s3.amazonaws.com/{省略},https://s3.amazonaws.com/{省略},1234-01,1000,1000,,Engine__c,CX2300,Year__c,2021,1234
アクスル 2013 CX3100,,,true,https://s3.amazonaws.com/{省略},https://s3.amazonaws.com/{省略},1234-02,900,1000,,Engine__c,CX3100,Year__c,2013,1234
アクスル 2021 CX3100,,,true,https://s3.amazonaws.com/{省略},https://s3.amazonaws.com/{省略},1234-03,900,1000,,Engine__c,CX3100,Year__c,2021,1234
アクスル 2011 CX3100,,,true,https://s3.amazonaws.com/{省略},https://s3.amazonaws.com/{省略},1234-04,1000,1000,,Engine__c,CX3100,Year__c,2011,1234
アクスル 2010 CX3100,,,true,https://s3.amazonaws.com/{省略},https://s3.amazonaws.com/{省略},1234-05,1000,1000,,Engine__c,CX3100,Year__c,2010,1234

ポイント

  • 「Variation AttributeSet」に上記で作成したバリエーション属性セットを親商品に設定します
    • この際 API 参照名を設定する必要があるのですが、1つの確認方法として開発者コンソールから下記の SOQL を実行して「DeveloperName」の値を確認してください
    • Select DeveloperName, MasterLabel from ProductAttributeSet
  • 「Variation Parent (StockKeepingUnit)」に親の SKU(1234) を設定して親子を紐付けます。
    • SKU だけでなく ID や商品コードでも紐付け可能です。詳細は CSV の項目をご覧ください。
  • 「Variation Attribute Name 1」と「Variation Attribute Name 2」にそれぞれ属性名(Engine__cYear__c )を設定
  • 「Variation Attribute Value 1」と「Variation Attribute Value 2」にそれぞれ属性の値を設定
  • 「Category 1」「Category 2」に「全ての商品」「その他 > 部品」カテゴリに設定。
  • 価格表やエンタイトルメントも設定できますが、今回はデフォルトのものを使用するため設定していません。詳細は CSV の項目をご覧ください。

3. ストアへのインポート

コマースアプリケーションでストアの画面のタイルから [インポート] を選択します。
スクリーンショット 2023-07-27 10.48.19.png

ファイルをアップロードし、 [インポート] ボタンをクリックし、商品をインポートします。
スクリーンショット 2023-07-27 10.54.00.png

4. 検索の設定

商品をインポート後は、コマースアプリケーションでストアの画面のタイルから [検索] を選択し、 [検索可能な項目] に上記で作成した商品属性を追加してください。追加後は検索インデックスの再構築を忘れないようにしてください。

スクリーンショット 2023-07-27 13.36.51.png

参考ヘルプ

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?