STEP 3-1
isCheckoutPlusLine: Identify cart lines
Returns whether a cart line is the Checkout+ product line. It makes no network requests and returns the result immediately. For how to use it in your cart lines, see Don't show the Checkout+ product in the cart line list.
// Argument type (you can pass your cart lines as is)
isCheckoutPlusLine(line: { merchandise?: { product?: { handle?: string | null } | null } | null }): boolean
// Examples
checkoutPlus.isCheckoutPlusLine(line) // A Storefront API cart line
checkoutPlus.isCheckoutPlusLine({ merchandise: { product: { handle } } }) // A cart line in your own format| Line you pass | How to pass it |
|---|---|
A Storefront API cart line (cart.lines) | Pass it as is (if your query includes merchandise.product.handle) |
| A cart line in your own format | Pass it in the form { merchandise: { product: { handle } } } |
- Returns
falsefor lines that are missing any ofmerchandise,product, orhandle. - While on
/v1/, the prefix of the Checkout+ product handle (rcmr-checkout-plus-) does not change. On screens that load the SDK, use this function instead of comparing handles directly.
Exceptions and failures
- Exceptions: None. It makes no network requests, so there are no network failures.
- After
destroy(): It keeps returning results as before.
© Recustomer, Inc.