- 🇨🇦Canada netgeek123
This is still an issue that should be addresses by now.
I have customized the commerce-product.html.twig
template of "Drupal Commerce".
I want to display in this file:
1) the flag link (flagged / deflagued).
2) the number of flags on the product.
I managed to display the drapreau link (flagged / deflagated) in twig, but if I created a view that displays all the products with my custom view, the flag link is the link of the page.
This is not correct, the flag link should be the link of the produced entity.
How to display the right link?
I can not get the number of flags on the product.
How to do this ?
<article{{ attributes }}>
<div class="view-teaser-produit">
<div class="views-row">
<div class="views-teaser-type">
Produit
</div>
<div class="views-teaser-image">
{{ product.field_produit_image.0 }}
</div>
<h3 class="views-teaser-title">
{{ product.title }}
</h3>
<div class="views-teaser-variation">
{{ product.variation_price }}
{{ product.variations }}
</div>
<div class="views-teaser-like-count">
<span class="fa-layers fa-fw">
<i class="fas fa-bookmark"></i>
<span class="fa-layers fa-fw">
<i class="fas fa-heart"></i>
<span class="fa-layers-text">{{ product.flag_like_product.count }}</span>
</span>
</span>
</div>
<div class="views-teaser-like-link">
{{ product.flag_like_product }}
</div>
{{ product.stores }}
<div class="views-teaser-more-link">
Voir la fiche produit
</div>
<div class="views-teaser-link">
<a href="{{ product_url }}" title="{{ product_entity.title.value }}"></a>
</div>
</div>
</div>
</article>
Active
4.0
Flag core
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
This is still an issue that should be addresses by now.