我知道这个 Shopware 6 树枝的状况:
{% if context.customer is defined %}
do show
{% endif %}
但是如何检查客户是否属于特定客户组呢?
您可以查看
SalesChannelContext
类或 dump
模板中的上下文以查看可用的内容。
您在上下文中可以使用
currentCustomerGroup
。
{% if context.currentCustomerGroup.id == 'cfbd5018d38d41d8adca10d94fc8bdd6' %}
do show
{% endif %}