如何从account.html页面获取用户数据? - BigCommerce

时间:2018-01-08 01:29:21

标签: bigcommerce

我打算通过使用iframe传递用户ID来从我的私人应用中呈现一个页面。为此,我需要获取登录用户的ID。我怎么能得到它?

我尝试了以下选项,除了GLOBAL_StoreName之外,没有任何内容出现。

<h3>%%GLOBAL_AccountPhone%%</h3>
<h3>%%GLOBAL_AccountFirstName%%</h3>
<h2>%%GLOBAL_StoreName%%</h2>
<h2>%%GLOBAL_CustomerId%%</h2>
<h2>%%GLOBAL_CustomerEmail%%</h2>
<h2>%%GLOBAL_CustomerPhone%%</h2>

我打算通过src网址中的iframe传递信息。

<iframe src="https://custom-app.herokuapp.com/account?id=<ID>" width="100%" height="1000px" frameborder="0"></iframe>

更新

我能够获得当前客户的名字和姓氏,但不能获得Id。 %%GLOBAL_CurrentCustomerFirstName%% %% GLOBAL_CurrentCustomerLastName%%

1 个答案:

答案 0 :(得分:1)

{{customer.id}}应该在Stencil主题上返回登录客户的ID,但对于Blueprint(旧版)主题,没有一个全店变量全局变量将返回客户ID。 %% GLOBAL_CustomerId %%仅在表单的模板文件中调用,以重置客户的密码。

作为替代方案,您的应用可以使用当前客户API返回当前客户的ID,电子邮件和客户群: https://developer.bigcommerce.com/api/#current-customer-api

相关问题