templates/website/product/product-detail.html.twig line 254

Open in your IDE?
  1. {% from 'utils.html.twig' import moeda, ico, imgUpload %}
  2. {% extends 'website/main.template.html.twig' %}
  3. {% block title %}
  4.     <title>{{ "#{productPage.title} - #{client.brand}" }}</title>
  5.     <meta name="title" content="{{ "#{productPage.title} - #{client.brand}" }}">
  6.     <meta property="og:title" content="{{ "#{productPage.title} - #{client.brand}" }}">
  7. {% endblock %}
  8. {% block bodyTag %}
  9.     <body 
  10.         id="body" 
  11.         class="product-detail-body {{ productPage.showShortageControlTime ? 'page-height-top' }}" 
  12.         data-theme="{{ isDarkTheme? 'dark':'light' }}"
  13.         {% if isDarkTheme %} data-hide-deco="{{ hideBgDeco? 1:0 }}"{% endif %}
  14.         data-shortagevisualizationnumber="{{ productPage.shortageVisualizationNumber }}"
  15.         data-shortagebuyersnumber="{{ productPage.shortageBuyersNumber }}"
  16.         data-shortagevacanciesnumber="{{ productPage.shortageVacanciesNumber }}"
  17.         data-shortagevisualization="{{ productPage.showShortageControlVisualization }}"
  18.         data-shortagebuyers="{{ productPage.showShortageControlBuyers }}"
  19.         data-shortagevacancies="{{ productPage.showShortageControlVacancies }}"
  20.         data-shortagestorage="{{ actualDomain }}_{{ productOffer.id }}_{{ session ? session.user.id }}">
  21. {% endblock %}
  22. {% block product_detail_css %}
  23.     {% include 'website/includes/css-product-detail.html.twig' %}
  24. {% endblock %}
  25. {% block meta %}
  26.     {% if (productPage.overview) %}
  27.         <meta name="description" content="{{ productPage.overview }}">
  28.         <meta property="og:description" content="{{ productPage.overview }}">
  29.     {% endif %}
  30.     <meta property="og:image" content="https:{{
  31.         getFilePathComplete({
  32.             fileName: (productPage.photo|length > 0)? productPage.photo : getConfig('image_default'),
  33.             pathConst: enum('AbstractEnum::PATH_PRODUCT_PHOTO'),
  34.             addUpload: enum('AbstractEnum::YES')
  35.         }).pathCdn
  36.     }}">
  37. {% endblock %}
  38. {% block metaIndex %}
  39.     {% if productOffer.default != enum('ProductEnum::YES') %}
  40.         <meta name="robots" content="nofollow">
  41.     {% else %}
  42.         <meta name="robots" content="index, follow">
  43.     {% endif %}
  44. {% endblock %}
  45. {% set productTypeText = getProductTypeTextTranslate(product.type) %}
  46. {% set isOne = (productOffers|length > 1 or product.type != enum('ProductEnum::SUBSCRIPTION')) %}
  47. {% set infoOffer = getInfoAccessProductOffer(productOffer, false, productCoupon, isOne) %}
  48. {% set isInCart  = productIsInCart(product.id, productOffer.id) %}
  49. {% set canBuyNow = (infoOffer.allowBuyNow or infoOffer.isFree) %}
  50. {% block body %}
  51.     {# FAST TIMER #}
  52.     {% include 'website/includes/fast-timer.html.twig' %}
  53.     {# SEARCH #}
  54.     {% include 'website/includes/search-section.html.twig' %}
  55.     {# BANNER #}
  56.     {% include 'website/product/product-detail-banner-section.html.twig' %}
  57.     {# LIBRARY INIT #}
  58.     <div id="wrap-video-init">
  59.         {% if productPage.library is not empty and credentials %}
  60.             {% include 'website/includes/video.html.twig' with {
  61.                 url: "https://player.vdocipher.com/v2/?otp=#{ credentials.otp }&playbackInfo=#{ credentials.playbackInfo }&primaryColor=#{ getConfig('primary_color')|trim('#') }",
  62.                 autoplay: productPage.autoplay,
  63.                 title: product.title,
  64.                 width: 353,
  65.                 height: 211,
  66.                 library: true,
  67.             }%}
  68.         {# VIDEO INIT #}
  69.         {% elseif productPage.video is not empty %}
  70.             {% include 'website/includes/video.html.twig' with {
  71.                 url: productPage.video, 
  72.                 autoplay: productPage.autoplay,
  73.                 title: product.title,
  74.                 width: 353,
  75.                 height: 211,
  76.                 library: false,
  77.             }%}
  78.         {% endif %}
  79.     </div>
  80.     <div class="contem-menu-anchors">
  81.         <section class="menu-anchors" data-page-height-top="{{ productPage.showShortageControlTime ? '1':'0' }}">
  82.             <div class="container">
  83.                 <nav class="lateral-products">
  84.                     {% if productPage.about|length > 0 %}
  85.                         <a data-link-scroll="#sec-about">{{ getLanguage('about', 'product') }}</a>
  86.                     {% endif %}
  87.                     {% if product.type == enum('ProductEnum::COURSE') and lessonModules|length > 0 %}
  88.                         <a data-link-scroll="#sec-content">
  89.                             {{ getLanguage('content', 'product') }}
  90.                         </a>
  91.                     {% endif %}
  92.                     {% if product.type == enum('ProductEnum::SUBSCRIPTION') or product.type == enum('ProductEnum::COMBO') %}
  93.                         {% if courses|length > 0 %}
  94.                             <a data-link-scroll="#sec-content">
  95.                                 {{ getLanguage('courses', 'product') }}
  96.                             </a>
  97.                         {% endif %}
  98.                     {% endif %}
  99.                     {% if teacherSection.teachers|length > 0 %}
  100.                         <a data-link-scroll="#sec-instructors">{{ getLanguage('instructors', 'product') }}</a>
  101.                     {% endif %}
  102.                     {% if isModuleActive('faq_module') and faqs|length > 0 %}
  103.                         <a data-link-scroll="#sec-faq">FAQ</a>
  104.                     {% endif %}
  105.                     {% if scoreProduct.scoreTotal > 0 and productPage.showModuleTestimonials and getConfig('allow_testimonial') == enum('CourseEnum::YES') %}
  106.                         <a data-link-scroll="#sec-reviews">{{ getLanguage('rates', 'product') }}</a>
  107.                     {% endif %}
  108.                 </nav>
  109.             </div>
  110.         </section>
  111.     </div>
  112.     <div class="container">
  113.         {# ABOUT #}
  114.         {% if productPage.about|length > 0 %}
  115.             <section id="sec-about" class="text-open lateral-products">
  116.                 <h2>
  117.                     {% if product.type == enum('ProductEnum::SUBSCRIPTION') %}
  118.                         {{"#{getLanguage('about_the2', 'product')} #{productTypeText|capitalize}"}}
  119.                     {% else %}
  120.                         {{"#{getLanguage('about_the', 'product')} #{productTypeText|capitalize}"}}
  121.                     {% endif %}
  122.                 </h2>
  123.                 <div class="wrap txt">
  124.                     <div class="contem fr-view">
  125.                         {{ productPage.about|raw }}
  126.                     </div>
  127.                 </div>
  128.                 <button class="mais js--abre">
  129.                     <span>{{ getLanguage('show_more', 'product') }}</span>
  130.                     <span>{{ getLanguage('show_less', 'product') }}</span>
  131.                 </button>
  132.             </section>
  133.         {% endif %}
  134.         {# PUBLIC #}
  135.         {% if productPage.target|length > 0 %}
  136.             <section id="sec-publico" class="text-open lateral-products">
  137.                 <h2>{{ getLanguage('target_audience', 'product') }}</h2>
  138.                 <div class="wrap txt">
  139.                     <div class="contem fr-view">
  140.                         {{ productPage.target|raw }}
  141.                     </div>
  142.                 </div>
  143.                 <button class="mais js--abre">
  144.                     <span>{{ getLanguage('show_more', 'product') }}</span>
  145.                     <span>{{ getLanguage('show_less', 'product') }}</span>
  146.                 </button>
  147.             </section>
  148.         {% endif %}
  149.         {# ABOUT CERTIFICATE #}
  150.         {% if productPage.aboutCertificate|length > 0 and certificate and isModuleActive('course_certificate_module') %}
  151.             <section id="sec-publico" class="text-open lateral-products">
  152.                 <h2>{{ getLanguage('about_certificate', 'product') }}</h2>
  153.                 <div class="wrap txt">
  154.                     <div class="contem fr-view">
  155.                         {{ productPage.aboutCertificate|raw }}
  156.                     </div>
  157.                 </div>
  158.                 <button class="mais js--abre">
  159.                     <span>{{ getLanguage('show_more', 'product') }}</span>
  160.                     <span>{{ getLanguage('show_less', 'product') }}</span>
  161.                 </button>
  162.             </section>
  163.         {% endif %}
  164.     </div>
  165.     <div class="container">
  166.         {# MATRÍCULA -- CURSO #}
  167.         {% if product.type == enum('ProductEnum::COURSE') %}
  168.             {% if lifetimePeriod == enum('CourseEnum::YES') or accessPeriod %}
  169.                 <div class="lateral-products">
  170.                     <div class="product-validade">
  171.                     {% if lifetimePeriod == enum('CourseEnum::YES') %}
  172.                         <div class="period">
  173.                         <i class="fas fa-infinity"></i>
  174.                         {# {{ ico('infinity') }} !!! #}
  175.                         </div>
  176.                         <p class="title">{{ getLanguage('no_time', 'product') }}</p>
  177.                         <p class="desc">{{ getLanguage('rest_assured', 'product') }} {{ getLanguage('lifetime_period', 'product') }}</p>
  178.                     {% elseif accessPeriod %}
  179.                         <div class="period">{{ accessPeriod }}</div>
  180.                         <p class="title">{{ getLanguage('no_time', 'product') }}</p>
  181.                         <p class="desc">{{ getLanguage('rest_assured', 'product') }} 
  182.                         {{ getLanguage('in_until', 'product') }} {{ accessPeriod }} 
  183.                         {{ getLanguage('after_enrollment', 'product') }}</p>
  184.                     {% endif %}
  185.                     </div>
  186.                 </div>
  187.             {% endif %}
  188.         {% endif %}
  189.         {# MATRÍCULA -- PLANO #}
  190.         {% if product.type == enum('ProductEnum::SUBSCRIPTION') and not userHasProduct(product) %}
  191.             <div class="lateral-products">
  192.                 <div class="product-validade">
  193.                     <div class="period">
  194.                         <p>{{ courses|length }} <small>{{ (courses|length > 1) ? getLanguage('courses_lowercase', 'product') : getLanguage('course_lowercase', 'product') }}</small></p>
  195.                     </div>
  196.                     <p class="title">{{ getLanguage('subscribe_now', 'product') }}</p>
  197.                     {% if productOffer.membershipFee == 0 %}
  198.                         <p class="desc">{{ getLanguage('free_membership_fee', 'product') }}!</p>
  199.                     {% else %}
  200.                         <p class="desc">{{ " + %s #{getLanguage('membership_fee', 'product')}"|format(moeda(productOffer.membershipFee))|raw }}</p>
  201.                     {% endif %}
  202.                     <div class="acoes">
  203.                         {% if isOne %}
  204.                             <a data-link-scroll="#ofertas-planos" class="btn-matricula">{{ getLanguage('subscribe', 'product') }}</a>
  205.                         {% endif %}
  206.                     </div>
  207.                 </div>
  208.             </div>
  209.         {% endif %}
  210.     </div>
  211.     {# CURSOS INCLUSOS #}
  212.     {% if product.type == enum('ProductEnum::SUBSCRIPTION') or product.type == enum('ProductEnum::COMBO') %}
  213.         {# @??? !!! #}
  214.         <div id="sec-content" class="inclusos">
  215.             {% include 'website/course/course-section.html.twig' with { section: planCoursesSection } %}
  216.         </div>
  217.     {% endif %}
  218.     {# CONTEÚDO #}
  219.     {% if product.type == enum('ProductEnum::COURSE') %}
  220.         <div id="sec-content">
  221.             <div class="container">
  222.                 <div class="lateral-products">
  223.                     {% include 'website/product/product-detail-course-content-section.html.twig' with { show: 3, open: 1 } %}
  224.                 </div>
  225.             </div>
  226.         </div>
  227.     {% endif %}
  228.     {# INSTRUCTORS #}
  229.     <div id="sec-instructors">
  230.         <div class="container">
  231.             <div class="lateral-products">
  232.                 {% include 'website/teacher/teacher-section.html.twig' with { layout: 'product', theme: (isDarkTheme? 'dark':'light') }%}
  233.             </div>
  234.         </div>
  235.     </div>
  236.     {# FAQ #}
  237.     {% if isModuleActive('faq_module') %}
  238.         {% include 'website/faq/faq-section.html.twig' with { layout: 'produto' } %}
  239.     {% endif %}
  240.     {# CURRENT PLAN - CYCLES #}
  241.     {% if productOffers|length > 1 and product.type == enum('ProductEnum::SUBSCRIPTION') and not userHasProduct(product) %}
  242.         <section id="ofertas-planos" class="pag-sec sec-bg-alt">
  243.             <div class="container">
  244.                 <div class="lateral-products">
  245.                     <header class="tit-sec tx-centro">
  246.                         <h2>{{ getLanguage('offers', 'product') }} <b>{{ getLanguage('flexible', 'product') }}</b></h2>
  247.                         <span class="sub">{{ getLanguage('choose_the_plan', 'product') }}</span>
  248.                     </header>
  249.                     {% include 'website/product/product-detail-plan-cycles-section.html.twig' with {
  250.                         full: (productOffers|length < 3) ? false : true,
  251.                         layout: 'product'
  252.                     } %}
  253.                 </div>
  254.             </div>
  255.         </section>
  256.     {% endif %}
  257.     {# VANTAGENS #}
  258.     {% if product.type == enum('ProductEnum::COURSE') %}
  259.         <div class="sec-bg-strip">
  260.             <div class="container">
  261.                 <div class="lateral-products">
  262.                     <div class="advantages">
  263.                         {% if productOffer.warranty == 1 %}
  264.                             <p>{{ ico('dollar') }}
  265.                                 <span>{{ getLanguage('day_warranty', 'product') }} 
  266.                                 {{ productOffer.warrantyOption }}
  267.                                 {{ plural(productOffer.warrantyOption, 
  268.                                     getLanguage('warranty_devolution_day', 'product'), 
  269.                                     getLanguage('warranty_devolution_days', 'product')
  270.                                 )}}</span>
  271.                             </p>
  272.                         {% endif %}
  273.                         {% if lifetimePeriod == 1 %}
  274.                             <p><i class="fas fa-infinity"></i>
  275.                             {# {{ ico('infinity') }} #}
  276.                             <span>{{ getLanguage('lifetime_access', 'product') }}</span></p>
  277.                         {% elseif accessPeriod %}
  278.                             <p>{{ ico('calendar') }}<span>{{ getLanguage('access_by', 'product') }} {{ accessPeriod }}</span></p>
  279.                         {% endif %}
  280.                         {# SUPPORT #}
  281.                         {% if support == enum('CourseEnum::YES') %}
  282.                             {% if lifetimeSupport == 1 %}
  283.                             <p><i class="fas fa-infinity"></i>
  284.                                 <span>{{ getLanguage('lifetime_support', 'product') }}</span></p>
  285.                             {% elseif supportPeriod %}
  286.                                 <p>{{ ico('calendar') }}<span>{{ getLanguage('until', 'product') }} {{ supportPeriod }} {{ getLanguage('of_support', 'product') }}</span></p>
  287.                             {% endif %}
  288.                         {% endif %}
  289.                         <p>{{ ico('coffee') }}<span>{{ getLanguage('study_whenever', 'product') }}</span></p>
  290.                         {% if fileTotal > 0 %}
  291.                             <p>{{ ico('smartphone') }}<span>{{ getLanguage('downloadable_materials', 'product') }}</span></p>
  292.                         {% endif %}
  293.                     </div>
  294.                 </div>
  295.             </div>
  296.         </div>
  297.     {% endif %}
  298.     {# SUGESTÃO DO UPSELL #}
  299.     {% if productOfferSuggestions is not empty and not userHasProduct(product) %}
  300.         <div class="container">
  301.             <div class="lateral-products">
  302.                 {% include 'website/product/product-detail-upsell-section.html.twig' with { suggestions: productOfferSuggestions } %}
  303.             </div>
  304.         </div>
  305.     {% endif %}
  306.     
  307.     {% if scoreProduct.scoreTotal > 0 and productPage.showModuleTestimonials and getConfig('allow_testimonial') == enum('CourseEnum::YES') %}
  308.         {# REVIEWS #}
  309.         {% include 'website/product/product-detail-reviews-section.html.twig' %}
  310.     
  311.         {# TESTIMONIALS #}
  312.         <div class="container mobile--wid">
  313.             <div class="lateral-products">
  314.                 {% include 'website/course/course-testimonial-section.html.twig' with { layout: 'produto' } %}
  315.             </div>
  316.         </div>
  317.     {% endif %}
  318.     {# RELATED PRODUCTS #}
  319.     {% if (productOffersRelatedsSection.items|length != 0) %}
  320.         <div class="container">
  321.             <div class="relacionados">
  322.                 {% include 'website/product/product-section.html.twig' with { section: productOffersRelatedsSection } %}
  323.             </div>
  324.         </div>
  325.     {% endif %}
  326.     {# CURRENT COURSE - PLANS #}
  327.     {% if  product.type == enum('ProductEnum::COURSE')
  328.        and productOffersSubscriptionSection.items is not empty %}
  329.         {% include 'website/product/product-plans-section.html.twig' with { layout: 'product' } %}
  330.     {% endif %}
  331.     {# BUY INFO #}
  332.     {% include 'website/product/product-detail-buy-section.html.twig' %}
  333.     {# MODAL -- WAITLIST #}
  334.     {% include 'website/includes/modal-waitlist.html.twig' with { languageKey: 'product' } %}
  335.     {# MODAL -- FAST USER REGISTER #}
  336.     {% include 'website/includes/modal-register.html.twig' with { languageKey: 'product' } %}
  337.     {# MODAL -- TERMOS DE USO #}
  338.     {% embed "website/includes/modal.html.twig" with {'id': 'modal-terms-of-use', 'title': getLanguage('ready_terms', 'register'), 'back': true } %}
  339.         {% block content %}
  340.             {{ getConfig('contract')|raw }}
  341.         {% endblock %}
  342.     {% endembed %}
  343.     {# MODAL -- COUPONS LIST #}
  344.     {% embed "website/includes/modal.html.twig" with { 'id': 'coupons-modal', 'title': getLanguage('avaliable_coupons', 'product')} %}
  345.         {% block content %}
  346.             {% from 'utils.html.twig' import ico %}
  347.             <div class="modal-coupons-content">
  348.                 <div class="modal-loading">
  349.                     <i class="modal-loader">{{ ico('loader-wish') }}</i>&ensp;{{ getLanguage('wait', 'util') }}&hellip;
  350.                 </div>
  351.             </div>
  352.         {% endblock %}
  353.     {% endembed %}
  354.     {# MODAL -- COUPON RULES #}
  355.     {% include "website/includes/modal-coupon-rules.html.twig" %}
  356.     {# MODAL -- SHARE #}
  357.     {% include "website/includes/modal-share.html.twig" with { id: 'modal-share', title: getLanguage('share', 'product') } %}
  358. {% endblock %}