templates/website/product/product-item-box-default.html.twig line 1

Open in your IDE?
  1. {% from 'utils.html.twig' import imgUpload, discountPrices, getProductLink, ico %}
  2. {% set addCartLink = addCartLink is defined ? addCartLink : false %}
  3. {% set suggestionLink = suggestionLink is defined ? suggestionLink : '' %}
  4. <div class="sec--default">
  5.     <article class="item-curso">
  6.         <a href="{{ getProductLink(item, productCoupon ?? null, addCartLink, suggestionLink) }}">
  7.             <div class="foto">
  8.                 {{  
  9.                     imgUpload(
  10.                         item.productPage.photo, 
  11.                         enum('AbstractEnum::PATH_PRODUCT_PHOTO'),
  12.                         'product-box-default-new-2',
  13.                         item.product.title
  14.                     ) 
  15.                 }}
  16.                 <div class="mask"></div>
  17.             </div>
  18.             {# WISHLIST #}
  19.             {% if not userHasProduct(item.product) and user %}
  20.                 {% include 'website/controls/btn-wishlist.html.twig' with {
  21.                     'wish_id': item.product.id,
  22.                     'wish_offer_id': item.id,
  23.                     'wish_title': item.product.title,
  24.                     'wish_currency': item.currencyCode,
  25.                     'wish_price': item.getPriceRealCopy(),
  26.                 }%}
  27.             {% endif %}
  28.             {# TAGS -- SCORE #}
  29.             <div class="wrap-tags-score">
  30.                 {# TAGS #}
  31.                 <div class="wrap-tags">
  32.                     {% include 'website/includes/subscription-tags.html.twig' %}
  33.                 </div>
  34.                 {# SCORE #}
  35.                 {% set scoreProduct = getScoreProduct(item.product) %}
  36.                 {% if (scoreProduct.scoreTotal > 9) and item.productPage.showModuleTestimonials and getConfig('allow_testimonial') == enum('CourseEnum::YES') %}
  37.                     <span class="avaliacao">
  38.                         <span class="nota">{{ scoreProduct.score }}</span>&thinsp;
  39.                         {% include 'website/includes/stars.html.twig' with { score: scoreProduct.score } %}
  40.                     </span>
  41.                 {% endif %}
  42.             </div>
  43.             <div class="info">
  44.                 <div>
  45.                     {# WORKLOAD #}
  46.                     {% set timeTotal = getTimeTotalProduct(item.product) %}
  47.                     {% if timeTotal > 0 %}
  48.                         <p class="workload">
  49.                             {{ ico('clock') }}{{ timeTotal }} 
  50.                             {{ plural(timeTotal, 
  51.                                 getLanguage('workload_home_hour', 'product'), 
  52.                                 getLanguage('workload_home_hours', 'product')
  53.                             )}}
  54.                         </p>
  55.                     {% endif %}
  56.                     {# TITLE #}
  57.                     <p class="desc" title="{{ item.product.title }}">{{ item.product.title }}</p>
  58.                 </div>
  59.                 <div class="precos">
  60.                     {# HAS PRODUCT #}
  61.                     {% if userHasProduct(item.product) %}
  62.                         <p class="preco-original">{{ getLanguage('acquired', 'product')|upper }}</p>
  63.                         <p class="preco-gratis">{{ getLanguage('access2', 'product')|upper }}</p>
  64.                         
  65.                     {# FREE #}
  66.                     {% elseif item.saleOption == enum('ProductOfferEnum::FREE') and item.getSaleIsOpen() %}
  67.                         {% if item.notForSale == enum('ProductOfferEnum::NO') %}
  68.                             <p class="preco-original">{{ getLanguage('free2', 'product')|upper }}</p>
  69.                             <p class="preco-gratis">{{ getLanguage('access2', 'product')|upper }}</p>
  70.                         {% endif %}
  71.                     {# PRICE #}
  72.                     {% elseif checkProductOfferIsOnSale(item) %}
  73.                         {% if item.notForSale == enum('ProductOfferEnum::NO') %}
  74.                             {{ discountPrices(item) }}
  75.                         {% endif %}
  76.                     {# WAITLIST #}
  77.                     {% else %}
  78.                         {% if item.notForSale == enum('ProductOfferEnum::NO') %}
  79.                             {% if 
  80.                                 item.nextProductOffer and 
  81.                                 checkProductOfferIsOnSale(item.nextProductOffer) 
  82.                             %}
  83.                                 {{ discountPrices(item.nextProductOffer) }}
  84.                             {% else %}
  85.                                 {% set messageItemBox = item.getDiffDuration().start == true ? 
  86.                                         getLanguage('coming_soon_access', 'product')|upper : 
  87.                                         getLanguage('closed_access', 'product')|upper
  88.                                 %}
  89.                                 <p class="preco-original">{{ messageItemBox }}</p>
  90.                                 <p class="lista-espera">{{ getLanguage('waitlist', 'product') }}</p>
  91.                             {% endif %}
  92.                         {% endif %}
  93.                     {% endif %}
  94.                 </div>
  95.             </div>
  96.         </a>
  97.     </article>
  98. </div>