如何找到所选的变体值作为变量?

发布于 2025-02-11 12:56:52 字数 146 浏览 1 评论 0原文

我们使用Shopware 6,并希望在变化标题之后显示所选变体值。

示例:

variationName:颜色 Variation Value:蓝色,绿色,黑色,

如果我们选择“黑色”我们要显示:“颜色:黑色”。我们的模板的变量是多少?

we´re using Shopware 6 and want to display the selected variation value after the title of the variation.

Example:

Variationname: Color
Variationvalue: Blue, Green, Black

If we select "Black" we want to display: "Color: Black". Whats the variable for our template?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

埖埖迣鎅 2025-02-18 12:56:53

我找到了解决方案:

{% for option in group.options %}
 {% set isActive = false %}
 {% set isCombinableCls = 'is-combinable' %}
 {% if option.id in page.product.optionIds %}
 {% set isActive = true %}
 {% endif %}
 {% if isActive %}
 {{ option.translated.name }}
 {% endif %}
{% endfor %}

I found the solution:

{% for option in group.options %}
 {% set isActive = false %}
 {% set isCombinableCls = 'is-combinable' %}
 {% if option.id in page.product.optionIds %}
 {% set isActive = true %}
 {% endif %}
 {% if isActive %}
 {{ option.translated.name }}
 {% endif %}
{% endfor %}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文