ミニカートレンダリングのカスタマイズ

Version:
日本語翻訳に関する免責事項

このページの翻訳はAIによって自動的に行われました。可能な限り正確な翻訳を心掛けていますが、原文と異なる表現や解釈が含まれる場合があります。正確で公式な情報については、必ず英語の原文をご参照ください。

ミニカートレンダリングには、Scribanテンプレートというレンダリングバリアントが含まれています。ミニカートレンダリングには独自のデフォルトレンダリングバリアントrootとデフォルトのレンダリングバリアント(/sitecore/Content///Presentation/Rendering Variants/Minicart)があり、マークアップを生成するためにScribanテンプレートを使用します。Scribanテンプレートを修正することは可能ですが、ソフトウェアのアップグレード時にカスタマイズが上書きされないように、新しいカスタムレンダリングバリアントを作成するのが最善です。レンダリングのラベルを変更することも可能です。

!note The Minicart - 廃止されたレンダリングは既存サイトのみで利用可能で、レンダリングバリアントのScribanテンプレートではなくMVCビューに基づいています。

以下のコードは、デフォルトのレンダリングバリアント内で定義されたミニカートレンダリング用のScribanテンプレートを示しています。

{{ # The
element to show error message. }} {{if o\_model.error\_message}}
{{ o\_model.error\_message }}
{{ else }}
{{ # The
element will be available upon mouse hover. }} {{ # In case the datasource is not set fallback to the context item if !i\_datasource i\_datasource = i\_item end }}
{{ sc\_field i\_datasource 'Top Text Label' }} {{ # The

element displays the minicart count. }}

{{ # The
element displays the minicart lines. }}

{{ sc\_raw i\_datasource 'Quantity' }}

{{ sc_raw i_datasource 'Free Gift Text' }}

{{ # The element is used to delete the minicart line. }}
{{ # The element displays the loading bar image. }}

{{ # The

element displays the total and the amount for a minicart line item. }}

{{ # The
element contains two buttons - Checkout and Viewcart. }}
{{ # The
element contains two hidden fields recalculateTotals and cacheCartCount. }} {{ end }}

!重要パフォーマンスを向上させるために、ミニカートカウントキャッシュを無効にし、ミニカートの再計算も可能です。

ミニカートレンダリングモデル

ミニカートレンダリング用のScribanテンプレートでは、以下の図に示すようにMinicartRenderingModelモデルに含まれるプロパティやオブジェクトにアクセスできます。

Class diagram of the Minicart rendering model.

ミニカートコールシーケンス

以下のシーケンス図は、ショッパーがミニカートとやり取りした際の通話の概要を示しています。

Sequence diagram
この記事を改善するための提案がある場合は、 お知らせください!