Code
Behaviour
The button adapts to the shopper’s state:
While enrollment is in progress the button shows a loading state and is disabled. If enrollment fails, an inline error message is shown beneath the button and the shopper can try again.
Once enrollment succeeds, other components on the page that require an enrolled member — such as points balance, referral URL, or tier progress — begin rendering without a page reload.
If your program enrolls customers automatically, every logged-in shopper is
already a member, so this component renders nothing for them. Blocked
customers are treated as members too, so they see nothing rather than an
invitation to re-join.
Styling
The button uses the samelion-action-button class as other LoyaltyLion buttons, so any custom CSS you already apply to them applies here too. The inline failure message is a lion-join-program__error element, which you can style to match your page.