Inject code to render express checkout buttons that lets a shopper buy a specific product.
To render express checkout buttons for a shopper to pay for their current basket, see <ispayment>.
<isbuynow> is only used with B2C Commerce Payments. An associated payments account must be successfully enabled and configured for use on the storefront site where this element appears.
- payment-request = SalesforcePaymentRequest expression
dw.extensions.payments.SalesforcePaymentRequestas part of an expression for the tag. See SalesforcePaymentRequest.
<isbuynow> tag injects <script> code in the page to render express checkout buttons that lets a shopper buy a specific product. See dw.extensions.payments to configure the express checkout buttons and understand how they're rendered.
This tag can appear multiple times on the same page, with no limit. The tag must be placed where
<script> tags are valid, after the closing
</head> tag in the HTML page.
This tag can't be used in a cached template because it's used for the shopper to pay for their current basket. The options in the
SalesforcePaymentRequest include line items with amounts that depend on variables such as, currency, prices, promotions, and applicable shipping methods. Consider these when using this tag in a cached template.
Express checkout buttons are only rendered when applicable for the shopper. If the shopper isn't using a supported device or operating system, or hasn't configured them to use the available express checkout buttons, then no button is presented.
In this example,
<script> code is injected by
<ispayment> to render an Apple Pay button configured with Commerce Cloud Payments on the site. The ID of the component is “applepay” and the CSS class name where the component is to be rendered is “apple-pay-button-container”.
A helper function,
COHelpers.calculateBuyNowData, creates the basket data and payment request options. See dw.extensions.payments for details on how the data prepares a basket when a shopper taps an express checkout button and how the options create line items for the payment request, and then display the browser payment app, such as Apple Pay.
The script code that creates the
SalesforcePaymentRequest object can be placed in a controller.
<isscript> is used here as an example.