You are here:
Add Slots in Quote Header (Managed Package)
In Enterprise Sales Management, you can add slots in the quote header by extending the b2bCartSummary card. By default, the quote header has three slots that help you capture relevant information such as, cost, margin, and so on.
This feature is part of the Communications Cloud managed package.
| REQUIRED EDITIONS |
|---|
| Available in: Lightning Experience |
| Available in: Enterprise, Unlimited, and Developer editions |
| REQUIRED USER PERMISSIONS | |
|---|---|
| To configure Omnistudio components: | OmniStudio User |
Let's say you want to add a slot, OneTimeMarginTotal. You must extend the b2bCartSummary and b2bSampleApp LWCs.
-
Create an Lightning web component by extending the b2bCartSummary Lightning web
component.
- In Enterprise Sales Management, go to the App Launcher. Enter LWC, and click LWC Designer.
- Click +LWC.
- Click Extend.
- Enter customB2bCartSummary as the LWC name.
- Select the LWC b2bCartSummary.
- Select Include HTML, Include XML Targets, and Omniscript Support.
- Click Create. A custom LWC is created and it opens in LWC Designer.
-
Create the HTML file for customb2bCartSummary.
- In Select a file, select customb2bCartSummary.html.
-
In the editor, enter the HTML. Add the OneTimeMarginTotal <div> element. You
can use this sample HTML:
<template> <div slot="b2bHeaderPricingSection"> <div class="slds-size_1-of-12 slds-p-horizontal_small"> <div class="slds-text-color_weak">{labels.CMEXMonthlyTotal}</div> <div class="b2b-cart-price-text slds-p-top--xx-small">546</div> </div> </div> <div class="nds-p-horizontal_small nds-size_12-of-12 nds-large-size_4-of-12"> <div class="nds-hide_medium nds-border_top"></div> <div class="nds-grid nds-p-vertical_small" if:true={cartData}> <div class="nds-size_1-of-4 nds-shrink-none"> <div class="nds-text-color_weak">{labels.CMEXOneTimeTotal}</div> <div>{oneTimeTotal}</div> </div> <div class="nds-size_1-of-4 nds-shrink-none"> <div class="nds-text-color_weak">{labels.CMEXMonthlyTotal}</div> <div>{monthlyTotal}</div> </div> <div class="nds-size_1-of-4 nds-shrink-none"> <div class="nds-text-color_weak">One Time Margin Total</div> <div>{oneTimeMarginTotal}</div> </div> <div class="nds-size_1-of-4 nds-shrink-none"> <div class="nds-text-color_weak">{cartData.ObjectType} {labels.CMEXTotal}</div> <div>{typeTotal}</div> </div> </div> <div class="slds-spinner_container nds-is-relative" if:false={cartData}> <lightning-spinner alternative-text={labels.CMEXLoading} size="large" variant="brand"> </lightning-spinner> </div> </div> </template> ** Replace the custom tag with the namespace tag wherever applicable - Save your changes. Refresh your browser tab to confirm the changes were saved successfully.
-
Create the JavaScript file for customb2bCartSummary.
- In Select a file, select customb2bCartSummary.js.
-
In the editor, enter the JavaScript. You can use this sample JavaScript:
import B2bCartSummary from 'vlocity_cmt/b2bCartSummary'; import customB2bCartSummaryTemplate from "./customB2bCartSummary.html"; import { formatCurrency } from 'vlocity_cmt/utility'; export default class customB2bCartSummary extends B2bCartSummary { get oneTimeMarginTotal() { return formatCurrency(this.cartData?.OneTimeMarginTotal__c) } render(){ return customB2bCartSummaryTemplate; } connectedCallback() { super.connectedCallback(); } } - Save your changes.
-
Create an Lightning web component by extending the b2bSampleApp Lightning web
component.
- In Enterprise Sales Management, go to the App Launcher. Enter LWC, and click LWC Designer.
- In Enterprise Sales Management, go to the App Launcher. Enter LWC, and click LWC Designer
- Click +LWC.
- Click Extend.
- Enter customB2bSampleApp as the LWC name.
- Select b2bSampleApp.
- Select Include HTML, Include XML Targets, and Omniscript Support.
- Click Create. A custom LWC is created and it opens in LWC Designer.
-
Create the HTML file for customB2bSampleApp.
- In Select a file, select customB2bSampleApp.html.
-
In the editor, paste the b2bSamleApp HTML template. Replace
<c-b2b-cart-summary if:false={route.createQuote.active} name-list={nList}></c-b2b-cart-summary>in the template with<c-custom-b2b-cart-summary if:false={route.createQuote.active} name-list={nList}></c-custom-b2b-cart-summary>. - Save your changes. Refresh your browser tab to confirm the changes were saved successfully.
-
Create the JavaScript file for customB2bSampleApp.
- In Select a file, select customB2bSampleApp.js
-
In the editor, enter the JavaScript. You can use this sample JavaScript:
import B2bCartSummary from 'vlocity_cmt/b2bCartSummary'; import customB2bCartSummaryTemplate from "./customB2bCartSummary.html"; import { formatCurrency } from 'vlocity_cmt/utility'; export default class customB2bCartSummary extends B2bCartSummary { get oneTimeMarginTotal() { return formatCurrency(this.cartData?.OneTimeMarginTotal__c) } render(){ return customB2bCartSummaryTemplate; } connectedCallback() { super.connectedCallback(); } } - Save your changes.
- To deploy the custom Lightning web component to Enterprise Sales Management, see Customize Buttons, Actions, or Fields in Enterprise Sales Management.

