templates/website/product/product-detail-banner-section.html.twig line 1

Open in your IDE?
  1. {% from 'utils.html.twig' import ico, imgUpload %}
  2. {% set bannerTextColor = '' %}
  3. {% if (productPage.pageColorText is not null) or (productPage.pageColorText != 'null') %}
  4.     {% set bannerTextColor = "color:#{productPage.pageColorText}" %}
  5. {% endif %}
  6. <section class="product-banner">
  7.     {# BANNER #}
  8.     <div class="banner-img">
  9.         {{ imgUpload(productPage.cover, enum('AbstractEnum::PATH_PRODUCT_COVER'), 'product-cover', product.title) }}
  10.     </div>
  11.     {# COVER #}
  12.     {% include 'website/product/product-detail-cover.html.twig' with { mode:'mobile', img_option: 'product-photo-detail-mobile' }%}
  13.     <div class="container">
  14.         <section class="lateral-products product-banner-color product-banner-title">
  15.             <h1 class="title">{{ product.title }}</h1>
  16.             <div class="info">
  17.                 {#
  18.                 <div class="tags-destaque">
  19.                     <span>{{ getLanguage('best_sellers', 'home') }}</span>
  20.                 </div>
  21.                 ??? !!!*
  22.                 #}
  23.                 {% if productPage.description %}
  24.                     <div class="desc">{{ productPage.description|raw }}</div>
  25.                 {% endif %}
  26.                 {% if (scoreProduct.scoreTotal > 9) %}
  27.                     <div class="avaliacao">
  28.                         {% include 'website/includes/stars.html.twig' with { score: scoreProduct.score }%}
  29.                         <span class="total">{{ getLanguage('based_on', 'product') }} {{ scoreProduct.scoreTotal }} {{ plural(scoreProduct.scoreTotal, getLanguage('evaluation', 'product'), getLanguage('evaluations', 'product')) }}</span>
  30.                     </div>
  31.                 {% endif %}
  32.                 <div class="tags-categorias">
  33.                     {% for item in product.category %}
  34.                         <span class="tag">{{ item.category }}</span>
  35.                     {% endfor %}
  36.                 </div>
  37.             </div>
  38.             <div class="actions">
  39.                 {# WISHLIST #}
  40.                 {% if not userHasProduct(product) and user %}
  41.                     <button class="bookmark js--btn-wishlist {{ isInWhishlist(product.id)? 'status--active' }}"
  42.                         data-product="{{ product.id }}"
  43.                         data-offer="{{ productOffer.id }}"
  44.                         data-title="{{ product.title }}"
  45.                         data-price="{{ productOffer.getPriceRealCopy() }}"
  46.                         data-tooltip-text="{{ isInWhishlist(product.id)? getLanguage('remove_from_wish_list', 'user_resume') : getLanguage('add_to_wish_list', 'user_resume') }}"
  47.                         data-tooltip-class="tooltip-wish">
  48.                         <span class="ico">
  49.                             <i class="heart">{{ ico('heart') }}</i>
  50.                             <i class="loader">{{ ico('loader-wish') }}</i>
  51.                         </span>
  52.                         <span class="label-off txt">{{ getLanguage('favorite', 'product') }}</span>
  53.                         <span class="label-on txt">{{ getLanguage('fav', 'product') }}</span>
  54.                     </button>
  55.                 {% endif %}
  56.                 {# SHARE #}
  57.                 {% set paths = {
  58.                     (enum('ProductEnum::COURSE')):       'productDetailCourse',
  59.                     (enum('ProductEnum::COMBO')):        'productDetailCombo',
  60.                     (enum('ProductEnum::SUBSCRIPTION')): 'productDetailPlan'
  61.                 } %}
  62.                 {% set shareLink = url(paths[product.type], {
  63.                     type: product.getProductTypeText(),
  64.                     slug: product.productLink })
  65.                 %}
  66.                 {% set productPhoto = null %}  
  67.                 {% if productPage.photo %}
  68.                     {% set pathImage = getFilePathComplete({
  69.                         fileName:  productPage.photo,
  70.                         pathConst: enum('AbstractEnum::PATH_PRODUCT_PHOTO'),
  71.                         option:    '',
  72.                         addUpload: enum('AbstractEnum::YES')
  73.                     }) %} 
  74.                     {% set productPhoto = pathImage.pathCdn %}     
  75.                 {% endif %}
  76.                 <button class="share js--share-modal"
  77.                     data-share-url="{{ shareLink }}"
  78.                     data-share-title="{{ product.productLink }}"
  79.                     data-share-photo="{{ productPhoto }}">
  80.                     <i class="ico">{{ ico('share') }}</i>
  81.                     <span class="txt">{{ getLanguage('share', 'product') }}</span>
  82.                 </button>
  83.             </div>
  84.         </section>
  85.         {# FEATURES #}
  86.         {% include 'website/product/product-detail-features.html.twig' %}
  87.         {# PRICING #}
  88.         {% include 'website/product/product-detail-pricing.html.twig' %}
  89.         {% if saleLimitRemaining > 0 %}
  90.             {% if productOffer.getSaleIsOpen() %}
  91.                 {# FREE TRIAL #}
  92.                 {% if productOffer.allowTrial and not userHasProduct(productOffer.product, true) %}
  93.                     <p class="trial">{{ getLanguage('free_access_by', 'product') }} <b>{{ productOffer.trialPeriod }} {{ getLanguage('days', 'product') }}</b></p>
  94.                 {% endif %}
  95.                 {# DISCOUNT AND COUNTDOWN #}
  96.                 {% include 'website/product/product-detail-discountdown.html.twig' %}
  97.                 {# SALE LIMIT #}
  98.                 {% if saleLimitRemaining == 1 %}
  99.                     <p class="sale-limit"><b>{{ getLanguage('remains', 'product') }} 
  100.                     {{ saleLimitRemaining }} {{ getLanguage('vacancy', 'product') }}</b></p>
  101.                 {% else %}
  102.                     <p class="sale-limit"><b>{{ getLanguage('remain', 'product') }} 
  103.                     {{ saleLimitRemaining }} {{ getLanguage('vacancies', 'product') }}</b></p>
  104.                 {% endif %}
  105.             {% endif %}
  106.         {% endif %}
  107.         {# INÍCIO OU FECHAMENTO DA VENDA #}
  108.         {% include 'website/product/product-detail-installment-one.html.twig' %}
  109.         {# BUTTON BOX #}
  110.         <div class="actions-banner">
  111.             <div class="btn-box-product-detail" data-status="{{ isInCart ? '' : 'add' }}">
  112.                 {% include 'website/product/product-detail-actions-btn-box.html.twig' %}
  113.             </div>
  114.         </div>
  115.         {# COUPOM #}
  116.         {% if infoOffer.allowBuyNow and not infoOffer.userHasProduct and productPage.showModuleCoupon %}
  117.             <div class="coupom-banner section-coupom" data-status="{{ isInCart ? '' : 'on' }}">
  118.                 {% include 'website/product/product-detail-coupom.html.twig' %}
  119.             </div>
  120.         {% endif %}
  121.     </div>
  122. </section>