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

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