【问题标题】:Shopware 6 : Check globally if customer is connectedShopware 6:全局检查客户是否已连接
【发布时间】:2023-01-03 12:25:52
【问题描述】:

如何全局检查客户是否登录了 Shopware 6 的所有模板(不适用于特定路线)? 我想使用模板树枝检查这个变量。

【问题讨论】:

  • 您指的是 “logging in” 吗?

标签: twig shopware shopware6


【解决方案1】:

您可以在任何模板中使用以下 if 语句来检查客户当前是否已登录:

{% if context.customer is defined %}
    customer is logged in
{% endif %}

【讨论】:

    猜你喜欢
    • 2015-08-04
    • 2012-05-19
    • 2018-06-11
    • 1970-01-01
    • 2013-07-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多