{% from 'utils.html.twig' import imgUpload, discountPrices, getProductLink, ico %}
{% set addCartLink = addCartLink is defined ? addCartLink : false %}
{% set suggestionLink = suggestionLink is defined ? suggestionLink : '' %}
<div class="sec--default">
<article class="item-curso">
<a href="{{ getProductLink(item, productCoupon ?? null, addCartLink, suggestionLink) }}">
<div class="foto">
{{
imgUpload(
item.productPage.photo,
enum('AbstractEnum::PATH_PRODUCT_PHOTO'),
'product-box-default-new-2',
item.product.title
)
}}
<div class="mask"></div>
</div>
{# WISHLIST #}
{% if not userHasProduct(item.product) and user %}
{% include 'website/controls/btn-wishlist.html.twig' with {
'wish_id': item.product.id,
'wish_offer_id': item.id,
'wish_title': item.product.title,
'wish_currency': item.currencyCode,
'wish_price': item.getPriceRealCopy(),
}%}
{% endif %}
{# TAGS -- SCORE #}
<div class="wrap-tags-score">
{# TAGS #}
<div class="wrap-tags">
{% include 'website/includes/subscription-tags.html.twig' %}
</div>
{# SCORE #}
{% set scoreProduct = getScoreProduct(item.product) %}
{% if (scoreProduct.scoreTotal > 9) and item.productPage.showModuleTestimonials and getConfig('allow_testimonial') == enum('CourseEnum::YES') %}
<span class="avaliacao">
<span class="nota">{{ scoreProduct.score }}</span> 
{% include 'website/includes/stars.html.twig' with { score: scoreProduct.score } %}
</span>
{% endif %}
</div>
<div class="info">
<div>
{# WORKLOAD #}
{% set timeTotal = getTimeTotalProduct(item.product) %}
{% if timeTotal > 0 %}
<p class="workload">
{{ ico('clock') }}{{ timeTotal }}
{{ plural(timeTotal,
getLanguage('workload_home_hour', 'product'),
getLanguage('workload_home_hours', 'product')
)}}
</p>
{% endif %}
{# TITLE #}
<p class="desc" title="{{ item.product.title }}">{{ item.product.title }}</p>
</div>
<div class="precos">
{# HAS PRODUCT #}
{% if userHasProduct(item.product) %}
<p class="preco-original">{{ getLanguage('acquired', 'product')|upper }}</p>
<p class="preco-gratis">{{ getLanguage('access2', 'product')|upper }}</p>
{# FREE #}
{% elseif item.saleOption == enum('ProductOfferEnum::FREE') and item.getSaleIsOpen() %}
{% if item.notForSale == enum('ProductOfferEnum::NO') %}
<p class="preco-original">{{ getLanguage('free2', 'product')|upper }}</p>
<p class="preco-gratis">{{ getLanguage('access2', 'product')|upper }}</p>
{% endif %}
{# PRICE #}
{% elseif checkProductOfferIsOnSale(item) %}
{% if item.notForSale == enum('ProductOfferEnum::NO') %}
{{ discountPrices(item) }}
{% endif %}
{# WAITLIST #}
{% else %}
{% if item.notForSale == enum('ProductOfferEnum::NO') %}
{% if
item.nextProductOffer and
checkProductOfferIsOnSale(item.nextProductOffer)
%}
{{ discountPrices(item.nextProductOffer) }}
{% else %}
{% set messageItemBox = item.getDiffDuration().start == true ?
getLanguage('coming_soon_access', 'product')|upper :
getLanguage('closed_access', 'product')|upper
%}
<p class="preco-original">{{ messageItemBox }}</p>
<p class="lista-espera">{{ getLanguage('waitlist', 'product') }}</p>
{% endif %}
{% endif %}
{% endif %}
</div>
</div>
</a>
</article>
</div>