1

我正在修改 prestashop 1.4.9 中的 my-account.tpl 并希望在此页面中获取用户电子邮件地址。

但是,我只能访问 {$custmerName}。我已将 {debug} 放入其中,但似乎无法访问。此外,登录后 {$smarty.post} 为空。

有什么建议么?

4

1 回答 1

5

此信息在访问者的 cookie 中可用,您可以轻松地在 my-account.tpl 中显示它:

{l s='Your e-mail address is:'} {$cookie->email|escape:'htmlall':'UTF-8'}

有关更多详细信息,您可以在身份验证时在第 178 行的 /controllers/AuthController.php 中仔细检查分配的位置:

self::$cookie->id_customer = (int)($customer->id);
self::$cookie->customer_lastname = $customer->lastname;
self::$cookie->customer_firstname = $customer->firstname;
self::$cookie->passwd = $customer->passwd;
self::$cookie->logged = 1;
self::$cookie->email = $customer->email;
于 2013-07-30T19:42:41.517 回答