{% if app.user %}
{% if findAllByShopUserAndToken(app.user)|length < 2 %}
<a
href="{{ path('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_add_product', {'productId': product.id}) }}"
class="bitbag-add-to-wishlist bb-wishlist-button product-card-button text-xs"
data-product-name="{{ product.name }}"
{{ sylius_test_html_attribute('wishlist-add-product') }}
>
<span class="material-symbols-outlined">bookmark</span>
{{ 'app.ui.product.card.add_to_list'|trans }}
</a>
{% else %}
<div class="ui hyfindr btn product-card-button bb-wishlist-button pointing bottom dropdown button">
<span class="material-symbols-outlined">bookmark</span>
{{ 'app.ui.product.card.add_to_list'|trans }}
<div class="menu" data-bb-wishlist-hrefs="hrefs-adding-variant">
{% for wishlist in findAllByShopUserAndToken(app.user) %}
<a
href="{{ path('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_add_product_to_selected_wishlist', {'wishlistId': wishlist.id, 'productId': product.id}) }}"
class="item wishlist-item"
data-product-name="{{ product.name }}"
{{ sylius_test_html_attribute('bitbag-add-to-wishlist') }}
>
<span>
{{ wishlist.name }}
</span>
</a>
{% endfor %}
</div>
</div>
{% endif %}
{% else %}
{% if findAllByAnonymousAndChannel(sylius.channel)|length < 2 %}
<a
href="{{ path('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_add_product', {'productId': product.id}) }}"
class="bitbag-add-to-wishlist bb-wishlist-button product-card-button text-xs"
data-product-name="{{ product.name }}"
{{ sylius_test_html_attribute('wishlist-add-product') }}
>
<span class="material-symbols-outlined">bookmark</span>
{{ 'app.ui.product.card.add_to_list'|trans }}
</a>
{% else %}
<div class="ui hyfindr btn product-card-button bb-wishlist-button pointing bottom dropdown button">
<span class="material-symbols-outlined">bookmark</span>
{{ 'app.ui.product.card.add_to_list'|trans }}
<div class="menu" data-bb-wishlist-hrefs="hrefs-adding-variant">
{% for wishlist in findAllByAnonymousAndChannel(sylius.channel) %}
<a
href="{{ path('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_add_product_to_selected_wishlist', {'wishlistId': wishlist.id, 'productId': product.id}) }}"
class="item wishlist-item"
data-product-name="{{ product.name }}"
{{ sylius_test_html_attribute('wishlist-add-product') }}
>
<span>
{{ wishlist.name }}
</span>
</a>
{% endfor %}
</div>
</div>
{% endif %}
{% endif %}