in Tags: shopify
  • So for this navigate to Apps in your Shopify admin, and then click on SMS Alert.
  • Here click on OTP settings and then enable OTP for login.
  • Change the SMS text as required, and ensure you have this OTP tag in your sms text.
  • Finally click on save changes.
  • Now navigate to Online Store in your Shopify admin and click on Customize button in your current theme.
  • Now click on App embeds and enable SMS Alert Login With OTP option and click on Save button on top right of that page.
  • After that select your page where you want to add Login With OTP.
  • You can add Login With OTP by clicking on Add Section or Add Block.
  • After adding it, click on Save button.
 How to add Login With OTP option at fixed position?
  • So for this navigate to Online Store in your Shopify admin and go to edit code in your current theme.
  • If apps.liquid file not exists in your theme section then create it and add this code
{% schema %}
  {
    "name": "App wrapper",
    "settings": [],
    "blocks": [
      {
        "type": "@app"
      }
    ],
    "presets": [
      {
        "name": "App wrapper"
      }
    ]
  }
{% endschema %}
  • Go to section of your page where you want to add Login With OTP
  • Add below code to that position where you want to show Login With OTP
{% for block in section.blocks %}
    {% render block %}
  {% endfor %}
  • Then repeat previous step to add Login With OTP button.

Lets see how this works in different scenarios.

1.Mobile number is not registered.

Lets try with a number that is not registered on the website, and when he tries to login, this will show an error that the mobile number is not registered.

2.User has an old account on the website.

When any old user tries to login to the website, and if it is not linked to sms alert, the user is asked to enter the last password he remember, after OTP verification

This process will forcefully change the user accounts password to this, so in case the user does not remember the old password, he can put a new password here. And soon after this, he is logged in his account.

3.Uer has an account, and is linked to SMS Alert

The user enters his mobile number, he is prompted to enter the OTP, and upon successful verification, he is logged in to his account.

  1. Can we add Login With OTP button to our page?

    Yes, you can add, by including smsalert loginwithotpbutton section.

    {% section ‘loginwithotpbutton’ %}

FAQ’S
  1. 1. What is the “Login With OTP” feature?

    The feature allows customers on your Shopify store to log in using a **one-time-password (OTP)** sent to their mobile number, instead of or in addition to a password.

  2. 2. How do I enable Login With OTP in the Shopify admin?

    1. Go to **Apps → SMS Alert**.
    2. Within the app, navigate to **OTP Settings** and **enable OTP for login**.
    3. Change the **SMS template text** as required (making sure to include the OTP tag).
    4. Then go to **Online Store → Customize** (your current theme) **→ App embeds** and **enable SMS Alert Login With OTP**. Save the theme.

  3. 3. Can I place the “Login With OTP” button in a custom position on my login page?

    Yes. You can edit your theme’s code:
    – If your theme doesn’t have `apps.liquid`, create it and add the required schema snippet as shown.
    – Then in the section where you want the button, add the code block:

    {% section 'loginwithotpbutton' %}

    This allows you to position the Login With OTP button flexibly.

  4. 4. What happens if a mobile number is not registered on the site and tries to use Login With OTP?

    If the user enters a number that is not registered, an **error is shown** stating the mobile number is not registered.

  5. 5. What happens if a user has an existing account but wasn’t previously linked with SMS Alert?

    1. The user enters their mobile number, the OTP is sent and verified.
    2. Then the user is asked to **enter or change their password** (since old password might not be known) and then they get logged in.
    This allows migrating older accounts into the OTP login flow.

  6. 6. What happens if the user has an account and it’s already linked with SMS Alert?

    The user simply enters their mobile number, receives the OTP, enters the correct code and **gets logged in** — no password entry needed.

  7. 7. Why might I want to use Login With OTP?

    – **Simplifies login process** for users.
    – **Reduces friction** if password is forgotten.
    – Ensures **mobile number authenticity** (helps for later communications/notifications).
    – Helps you capture **valid contact details** and possibly reduce account fraud or misuse.

Still can't find the solution for your Query?

Contact Support