The Register reusable renders the customer registration form (first/last name, email, password, confirm password, terms consent), validates user input client-side, and submits the registration via the SDK.
It’s used both as a standalone Register page and inside the Login modal.
Components/Register/Default.liquid renders:
{% render 'Reusables\\Register\\Default', uniquekey: uniquekey %}
Reusables/LoginModal/Default.liquid renders:
{% render 'Reusables\\Register\\Default', uniquekey: uniquekey %}
uniquekey (string)
id/name attributes.Sanitized real storefront example (provided by the user) of the component/page model that renders registration:
{
"name": "Register",
"view": "Default",
"section": "SectionA",
"settings": {
"retypePassword": false,
"id": "Component Id",
"section": "SectionA",
"type": "Register",
"name": "Register",
"configuredInContentApi": false,
"view": "Default",
"displayName": "",
"cssClass": "",
"header": "",
"alignment": "Left"
},
"translations": {
"registerAccount": "Sample text",
"alreadyAccount": "Sample text",
"login": "Sample text"
}
}
Notes:
Reusables.Register.Translations.* and does not read model.translations directly.GlobalData.Settings.showRegistration inside the reusable template.The form is rendered only when:
GlobalData.Settings.showRegistration is truthy.x-data="registerreusabledefault"@submit.prevent="checkForm(uniquekey, successMessage, errorMessageFail, errorMessageUserExists)"
All fields are required unless stated otherwise:
register-firstname-<uniquekey>) (required)register-lastname-<uniquekey>) (required)register-email-<uniquekey>) (required, email format)register-password-<uniquekey>) (required, must pass weak-password rules)register-confirm-password-<uniquekey>) (required, must match password)register-terms-<uniquekey>) (required)Both password fields include a toggle checkbox that triggers toggleVisibility($event) to switch the input type between password and text.
Global object: registerreusabledefault (in Reusables/Register/Default.js).
It is used directly as an Alpine component object (not via an init factory).
fields: array of tracked inputserrors: fieldName -> errorTypeisSending: disables submit while calling the SDKerrorUpLowCaseerrorLengtherrorSymbolNum[name] and filters out disabled/submit.blur listeners to validate fieldschange listener for checkboxesAlso listens for the global event clear-login-modal-forms:
clearForm().detail.preserveToasts === true.Validation rules:
requiredrequiredinvalidEmailweakunmatchedSide effects:
errors[field.name].invalid / valid CSS classes..icon-state to warning/check icons.toggle- prefix).password and text.ic-eye-off <-> ic-preview.Returns true when every field is valid:
errors[field.name]valid / invalid classes..icon-state icons.errors.Submit flow:
Alpine.store('toast').removeAll().FirstNameLastNameEmailPasswordValidatePassword (confirm)servicesreusabledefault.accountRegister(info)errorMessageUserExistssuccess === false -> shows errorMessageFailclearForm()successMessageAlpine.store('loginModal').close(true)This reusable uses:
$store.toast
removeAll()add(message, icon, type, autoClose)$store.loginModal
close(preserveToasts)servicesreusabledefault.accountRegister(info)
Request payload shape (as built by the JS):
{
"FirstName": "Sample text",
"LastName": "Sample text",
"Email": "sample@example.com",
"Password": "Sample text",
"ValidatePassword": "Sample text"
}
Reusables/Register/Default.liquidReusables/Register/Default.jsReusables/Register/Default.jsonComponents/Register/Default.liquidReusables/LoginModal/Default.liquid$store.toast$store.loginModalservicesreusabledefault.accountRegister(...)uniquekey to avoid DOM id collisions when the same form appears more than once (e.g. inside the login modal).GlobalData.Settings.showRegistration; when disabled, this reusable renders nothing.