How to open the pickup point picker from your own storefront button

Use window.InPostPickup when a custom storefront flow needs to open the InPost or ORLEN pickup picker.

The storefront embed exposes a public API at window.InPostPickup.

The API is available only on a Shopify storefront page where the app embed is enabled.

The picker saves the selected point to the Shopify cart through /cart/update.js.

The same selected point is written to the same cart attributes used by the cart block flow.

A shop that draws its own delivery step can use pickupHeadlessMode.

In pickupHeadlessMode, the app does not render its cart block.

In pickupHeadlessMode, the app does not intercept the checkout click.

The public API still works in pickupHeadlessMode.

window.InPostPickup.open(options) opens the picker and returns a Promise.

That Promise resolves with the selected point after the cart attributes have been saved.

That Promise resolves with null when the buyer closes the picker without choosing a point.

That Promise rejects with code unavailable when the picker cannot open.

window.InPostPickup.clear() removes the pickup selection from the cart.

window.InPostPickup.getSelection() returns the point currently saved in the cart or null.

window.InPostPickup.isAvailable() reports whether the pickup picker can be shown and why.

Events

  • inpost:pickup:ready fires when the API is installed.

  • inpost:pickup:selected fires when a point has been saved in the cart.

  • inpost:pickup:closed fires after each picker opening ends.

  • inpost:pickup:cleared fires after clear() finishes.

Czy ta odpowiedź pomogła?
😞
😐
😁