PickupPointsApi

Requires access to protected customer data for some properties.

This API object is provided to extensions registered for the Checkout::PickupPoints::RenderBefore or Checkout::PickupPoints::RenderAfter extension points.

It extends the StandardApi and provides a isLocationFormVisible boolean to indicate whether the customer location input form is currently rendered and shown to the buyer.

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

Anchor to isLocationFormVisible
isLocationFormVisible
StatefulRemoteSubscribable<boolean>
required

Whether the customer location input form is shown to the buyer.

Was this section helpful?
Copy
import React, {useState} from 'react';
import {
render,
useExtensionApi,
useSubscription,
Text,
} from '@shopify/checkout-ui-extensions-react';

render(
'Checkout::PickupPoints::RenderBefore',
() => <Extension />,
);

function Extension() {
const {isLocationFormVisible} =
useExtensionApi();

const locationFormShown = useSubscription(
isLocationFormVisible,
);

if (locationFormShown) {
return (
<Text>
The customer is being asked to provide
their location.
</Text>
);
} else {
return (
<Text>Pickup points are being shown.</Text>