Skip to main content

CartLineItemApi

Requires access to protected customer data for some properties.

This API object is provided to extensions registered for the purchase.cart-line-item.line-components.render, purchase.checkout.cart-line-item.render-after, purchase.thank-you.cart-line-item.render-after, and customer-account.order-status.cart-line-item.render-after extension targets.

It extends the StandardApi and provides the target cart line item associated with the extension.

See the StandardApi examples for more information on how to use the API.

StatefulRemoteSubscribable<>
required

The cart line the extension is attached to. Until version 2023-04, this property was a StatefulRemoteSubscribable<PresentmentCartLine>.

Was this section helpful?
import {
reactExtension,
Text,
useTarget,
} from '@shopify/ui-extensions-react/checkout';

export default reactExtension(
'purchase.checkout.cart-line-item.render-after',
() => <Extension />,
);

function Extension() {
const {
merchandise: {title},
} = useTarget();
return <Text>Line item title: {title}</Text>;
}