Solved

If customer is logged in then no need for prompt for their email address.

  • 17 February 2021
  • 4 replies
  • 214 views

Badge +2

On product page when my customer is logged in what i want is that there shouldn't be a need for model to pop up to ask for email when user click on  “notify me when available” button. It should directly add customer email from which account that he is logged in and add on the list.

Is there any way i can do that on shopify 

icon

Best answer by caroline 19 February 2021, 18:25

View original

4 replies

Userlevel 5
Badge +8

Hi there,

 

I’m not aware of a way to do this with a pre-built/out-of-the-box solution; however, you would be able to do this programmatically by using Shopify’s liquid syntax to pre-fill the email address filed within the Back in Stock modal.

 

Here is a reference for Shopify’s liquid syntax.

 

You would essentially need to check if the customer is logged in by doing {% if customer %} and then you could access that customer’s email address via {{ customer.email }}. You would need to edit the Klaviyo/Shopify Back in Stock snippet to make this field pre-fill (if the customer is logged in).

 

Hope this helps. Someone else may have suggestions for a plugin or pre-built solution for this.

 

Best,

 

Caroline

Badge +2

What I want to know is how I can change the form because in the model it is just giving me labels and placeholders, not the actual form from where i can change the value input to the customer email.

Userlevel 5
Badge +8

Hi there,

 

You’re right that it’s not possible out of the box to edit the fields in that modal. Sorry for the confusion. Instead, you would need to create your own modal for Back in Stock and use the API endpoints described here to send the data to Klaviyo.

 

Best,

 

Caroline

Userlevel 5
Badge +8

Hi @theplug,

Just wanted to follow up here -- were you able to create your own Back in Stock modal? Any other questions?

Best,

Caroline

Reply