Use this hook when you need to control the login modal programmatically. It’s useful for protected actions that require authentication, like adding items to a wishlist or accessing account-specific features.Documentation Index
Fetch the complete documentation index at: https://docs.ollie.shop/llms.txt
Use this file to discover all available pages before exploring further.
Import
Return Value
| Property | Type | Description |
|---|---|---|
openLogin | (options?: OpenLoginOptions) => void | Opens the login modal with optional configuration |
closeLogin | () => void | Closes the login modal |
OpenLoginOptions
| Property | Type | Default | Description |
|---|---|---|---|
isRequired | boolean | false | When true, prevents the modal from being closed by clicking the backdrop |
title | string | null | Custom title to display in the login modal header |
Usage
Example
A favorites button that prompts the user to log in before adding an item to their wishlist.- index.tsx
- styles.module.css
Related
- Ollie Login Configuration — Enable or disable the native login modal in the Admin
- Login Required — Configure guest access settings for cart and checkout
- useCheckoutSession — Access customer information and session state