简体   繁体   English

Shopify-从客户对象获取客户电子邮件? (js-脚本标签)

[英]Shopify - get customer email from customer object? (js - scripttag)

I need to create a cookie with clientID(need email to create it), when customer register/login on shopify shop. 客户在shopify商店注册/登录时,我需要使用clientID创建cookie(需要创建电子邮件)。

How can I get email during register/login? 在注册/登录期间如何获取电子邮件? Is it possible to get it from Customer object(js injected via script-tag) and how? 是否有可能从Customer对象(通过脚本标签注入的js)中获取它,以及如何获取? The only possible way I see at the moment is to create onclick event on register/login and catch customer e-mail from post? 我目前看到的唯一可能方法是在注册/登录时创建onclick事件,并从帖子中捕获客户电子邮件?

CustomerId (__st.cid) won't work for me. CustomerId(__st.cid)对我不起作用。

You have access to the {{customer.email}} attribute. 您可以访问{{customer.email}}属性。

Once the user register he is redirected to the account page and he is logged in already. 用户注册后,他将被重定向到帐户页面,并且已经登录。

So on the account page you just create the cookie by passing the customer.email to a script and set it there. 因此,在帐户页面上,您只需通过将customer.email传递到脚本并在其中进行设置来创建cookie。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM