Docs
STEP 3-1

mount: Show the banner

mount(target: HTMLElement): { unmount(): void }

Shows the banner in the given element. When the SDK fetches the cart and the benefit set (the commitment charge and benefits for each range), and when it removes a leftover Checkout+ product, follow What the SDK does for each trigger.

  • When to call: When the element for the banner is ready (Step 4: Show the banner). You can show the banner on both the cart page and the cart drawer, and both show the same content.
  • Arguments: target is the HTML element to show the banner in. Pass an empty element.
    • If the element already has content, the SDK keeps the content and adds the banner after it.
    • An element shows one banner. If you call mount() twice on the same element, the SDK removes the previous banner and shows a new banner. Calling the unmount() returned by the first mount() after that does nothing, and the new banner stays.
  • Return value: Returns { unmount() }. Use it to remove only this banner (unmount(): Remove a banner).
  • Checkout+ product lines: Like refresh(), it changes lines only on the first fetch after init(), when it removes a Checkout+ product left over from the previous screen. If it is called while prepareCheckout() is running, or after prepareCheckout() has added the Checkout+ product, the added line is not removed (refresh: Call it any time, any number of times).

The SDK renders the banner and the details dialog. You can change the text and images with displaySettings in init (displaySettings: Text and details dialog), and the look with your CSS ("Change the look with CSS" below). The price, and whether each badge appears, are determined by the benefit set, so your code cannot change them.

Exceptions and failures

  • Exceptions: None.
  • When the cart or the benefit set cannot be fetched: It does not show the banner and reports the reason through onError. What happens on that page follows What the SDK does for each trigger.
  • After destroy(): It shows nothing and returns an unmount() that does nothing.

Parts of the banner

Diagram of the banner with each part numbered

Parts of the banner.

No.PartWhat determines itIf omittedCSS part name (::part)
1Whole banner——banner
2CheckboxThe shopper's actions and initialSelection in initUncheckedcheckbox
3TitledisplaySettings.title「あんしんプラス」 (Anshin Plus)title
4by RecustomerFixed——
5PriceThe benefit set—price, commitment-charge
6DescriptiondisplaySettings.descriptionNot showndescription
7「詳しく見る」 (See details)displaySettings.detailsButtonLabel「詳しく見る」 (See details)details-button
8BadgesText: displaySettings.shippingBadgeLabel and displaySettings.cashbackBadgeLabel. Whether each appears depends on the range's benefits「返品送料無料」 (Free return shipping), 「クーポンバック」 (Coupon cashback)badges, badge, shipping-badge, cashback-badge
9Excluded-item noticedisplaySettings.exclusionNotice「※{excludedItem}は対象外商品です。」 (※{excludedItem} is not eligible.)exclusion-notice, excluded-item
  • Pressing 「詳しく見る」 opens the details dialog.
  • The 「返品送料無料」 (Free return shipping) badge appears in ranges with free return shipping. The 「クーポンバック」 (Coupon cashback) badge appears in ranges with an estimated coupon cashback amount.
  • The excluded-item notice appears only when the cart contains excluded products. You can change how the product names in the notice are written with displaySettings.excludedItemFormat and displaySettings.excludedItemSeparator.
  • You can insert the estimated coupon cashback amount in the description (displaySettings: Text and details dialog).
  • Among the CSS part names, commitment-charge is the commitment charge shown with a strikethrough before the price, badges is the row of badges, badge is each badge, shipping-badge and cashback-badge are the 「返品送料無料」 and 「クーポンバック」 badges, and excluded-item is the product name in the notice.
  • The default text and the default accessible names are in Japanese regardless of locale. To show another language, specify them with displaySettings. "by Recustomer" and "Powered by Recustomer" are fixed and cannot be changed.

Parts of the details dialog

Opens when the shopper presses 「詳しく見る」 on the banner. It is shown overlaid at the center of the screen. Even when the banner is placed inside a cart drawer, the dialog can extend beyond the drawer.

Diagram of the details dialog with each part numbered

Parts of the details dialog.

No.PartWhat determines itIf omittedCSS part name (::part)
1Details dialog——details-modal
2CloseFixed—close-button
3Top imagedisplaySettings.detailsModal.heroImageUrlNot shownhero-image
4LogodisplaySettings.detailsModal.logoImageUrlNot shownlogo-image
5BodydisplaySettings.detailsModal.htmlRecustomer's default textdetails-modal-html
6Powered by RecustomerFixed——

Accessible names and the alternative text of the logo.

TargetField to changeDefault
Accessible name of the details dialogdisplaySettings.detailsModal.ariaLabel{title}の詳細 ({title} details)
Accessible name of the close buttondisplaySettings.detailsModal.closeButtonAriaLabel閉じる (Close)
Alternative text of the logodisplaySettings.detailsModal.logoImageAltストアロゴ (Store logo)
Accessible name of the "Powered by Recustomer" linkdisplaySettings.detailsModal.poweredByLinkAriaLabelRecustomer(別タブで開く) (Recustomer, opens in a new tab)

Display in each situation

A banner with an empty checkbox. The price is ¥550, with the badges for free return shipping and coupon cashback

① The box is not checked The state when the cart is opened. For stores that set initialSelection to true, it looks like ②

A banner with a checked checkbox. The price is ¥550, and the border is darker

② The box is checked The shopper has checked the box. The Checkout+ product is added to the cart inside prepareCheckout(), which you call from the checkout button

A banner showing the commitment charge ¥600 with a strikethrough before the price of ¥550

③ A range where the merchant covers part of the commitment charge For ranges where the merchant-borne amount is set in the benefit set, the commitment charge is shown with a strikethrough before the price. In ranges where the merchant covers all of it, the price is shown as ¥0. In these ranges too, the initial state of the checkbox follows initialSelection

Change the look with CSS

The banner is rendered inside a Shadow DOM, so regular CSS rules that use class names and the like do not apply. Use the following two methods.

CSS variables

CSS variableDefaultWhat it changes
--checkout-plus-text#222Text color
--checkout-plus-muted-text#555Color of lighter text, such as the description
--checkout-plus-notice-color#b42318Color of the excluded-item notice
--checkout-plus-accent#111Color of the checkbox and of the border when the box is checked
--checkout-plus-background#fffBanner background
--checkout-plus-selected-background#fafafaBanner background when the box is checked
--checkout-plus-border#e5e5e5Border color
--checkout-plus-radius14pxBanner corner radius
--checkout-plus-details-modal-radius20pxDetails dialog corner radius
--checkout-plus-font-family-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serifFont

Styling individual parts (::part)

Use the CSS part names from the "Parts of the banner" and "Parts of the details dialog" tables above, in the form rcmr-checkout-plus::part(name).

/* Change colors, corners, and font with CSS variables */
rcmr-checkout-plus {
  --checkout-plus-accent: #0b6e4f;
  --checkout-plus-border: #b7e4c7;
  --checkout-plus-selected-background: #f0faf4;
  --checkout-plus-radius: 4px;
  --checkout-plus-text: #1b4332;
}
/* Change individual parts with ::part() */
rcmr-checkout-plus::part(title) { font-weight: 700; letter-spacing: 0.04em; }
rcmr-checkout-plus::part(details-button) { text-decoration: underline; }
rcmr-checkout-plus::part(badge) { border-radius: 2px; }

Example of the banner with its look changed by CSS

The result of applying the CSS above.

© Recustomer, Inc.