custom/plugins/ShopWithMeUI/src/Resources/views/storefront/page/product-detail/index.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/base.html.twig' %}
  2. {% block base_content %}
  3.     {% block page_product_detail %}
  4.         {% set productTranslatedCustomFields = page.product.translated.customFields %}
  5.         {% set productCustomFields = page.product.customFields %}
  6.         {% set isCreditProduct = productCustomFields.productIsBuyWithCredit ?? false %}
  7.         {% set id = page.product.id %}
  8.         {% set currentDeal = page.product.extensions.currentDeal ?: null %}
  9.         {#    {% set productBuyerRewardConfigs = page.product.customFields['productBuyerRewardConfigs'] %} #}
  10.         {% set productBuyerRewardConfigs = currentDeal.referralTables ?: [] %}
  11.         {% set isBuyWithCredit = productCustomFields['productIsBuyWithCredit'] %}
  12.         {% set benefits = productCustomFields['benefits'] || null %}
  13.         {% set beforeAndAfterImg = productCustomFields['beforeAndAfterImg'] %}
  14.         {% set productInfosImg = productCustomFields['productInfosImg'] %}
  15.         {# {% set mediaCollection = searchMedia([beforeAndAfterImg, productInfosImg], context.context) %}
  16.         {% set beforeAndAfterImgMedia = mediaCollection.get(beforeAndAfterImg) %}
  17.         {% set productInfosMedia = mediaCollection.get(productInfosImg) %} #}
  18.         {% set productInfos = productCustomFields['productInfos'] %}
  19.         {% set selectedLanguage = (page.header.activeLanguage.translationCode.code ?: app.request.locale)|lower|split('-')[0] %}
  20.         {% if currentDeal is not null %}
  21.             {% if (currentDeal.marketPrice ?: [])|filter(v => v.currencyId == _context.context.currency.id)|first %}
  22.                 {% set marketValue = currentDeal.marketPrice|filter(v => v.currencyId == _context.context.currency.id)|first.gross -%}
  23.             {% else %}
  24.                 {% set marketValue = currentDeal.marketPrice.first.gross * _context.context.currency.factor %}
  25.             {% endif %}
  26.         {% endif %}
  27.         {% set productDiscountRateValue = productCustomFields.productDiscountRate %}
  28.         {# Filter out the rest of the jpg files (exclude mp4 and certificate jpg) #}
  29.         {% set restFiles = (page.product.media.elements ?: [])|filter(media => media.media.mimeType starts with 'image' and 'Certificate' not in media.media.fileName) %}
  30.         {% set productVideo = dataStream %}
  31.         {% set bannerImage = productCustomFields.mediaList.banner ?: page.product.cover.media %}
  32.         {% set topLeftImage = productCustomFields.mediaList.topLeft %}
  33.         {% set topRightImage = productCustomFields.mediaList.topRight %}
  34.         {% set video = productCustomFields.mediaList.video ?: (page.product.media.elements ?: [])|filter(media => media.media.mimeType starts with 'video')|first.media %}
  35.         {#        {% set productLeftImage = productCustomFields.mediaList.productLeft ?: (restFiles|length > 0 ? random(restFiles).media : null) %} #}
  36.         {#        {% set productTopRightImage = productCustomFields.mediaList.productTopRight ?: (restFiles|length > 0 ? random(restFiles).media : null) %} #}
  37.         {#        {% set productBottomRightImage = productCustomFields.mediaList.productBottomRight ?: (restFiles|length > 0 ? random(restFiles).media : null) %} #}
  38.         {% set productLink = seoUrl('frontend.detail.page', {'productId': id}) %}
  39.         {% set productLinkWithReferral = productLink ~ (context.customer ? '?affiliateCode=' ~ context.customer.affiliateCode : '') %}
  40.         {% set desktopShareModal = "desktop-share-modal-" ~ id %}
  41.         {% set desktopShareModalContent %}
  42.             {% sw_include '@Storefront/storefront/component/aistream/modal/desktop-share-modal.html.twig' %}
  43.         {% endset %}
  44.         {% set discountRate = page.product.extensions.deals.elements|first.discountRate %}
  45.         {% set uiVersion = productCustomFields['uiVersion'] ?: 1 %}
  46.         {% set ingredientList = productCustomFields['ingredientList'] ?: null %}
  47.         {% set introduceList = productCustomFields['introduceList'] ?: null %}
  48.         {% set introduceMobileList = productCustomFields['introduceMobileList'] ?: introduceList %}
  49.         {% set study = productCustomFields['study'] ?: null %}
  50.         {% set buyable = page.product.available and page.product.childCount <= 0 and page.product.calculatedMaxPurchase > 0 %}
  51.         {% set isSubscriptionQuery = app.request.query.get('_query')['subscription'] == '1' %}
  52.         {% set subscriptionProduct = page.product.customFields.isBuyProductSubscription ?? false %}
  53.         {% set isSave4moreProduct = subscriptionProduct && isSubscriptionQuery %}
  54.         {% set planId = page.product.customFields.planId ?? false %}
  55.         {% set redirectProductSave4moreId = productCustomFields.productSubscriptionId ?: id %}
  56.         {% set introduceBenefitList = productCustomFields['introduceBenefitList'] ?: null %}
  57.         {% set bannerImageProduct = isSave4moreProduct ? productCustomFields.mediaList.bannerSave4more : bannerImage %}
  58.         {% set imageProduct = isSave4moreProduct ? productCustomFields.mediaList.productSave4more.url : page.product.cover.media.url %}
  59.         {% set bannerSave4more = productCustomFields.mediaList.bannerSave4more ?: page.product.cover.media %}
  60.         {% set imageProductSave4more = productCustomFields.mediaList.productSave4more.url ?: page.product.cover.media.url %}
  61.         {% set isLoggedIn = context.customer is defined %}
  62.         {% set jsonParams = '{"productId":"' ~ page.product.id ~ '"}' %}
  63.         {% set redirectParameters = jsonParams %}
  64.         {% set pathRedirectDetail = seoUrl('frontend.account.login', {
  65.             redirectTo: 'frontend.detail.page',
  66.             redirectParameters: redirectParameters
  67.         }) %}
  68.         {% set pathRedirectShop4free = path('frontend.account.login', {
  69.             redirectTo: 'frontend.shop4free'
  70.         }) %}
  71.         {% set redirectAfterLogin = isCreditProduct ? pathRedirectShop4free : pathRedirectDetail %}
  72.         {% set arrFeatureProduct = [
  73.             {
  74.                 id: 1,
  75.                 title: "app.productDetail.subscriptionTitle1"|trans,
  76.             },
  77.             {
  78.                 id: 2,
  79.                 title: "app.productDetail.subscriptionTitle2"|trans,
  80.             },
  81.             {
  82.                 id: 3,
  83.                 title: "app.productDetail.subscriptionTitle3"|trans,
  84.             },
  85.             {
  86.                 id: 4,
  87.                 title: "app.productDetail.subscriptionTitle4"|trans,
  88.             },
  89.         ] %}
  90.         {# {% set outOfStock = ourOfStock %} #}
  91.         <div id="swm-product-detail" class="product-detail" itemscope
  92.              itemtype="https://schema.org/Product"
  93.              data-product-id="{{ page.product.id }}"
  94.              data-max-purchase="{{ page.product.calculatedMaxPurchase }}"
  95.              data-min-purchase="{{ page.product.minPurchase }}"
  96.              data-path="{{ path('frontend.data-stream') }}"
  97.              data-csrf="{{ sw_csrf('frontend.data-stream', {'mode': 'token'}) }}"
  98.         >
  99.             <div class="swm-product-detail">
  100.                 <section class="swm_pdtop_banner_wrapper">
  101.                     <div class="position-relative swm_pdtop_banner_container width-full">
  102.                         <div class="swm_pdtop_banner_container_img-config">
  103.                             {% if bannerImageProduct.mimeType starts with 'video' %}
  104.                                 <video class="swm_pdtop_banner_container_img swm-m-auto width-full" autoplay playsinline
  105.                                        muted>
  106.                                     <source src="{{ bannerImageProduct.url }}"
  107.                                             type="{{ bannerImageProduct.mimeType }}"/>
  108.                                 </video>
  109.                             {% else %}
  110.                                 <img class="swm_pdtop_banner_container_img swm-m-auto width-full"
  111.                                      src="{{ bannerImageProduct.url }}">
  112.                             {% endif %}
  113.                         </div>
  114.                         <div class="swm_pdtop_banner_container_img-save4more-config d-none-important">
  115.                             {% if bannerSave4more.mimeType starts with 'video' %}
  116.                                 <video class="swm_pdtop_banner_container_img swm-m-auto width-full" autoplay playsinline
  117.                                        muted>
  118.                                     <source src="{{ bannerSave4more.url }}" type="{{ bannerSave4more.mimeType }}"/>
  119.                                 </video>
  120.                             {% else %}
  121.                                 <img class="swm_pdtop_banner_container_img swm-m-auto width-full"
  122.                                      src="{{ bannerSave4more.url }}">
  123.                             {% endif %}
  124.                         </div>
  125.                         <div class="position-absolute d-flex flex-col swm_pdtop_banner_txt_container gap-8px">
  126.                             {% set productName = page.product.translated.name %}
  127.                             {% if '(' in productName and ')' in productName %}
  128.                                 {% set productParts = productName|split('(') %}
  129.                                 <span class="swm_pdtop_banner_txt_title">{{ productParts[0]|trim }}<br/></span>
  130.                                 <span class="swm_pdtop_banner_txt_extra">{{ productParts[1]|replace({')': ''}) }}</span>
  131.                             {% else %}
  132.                                 <span class="swm_pdtop_banner_txt_title">{{ productName }}<br/></span>
  133.                             {% endif %}
  134.                         </div>
  135.                         <div class="position-absolute prod-detail-share-button-container">
  136.                             {% sw_include '@Storefront/storefront/component/buttons/button-pill.html.twig' with {
  137.                                 className: 'swm-btn prod-detail-share-button d-flex' ,
  138.                                 label: 'app.share'|trans,
  139.                                 styleBtn: 'white-space: nowrap;',
  140.                                 classNameLabel: 'prod-detail-share-button-text text-heading-5-m',
  141.                                 icon: asset('bundles/shopwithmeui/assets/icons/product-detail/ic_share.svg') ,
  142.                                 styleIcon: 'width: 20px; height: 20px',
  143.                                 extraAttributes: {
  144.                                     'desktop-modal-target': '#' ~ desktopShareModal
  145.                                 }
  146.                             } %}
  147.                         </div>
  148.                     </div>
  149.                 </section>
  150.                 <section class="swm_pdtop_slide_container d-flex flex-col">
  151.                     {% if productCustomFields is not null %}
  152.                         <div class="swm_pdtop_slide_container-content d-flex justify-between items-center m-tablet:flex-col mobile:flex-col gap-1rem">
  153.                             <span class="swm_pdtop_slide_txt_top">{{ productCustomFields.subtitle }}</span>
  154.                             <div class="d-flex swm_pdtop_slide_certi_container">
  155.                                 {% for certificate in productCustomFields.certificates %}
  156.                                     <div style="height: 120px; width: 120px;" class="align-center justify-center">
  157.                                         <img class="width-full" src="{{ certificate.media.url }}"/>
  158.                                     </div>
  159.                                 {% endfor %}
  160.                             </div>
  161.                         </div>
  162.                     {% endif %}
  163.                     <div class="d-flex flex-col" style="gap:20px">
  164.                         <div class="swm_pdtop_slider_img d-flex mobile:flex-col">
  165.                             {% if topLeftImage is not null %}
  166.                                 <div class="swm_pdtop_slider_img_1">
  167.                                     <img class="swm_pdtop_slider_img_mobile swm_prod_detail_img_radius_15"
  168.                                          src="{{ topLeftImage.url }}" width="100%"/>
  169.                                 </div>
  170.                             {% endif %}
  171.                             {% if topRightImage is not null %}
  172.                                 <div class="swm_pdtop_slider_img_2 flex-1">
  173.                                     <img class="swm_pdtop_slider_img_mobile swm_prod_detail_img_radius_15 object-fit-cover height-full"
  174.                                          src="{{ topRightImage.url }}" width="100%"/>
  175.                                 </div>
  176.                             {% endif %}
  177.                         </div>
  178.                         {% if video is not null %}
  179.                             <div class="position-relative">
  180.                                 <div id="swm_toggle_video" class="position-absolute items-center justify-center d-flex">
  181.                                     <div id="swm_icon_play_video">
  182.                                         <img src="{{ asset('bundles/shopwithmeui/assets/icons/ic_play.png') }}"
  183.                                              width="100%"/>
  184.                                     </div>
  185.                                 </div>
  186.                                 <video allow="autoplay" width="100%" height="100%" playsinline="true" loop
  187.                                        controlsList="nodownload" style="z-index: 1;"
  188.                                        id="swm_pdtop_video" class="swm_pdtop_slide_video">
  189.                                     <source src="{{ video.url }}" type="{{ video.mimetype }}"/>
  190.                                 </video>
  191.                             </div>
  192.                         {% endif %}
  193.                     </div>
  194.                 </section>
  195.                 {% if uiVersion > 1 %}
  196.                     {% if ingredientList is not null and ingredientList|length > 0 %}
  197.                         {% set validIngredientList = ingredientList|filter(v => v is not null) %}
  198.                         {% if validIngredientList|length > 0 %}
  199.                             <div class="product-detail__technologies">
  200.                                 <div class="product-detail__technologies-list">
  201.                                     {% for ingredientItem in ingredientList %}
  202.                                         {% if ingredientItem %}
  203.                                             <div class="product-detail__technologies-item">
  204.                                                 <img class="product-detail__technologies-item-img"
  205.                                                     src="{{ ingredientItem.url }}"/>
  206.                                             </div>
  207.                                         {% endif %}
  208.                                     {% endfor %}
  209.                                 </div>
  210.                             </div>
  211.                         {% endif %}
  212.                     {% endif %}
  213.                     {% if introduceBenefitList is not null and introduceBenefitList|length > 0 %}
  214.                         <div class="product-detail__benefits">
  215.                             {% for introduceItem in introduceBenefitList %}
  216.                                 {% if introduceItem and introduceItem.items|length >= 2 %}
  217.                                     {% set leftItem = introduceItem.items[0] %}
  218.                                     <div class="layout__benefit">
  219.                                         <div class="layout__benefit-item-left">
  220.                                             <div class="mobile:d-none-important"></div>
  221.                                             {# Góc trên bên trái: text #}
  222.                                             <div class="layout__benefit-item-left-before">
  223.                                                 {% if leftItem %}
  224.                                                     <div class="benefit-text">
  225.                                                         {% if leftItem.title %}
  226.                                                             <div class="benefit-title">{{ leftItem.title }}</div>
  227.                                                         {% endif %}
  228.                                                         {% if leftItem.description %}
  229.                                                             <div class="benefit-description">{{ leftItem.description }}</div>
  230.                                                         {% endif %}
  231.                                                     </div>
  232.                                                 {% endif %}
  233.                                             </div>
  234.                                             {# Góc dưới bên trái: image #}
  235.                                             <div class="layout__benefit-item-left-after layout__benefit-item-left-after-mobile">
  236.                                                 {% if leftItem and leftItem.image %}
  237.                                                     <img class="layout__benefit-item-left-after-img"
  238.                                                         src="{{ leftItem.image.url }}"/>
  239.                                                 {% endif %}
  240.                                             </div>
  241.                                             <div class="layout__benefit-item-left-after layout__benefit-item-left-after-desktop">
  242.                                                 {% if leftItem and leftItem.image %}
  243.                                                     <img class="layout__benefit-item-left-after-img"
  244.                                                         src="{{ leftItem.image.url }}"/>
  245.                                                 {% endif %}
  246.                                             </div>
  247.                                         </div>
  248.                                         <div class="layout__benefit-item-right">
  249.                                             {# Góc trên bên phải: image #}
  250.                                             <div class="layout__benefit-item-right-before">
  251.                                                 {% set rightItem = introduceItem.items[1] %}
  252.                                                 {% if rightItem and rightItem.image %}
  253.                                                     <img class="layout__benefit-item-right-before-img"
  254.                                                         src="{{ rightItem.image.url }}"/>
  255.                                                 {% endif %}
  256.                                             </div>
  257.                                             {# Góc dưới bên phải: text #}
  258.                                             <div class="layout__benefit-item-right-after">
  259.                                                 {% if rightItem %}
  260.                                                     <div class="benefit-text">
  261.                                                         {% if rightItem.title %}
  262.                                                             <div class="benefit-title">{{ rightItem.title }}</div>
  263.                                                         {% endif %}
  264.                                                         {% if rightItem.description %}
  265.                                                             <div class="benefit-description">{{ rightItem.description }}</div>
  266.                                                         {% endif %}
  267.                                                     </div>
  268.                                                 {% endif %}
  269.                                             </div>
  270.                                         </div>
  271.                                     </div>
  272.                                 {% endif %}
  273.                             {% endfor %}
  274.                         </div>
  275.                     {% else %}
  276.                         {% if introduceList is not null and introduceList|length > 0 %}
  277.                             <div class="product-detail__benefits">
  278.                                 {% for introduceItem in introduceList %}
  279.                                     {% if introduceItem %}
  280.                                         <div class="layout__benefit">
  281.                                             <div class="layout__benefit-item-left">
  282.                                                 <div class="mobile:d-none-important"></div>
  283.                                                 <div class="layout__benefit-item-left-before">
  284.                                                     {% if introduceItem.firstImage %}
  285.                                                         <img class="layout__benefit-item-left-before-img"
  286.                                                             src="{{ introduceItem.firstImage.url }}"/>
  287.                                                     {% endif %}
  288.                                                 </div>
  289.                                                 <div class="layout__benefit-item-left-after">
  290.                                                     {% if introduceItem.secondImage %}
  291.                                                         <img class="layout__benefit-item-left-after-img"
  292.                                                             src="{{ introduceItem.secondImage.url }}"/>
  293.                                                     {% endif %}
  294.                                                 </div>
  295.                                             </div>
  296.                                             <div class="layout__benefit-item-right">
  297.                                                 <div class="layout__benefit-item-right-before">
  298.                                                     {% if introduceItem.thirdImage %}
  299.                                                         <img class="layout__benefit-item-right-before-img"
  300.                                                             src="{{ introduceItem.thirdImage.url }}"/>
  301.                                                     {% endif %}
  302.                                                 </div>
  303.                                                 <div class="layout__benefit-item-right-after">
  304.                                                     {% if introduceItem.fourthImage %}
  305.                                                         <img class="layout__benefit-item-right-after-img"
  306.                                                             src="{{ introduceItem.fourthImage.url }}"/>
  307.                                                     {% endif %}
  308.                                                 </div>
  309.                                             </div>
  310.                                         </div>
  311.                                     {% endif %}
  312.                                 {% endfor %}
  313.                             </div>
  314.                         {% endif %}
  315.                         {% if introduceMobileList is not null and introduceMobileList|length > 0 %}
  316.                             <div class="product-detail__benefits-mobile d-none">
  317.                                 {% for introduceItem in introduceMobileList %}
  318.                                     {% if introduceItem %}
  319.                                         <div class="layout__benefit-mobile">
  320.                                             <div class="layout__benefit-item-left">
  321.                                                 {% if introduceItem.firstImage %}
  322.                                                     <div class="layout__benefit-item-left-before">
  323.                                                         <img class="layout__benefit-item-left-before-img"
  324.                                                             src="{{ introduceItem.firstImage.url }}"/>
  325.                                                     </div>
  326.                                                 {% endif %}
  327.                                                 {% if introduceItem.secondImage %}
  328.                                                     <div class="layout__benefit-item-left-after">
  329.                                                         <img class="layout__benefit-item-left-after-img"
  330.                                                             src="{{ introduceItem.secondImage.url }}"/>
  331.                                                     </div>
  332.                                                 {% endif %}
  333.                                             </div>
  334.                                             <div class="layout__benefit-item-right">
  335.                                                 {% if introduceItem.thirdImage %}
  336.                                                     <div class="layout__benefit-item-right-after">
  337.                                                         <img class="layout__benefit-item-right-after-img"
  338.                                                             src="{{ introduceItem.thirdImage.url }}"/>
  339.                                                     </div>
  340.                                                 {% endif %}
  341.                                                 {% if introduceItem.fourthImage %}
  342.                                                     <div class="layout__benefit-item-right-before">
  343.                                                         <img class="layout__benefit-item-right-before-img"
  344.                                                             src="{{ introduceItem.fourthImage.url }}"/>
  345.                                                     </div>
  346.                                                 {% endif %}
  347.                                             </div>
  348.                                         </div>
  349.                                     {% endif %}
  350.                                 {% endfor %}
  351.                             </div>
  352.                         {% endif %}
  353.                     {% endif %}
  354.                     {% if study is not null and study.image is not null %}
  355.                         <div class="product-detail__certificate">
  356.                             <div class="product-detail__certificate-box">
  357.                                 <img class="product-detail__certificate-img"
  358.                                      src="{{ study.image.url }}"/>
  359.                             </div>
  360.                         </div>
  361.                     {% endif %}
  362.                 {% else %}
  363.                     {% if productCustomFields.benefitsList|length > 0 %}
  364.                         <section class="section-5__product_detail">
  365.                             <div class="section-5__product_detail-header text-heading-2-b swm-mt-8 swm-mb-10 text-center">
  366.                                 {{ 'app.productDetail.productBenefits.title'|trans }}
  367.                             </div>
  368.                             <div class="section-5__product_detail-container d-flex items-start justify-between">
  369.                                 {% for benefitItem in productCustomFields.benefitsList %}
  370.                                     <div class="section-5__product_detail-container-item d-flex flex-col items-center">
  371.                                         <div class="section-5__product_detail-container-item-img overflow-hidden swm-mb-4">
  372.                                             <img src="{{ benefitItem.media.url }}"
  373.                                                  class="item-img-product-detail width-full height-full"/>
  374.                                         </div>
  375.                                         <div class="section-5__product_detail-container-item-content text-center">
  376.                                             <div class="section-5__product_detail-container-item-content-name typo-head-4-b swm-mb-4">
  377.                                                 {{ benefitItem.name }}
  378.                                             </div>
  379.                                             <div class="section-5__product_detail-container-item-content-name typo-sub-text-2">
  380.                                                 {{ benefitItem.description }}
  381.                                             </div>
  382.                                         </div>
  383.                                     </div>
  384.                                 {% endfor %}
  385.                             </div>
  386.                         </section>
  387.                     {% endif %}
  388.                 {% endif %}
  389.                 <section
  390.                         class="productDetail_product_wrapper swm-m-auto">
  391.                     <!--Container-->
  392.                     <div
  393.                             class="d-flex flex-col gap-1.5rem">
  394.                         <!--Title-->
  395.                         <div class="d-flex flex-col" style="gap:9px">
  396.                             <p class="login__title__title">{{ page.product.translated.name }}</p>
  397.                             <div class="d-flex gap-1rem">
  398.                                 {% for tag in productCustomFields.productTags %}
  399.                                     <button class="swm-btn swm-btn-certificate">
  400.                                         {{ tag.name }}
  401.                                     </button>
  402.                                 {% endfor %}
  403.                             </div>
  404.                         </div>
  405.                         <!--Product-->
  406.                         <div
  407.                                 class="d-flex m-tablet:flex-col mobile:flex-col" style="gap:46px;">
  408.                             <!--Images-->
  409.                             <div class="product-detail__information__left d-flex productDetail_product_images_wrapper">
  410.                                 <div class="product-detail__information__left__image mobile:m-auto productDetail_product_images_main overflow-hidden radius-15px">
  411.                                     <img loading="lazy" class="product-detail__information__left__image-img"
  412.                                          src="{{ imageProduct }}"/>
  413.                                     <img loading="lazy"
  414.                                          class="product-detail__information__left__image-save4more-config d-none-important"
  415.                                          src="{{ imageProductSave4more }}"/>
  416.                                 </div>
  417.                             </div>
  418.                             <!--Infos-->
  419.                             <div
  420.                                     class="product-detail__information__right d-flex flex-col"
  421.                                     style="gap: 21px; flex: 1;">
  422.                                 <!--Cao đao-->
  423.                                 <div class="homePage_productList_cao_dao d-flex gap-1rem items-center justify-between swm-p-3">
  424.                                     <div class="d-flex" style="gap: 4px;">
  425.                                         <img src="{{ asset('bundles/shopwithmeui/assets/icons/lighting-circle.svg') }}"/>
  426.                                         <span class="homePage_productList_cao_dao_text">{{ 'app.home.listing.timeLeft'|trans }}</span>
  427.                                     </div>
  428.                                     <div class="deals-expiration-timer homePage_productList_cao_dao_time d-flex items-center"
  429.                                          data-expired-text="{{ 'app.expired'|trans|sw_sanitize }}"
  430.                                          data-expired-time="{{ currentDeal.endDate|date("U") }}"></div>
  431.                                 </div>
  432.                                 <!--Quantity-->
  433.                                 <div class="d-flex flex-col" style="gap: 21px;">
  434.                                     <div class="productDetail_product_optional d-flex flex-col" style="gap: 21px;">
  435.                                         <div class="productDetail_product_optional_order-right d-flex flex-col">
  436.                                             {% if not subscriptionProduct %}
  437.                                             <div class="d-flex flex-col product-detail-quantity" style="gap: 12px;">
  438.                                                 <p class="typo-head-5">{{ 'app.quantity'|trans }}</p>
  439.                                                 {% if isLoggedIn %}
  440.                                                     <div class="d-flex" style="gap: 12px;">
  441.                                                         <button id="decreaseBtn"
  442.                                                                 class="productDetail_product_quantity_minus radius-8px cursor-pointer">
  443.                                                             <img src="{{ asset('bundles/shopwithmeui/assets/icons/ic_minus.svg') }}"/>
  444.                                                         </button>
  445.                                                         <input id="quantityInput"
  446.                                                                 class="productDetail_product_quantity radius-8px d-flex text-center no-arrows"
  447.                                                                 value="1" type="number" min="1"
  448.                                                                 data-productId="{{ page.product.id }}">
  449.                                                         <button id="increaseBtn"
  450.                                                                 class="productDetail_product_quantity_minus radius-8px cursor-pointer">
  451.                                                             <img src="{{ asset('bundles/shopwithmeui/assets/icons/ic_plus.svg') }}"/>
  452.                                                         </button>
  453.                                                     </div>
  454.                                                 {% else %}
  455.                                                     <div class="d-flex" style="gap: 12px;">
  456.                                                         <a href="{{ redirectAfterLogin }}">
  457.                                                             <button class="productDetail_product_quantity_minus radius-8px cursor-pointer">
  458.                                                                 <img src="{{ asset('bundles/shopwithmeui/assets/icons/ic_minus.svg') }}"/>
  459.                                                             </button>
  460.                                                         </a>
  461.                                                         <input id="quantityInput"
  462.                                                                 class="productDetail_product_quantity radius-8px d-flex text-center no-arrows"
  463.                                                                 value="1" type="number" min="1"
  464.                                                                 data-productId="{{ page.product.id }}">
  465.                                                         <a href="{{ redirectAfterLogin }}">
  466.                                                             <button class="productDetail_product_quantity_minus radius-8px cursor-pointer">
  467.                                                                 <img src="{{ asset('bundles/shopwithmeui/assets/icons/ic_plus.svg') }}"/>
  468.                                                             </button>
  469.                                                         </a>
  470.                                                     </div>
  471.                                                 {% endif %}
  472.                                                 <div class="product-item-error d-none">{{ 'app.limit'|trans }} {{ page.product.calculatedMaxPurchase }} {{ 'app.perOrder'|trans }}</div>
  473.                                             </div>
  474.                                             {% endif %}
  475.                                         </div>
  476.                                         <div class="d-flex flex-col gap-8px">
  477.                                             {% set dealSaved = marketValue - page.product.calculatedPrice.unitPrice %}
  478.                                             <!--Price Saving-->
  479.                                             <div class="d-flex gap-8px">
  480.                                                 <div class="d-flex gap-8px flex-wrap">
  481.                                                     <p class="productDetail_product_origin_price typo-head-5">{{'app.productDetail.product.regularPrice'|trans|sw_sanitize}}:</p>
  482.                                                     <p class="productDetail_product_origin_price line-through typo-head-5">{{ marketValue|currency }}</p>
  483.                                                 </div>
  484.                                                 {# {% if discountRate is not null %}
  485.                                                     <p class="productDetail_product_origin_price_savings typo-head-5 {% if isSave4moreProduct %} productDetail_product_origin_price_savings-color-save4more {% endif %}">{{ discountRate }}
  486.                                                         %</p>
  487.                                                     <p class="productDetail_product_origin_price_savings typo-head-5 {% if isSave4moreProduct %} productDetail_product_origin_price_savings-color-save4more {% endif %}">{{ 'app.savings'|trans }}</p>
  488.                                                 {% endif %} #}
  489.                                             </div>
  490.                                             <!--Final Price-->
  491.                                             <div class="d-flex items-center gap-1rem">
  492.                                                 <div class="productDetail_product_origin_price_savings typo-head-4-b d-flex items-center gap-4px flex-wrap {% if isSave4moreProduct %} productDetail_product_origin_price_savings-color-save4more {% endif %}">
  493.                                                     <span class="productDetail_product_origin_price typo-head-5">{{'app.productDetail.product.todayPrice'|trans|sw_sanitize}}:</span>
  494.                                                     {{ page.product.calculatedPrice.unitPrice|currency }}
  495.                                                     {% if context.customer.affiliateCode is not null and context.customer.campaignCode is not null %}
  496.                                                         {% if context.customer.affiliateCode == context.customer.campaignCode %}
  497.                                                             {% if page.product.customFields.pointValue %}
  498.                                                                 <span>
  499.                                                                         ({{ page.product.customFields.pointValue }} PV)
  500.                                                                         {# {{ 'app.productDetail.product.point'|trans|sw_sanitize }} #}
  501.                                                                     </span>
  502.                                                             {% endif %}
  503.                                                         {% endif %}
  504.                                                     {% endif %}
  505.                                                 </div>
  506.                                             </div>
  507.                                             <div class="d-flex items-center gap-4px flex-wrap">
  508.                                                 <span class="productDetail_product_origin_price typo-head-5">{{'app.productDetail.product.youSave'|trans|sw_sanitize}}:</span>
  509.                                                 <span class="productDetail_product_origin_price_savings typo-head-4-b">{{ dealSaved|currency }}</span>
  510.                                                 {% if discountRate %}
  511.                                                     <span class="productDetail_product_origin_price typo-head-5">({{discountRate}}% {{'app.productDetail.product.discount'|trans|sw_sanitize}})</span>
  512.                                                 {% endif %}
  513.                                             </div>
  514.                                         </div>
  515.                                         {# {% if buyable == false or outOfStock %} #}
  516.                                         {% if buyable == false %}
  517.                                             <div class="error_out_of_stock">{{ 'app.productNotAvailable'|trans }}</div>
  518.                                         {% endif %}
  519.                                         {% if isSave4moreProduct and planId == false %}
  520.                                             <div class="error_out_of_stock">{{ 'app.planIdBuyWithSubcription'|trans }}</div>
  521.                                         {% endif %}
  522.                                         <!--Buttons-->
  523.                                         {% if subscriptionProduct %}
  524.                                         <a href="{{ hasActiveSubscription ? '#' : seoUrl('frontend.checkout.subscription', {'id': page.product.id}) }}"
  525.                                             class="productDetail-btn-save4more text-decoration-none {{ hasActiveSubscription ? 'disabled-link-save4more' : '' }}">
  526.                                             {% set extraAttributes = not planId or buyable == false ? { 'disabled': true } : {} %}
  527.                                             {% sw_include '@Storefront/storefront/component/buttons/button-primary.html.twig' with {
  528.                                                 id: page.product.id,
  529.                                                 className: 'subscription-buy-btn',
  530.                                                 label: "app.productDetail.buyWithSubscription"|trans,
  531.                                                 icon: 'bundles/shopwithmeui/assets/icons/prod_buynow.svg',
  532.                                                 extraAttributes: extraAttributes
  533.                                             } %}
  534.                                         </a>
  535.                                         {% if hasActiveSubscription %}
  536.                                             <p class="error_out_of_stock">{{ 'app.productDetail.hasActiveSubscription'|trans|sw_sanitize }}</p>
  537.                                         {% endif %}
  538.                                         <div class="productDetail_list_feature d-flex flex-col gap-16px">
  539.                                             {% for feature in arrFeatureProduct %}
  540.                                                 <div class="d-flex align-center justify-start gap-1">
  541.                                                     <img src="{{ asset('bundles/shopwithmeui/assets/icons/checked_icon.svg') }}"/>
  542.                                                     <span class="productDetail_list_feature-title">
  543.                                                                 {{ feature.title }}
  544.                                                             </span>
  545.                                                 </div>
  546.                                             {% endfor %}
  547.                                         </div>
  548.                                         {% else %}
  549.                                         <div class="productDetail-btns-order d-flex gap-1rem"
  550.                                                 style="flex-wrap: wrap;">
  551.                                             {% sw_include '@Storefront/storefront/page/product-detail/buy-widget-form.html.twig' with {
  552.                                                 isHeaderButton: false,
  553.                                                 isAddToCart: false,
  554.                                                 fullWidth: false,
  555.                                             } %}
  556.                                             {% sw_include '@Storefront/storefront/page/product-detail/buy-widget-form.html.twig' with {
  557.                                                 isHeaderButton: false,
  558.                                                 isAddToCart: true,
  559.                                                 fullWidth: false,
  560.                                             } %}
  561.                                             {# {% set isShop4freeProduct = true %}
  562.                                                     {% if isShop4freeProduct %}
  563.                                                         <button class="section-2__shop4free-content-product-info-description-btn button-square button-primary d-flex items-center shop4free-purchase-btn" 
  564.                                                                 title="Shop4free now" 
  565.                                                                 aria-label="Shop4free now"
  566.                                                                 data-product-id= "{{ product.id }}"
  567.                                                                 data-product-name= "{{ product.translated.name }}"
  568.                                                                 data-product-credit= "{{ product.customFields.productCreditPrice }}"
  569.                                                                 desktop-modal-target='#{{context.customer ? desktopFreePurchaseModal : ''}}' 
  570.                                                                 >
  571.                                                             <div class="section-2__shop4free-content-product-info-description-title d-flex items-center justify-between">
  572.                                                                 <div class="d-flex flex-col items-start gap-8px">
  573.                                                                     <span class="{{classTextButton}} button-title typo-sub-text-2 section-2__shop4free-content-product-info-description-title-text">{{'app.shop4freeNowButton'|trans}}</span>
  574.                                                                 </div>
  575.                                                                 <svg width="18" height="18" viewBox="0 0 18 18" fill="none"
  576.                                                                     xmlns="http://www.w3.org/2000/svg">
  577.                                                                     <path
  578.                                                                         d="M9 17C11.1217 17 13.1566 16.1571 14.6569 14.6569C16.1571 13.1566 17 11.1217 17 9C17 6.87827 16.1571 4.84344 14.6569 3.34315C13.1566 1.84285 11.1217 1 9 1"
  579.                                                                         stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
  580.                                                                     <path d="M1 9H11M11 9L8 6M11 9L8 12" stroke="currentColor" stroke-width="1.5"
  581.                                                                         stroke-linecap="round" stroke-linejoin="round" />
  582.                                                                 </svg>
  583.                                                             </div>
  584.                                                             <svg width="18" height="18" viewBox="0 0 18 18" fill="none"
  585.                                                                 xmlns="http://www.w3.org/2000/svg">
  586.                                                                 <path
  587.                                                                     d="M9 17C11.1217 17 13.1566 16.1571 14.6569 14.6569C16.1571 13.1566 17 11.1217 17 9C17 6.87827 16.1571 4.84344 14.6569 3.34315C13.1566 1.84285 11.1217 1 9 1"
  588.                                                                     stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
  589.                                                                 <path d="M1 9H11M11 9L8 6M11 9L8 12" stroke="currentColor" stroke-width="1.5"
  590.                                                                     stroke-linecap="round" stroke-linejoin="round" />
  591.                                                             </svg>
  592.                                                         </div>
  593.                                                     </button>
  594.                                                 {% endif %} #}
  595.                                             </div>
  596.                                         {% endif %}
  597.                                         <div class="productDetail_list_feature d-flex flex-col gap-16px {% if not isSave4moreProduct %} d-none-important {% endif %}">
  598.                                             {% for feature in arrFeatureProduct %}
  599.                                                 <div class="d-flex align-center justify-start gap-1">
  600.                                                     <img src="{{ asset('bundles/shopwithmeui/assets/icons/checked_icon.svg') }}"/>
  601.                                                     <span class="productDetail_list_feature-title">
  602.                                                             {{ feature.title }}
  603.                                                         </span>
  604.                                                 </div>
  605.                                             {% endfor %}
  606.                                         </div>
  607.                                     </div>
  608.                                     {% if ( not subscriptionProduct ) and ( productCustomFields.productSubscriptionId is not null ) %}
  609.                                         <div class="product_detail_join_save4more d-flex items-center justify-between">
  610.                                             <div class="product_detail_join_save4more-left d-flex items-center gap-4px">
  611.                                                 <img src="{{ asset('bundles/shopwithmeui/assets/icons/autoship_save4more.svg') }}"/>
  612.                                                 <div class="product_detail_join_save4more-left-content d-flex flex-col gap-8px">
  613.                                                     <span class="product_detail_join_save4more-left-content-head text-body-m-b">{{ "app.productDetail.enjoySave4more"|trans }}</span>
  614.                                                     <span class="product_detail_join_save4more-left-content-title text-smallest-b">{{ "app.productDetail.subscribe"|trans }}</span>
  615.                                                 </div>
  616.                                             </div>
  617.                                             <div class="product_detail_join_save4more-right">
  618.                                                 <a href="{{ seoUrl('frontend.detail.page', {'productId': redirectProductSave4moreId}) }}"
  619.                                                    class="text-decoration-none">
  620.                                                     <button class="product_detail_join_save4more-right-action-btn swm-btn swm-btn-shop4free-secondary text-smallest-b">
  621.                                                         {{ 'app.home.learnMore'|trans }}
  622.                                                     </button>
  623.                                                 </a>
  624.                                             </div>
  625.                                         </div>
  626.                                     {% endif %}
  627.                                 </div>
  628.                                 <!--Product Infos-->
  629.                                 <div class="d-flex flex-col" style="gap: 21px;">
  630.                                     {% if productTranslatedCustomFields.promotion %}
  631.                                         <div class="productDetail_product_infos swm-btn swm-btn-shop4free-primary flex-col toggleButton">
  632.                                             <div class="d-flex justify-between">
  633.                                                 <span class="productDetail_product_infos_title typo-sub-text-4-smb d-flex items-center">{{ 'app.productDetail.product.promotion'|trans }}</span>
  634.                                                 <img class="cursor-pointer"
  635.                                                      src="{{ asset('bundles/shopwithmeui/assets/icons/prod_dropdown.svg') }}"/>
  636.                                             </div>
  637.                                             <div class="productDetail_product_infos_des typo-sub-text-2 d-none">{{ productTranslatedCustomFields.promotion|raw }}</div>
  638.                                         </div>
  639.                                     {% endif %}
  640.                                     <div class="productDetail_product_infos swm-btn swm-btn-shop4free-primary flex-col toggleButton">
  641.                                         <div class="d-flex justify-between">
  642.                                             <span class="productDetail_product_infos_title typo-sub-text-4-smb d-flex items-center">{{ 'app.productDetail.product.description'|trans }}</span>
  643.                                             <img class="cursor-pointer"
  644.                                                  src="{{ asset('bundles/shopwithmeui/assets/icons/prod_dropdown.svg') }}"/>
  645.                                         </div>
  646.                                         <div class="productDetail_product_infos_des typo-sub-text-2 d-none">{{ page.product.translated.description|raw }}</div>
  647.                                     </div>
  648.                                     <div class="productDetail_product_infos swm-btn swm-btn-shop4free-primary flex-col toggleButton">
  649.                                         <div class="d-flex justify-between">
  650.                                             <span class="productDetail_product_infos_title typo-sub-text-4-smb d-flex items-center">{{ 'app.productDetail.product.benefits'|trans }}</span>
  651.                                             <img class="cursor-pointer"
  652.                                                  src="{{ asset('bundles/shopwithmeui/assets/icons/prod_dropdown.svg') }}"/>
  653.                                         </div>
  654.                                         <div class="productDetail_product_infos_des typo-sub-text-2 d-none">{{ productTranslatedCustomFields.benefits|raw }}</div>
  655.                                     </div>
  656.                                     <div class="productDetail_product_infos swm-btn swm-btn-shop4free-primary flex-col toggleButton">
  657.                                         <div class="d-flex justify-between">
  658.                                             <span class="productDetail_product_infos_title typo-sub-text-4-smb d-flex items-center">{{ productTranslatedCustomFields.ingredientLabel ?: 'app.productDetail.product.ingredients'|trans }}</span>
  659.                                             <img class="cursor-pointer"
  660.                                                  src="{{ asset('bundles/shopwithmeui/assets/icons/prod_dropdown.svg') }}"/>
  661.                                         </div>
  662.                                         <div class="productDetail_product_infos_des typo-sub-text-2 d-none">{{ productTranslatedCustomFields.ingredients|raw }}
  663.                                         </div>
  664.                                     </div>
  665.                                 </div>
  666.                             </div>
  667.                         </div>
  668.                     </div>
  669.                 </section>
  670.             </div>
  671.             <section class="section-5__home__experience swm-m-auto overflow-hidden swm-mb-8"
  672.                      data-video-list-plugin="true"
  673.                      data-path="{{ path('frontend.data-stream') }}"
  674.                      data-csrf="{{ sw_csrf('frontend.data-stream', {'mode': 'token'}) }}"
  675.                      data-product-id="{{ page.product.id }}"
  676.                      data-type="details">
  677.                 <div class="section-5__home__experience-header typo-head-2">
  678.                     {{ 'app.aiStream'|trans }}
  679.                 </div>
  680.                 <div class="section-5__home__experience-container d-flex items-center justify-start">
  681.                 </div>
  682.             </section>
  683.             {#                <div class="section-5__home__experience-container_mobile d-flex items-center justify-start"> #}
  684.             {#                    {% if productVideo|first %} #}
  685.             {#                        {% set video = null %} #}
  686.             {#                        {% if productVideo|first.postChildren.elements && productVideo|first.postChildren.elements|first %} #}
  687.             {#                        {% set video = productVideo|first.postChildren.elements|first.file.fileUrl %} #}
  688.             {#                        {% endif %} #}
  689.             {#                        <div class="section-5__home__experience-container-item border-radius-1 position-relative overflow-hidden"> #}
  690.             {#                            <div id="home_aiStream_play" #}
  691.             {#                                 class="section-5__home__experience-container-item-content  position-absolute d-flex justify-between flex-col"> #}
  692.             {#                                <div class="section-5__home__experience-container-item-tag d-flex items-center justify-start"> #}
  693.             {#                                    <img src="/bundles/shopwithmetheme/assets/icons/mage_video.svg" #}
  694.             {#                                         class="item_experience_img_icon"> #}
  695.             {#                                    <span class="section-5__home__experience-container-item-tag-name typo-sub-text-4-smb">Consumer #}
  696.             {#                                    Electronics</span> #}
  697.             {#                                </div> #}
  698.             {#                                <div class="section-5__home__experience_container_mobile_navigation position-absolute d-flex flex-col"> #}
  699.             {#                                    <div class="d-flex gap-1rem flex-col section-5__home__experience_container_mobile_navigation_actions"> #}
  700.             {#                                        <div class="section-5__home__experience_container_mobile_navigation_action d-flex flex-col items-center"> #}
  701.             {#                                            <img class="section-5__home__experience_container_mobile_navigation_action_img" #}
  702.             {#                                                 src="/bundles/shopwithmetheme/assets/imgs/aiStream_heart.svg"/> #}
  703.             {#                                            <span class="typo-sub-text-4 section-5__home__experience_container_mobile_navigation_info">{{ productVideo|first.likeCount }}</span> #}
  704.             {#                                        </div> #}
  705.             {#                                        <div class="section-5__home__experience_container_mobile_navigation_action d-flex flex-col items-center"> #}
  706.             {#                                            <img class="section-5__home__experience_container_mobile_navigation_action_img" #}
  707.             {#                                                 src="/bundles/shopwithmetheme/assets/imgs/aiStream_edit.svg"/> #}
  708.             {#                                            <span class="typo-sub-text-4 section-5__home__experience_container_mobile_navigation_info">10k</span> #}
  709.             {#                                        </div> #}
  710.             {#                                        <div class="section-5__home__experience_container_mobile_navigation_action d-flex flex-col items-center"> #}
  711.             {#                                            <img class="section-5__home__experience_container_mobile_navigation_action_img" #}
  712.             {#                                                 src="/bundles/shopwithmetheme/assets/imgs/aiStream_cart.svg"/> #}
  713.             {#                                        </div> #}
  714.             {#                                    </div> #}
  715.             {#                                    <div class=" gap-8px d-flex flex-col"> #}
  716.             {#                                        <img src="/bundles/shopwithmetheme/assets/imgs/aiStream_navUp.svg"/> #}
  717.             {#                                        <img src="/bundles/shopwithmetheme/assets/imgs/aiStream_navDown.svg"/> #}
  718.             {#                                    </div> #}
  719.             {#                                </div> #}
  720.             {#                                <div class="section-5__home__experience_container_mobile_video_infor d-flex flex-col"> #}
  721.             {#                                    <div class="section-5__home__experience_container_video_infor_user_info d-flex items-center"> #}
  722.             {#                                        <img class="section-5__home__experience_container_video_avatar_image" #}
  723.             {#                                             src="/bundles/shopwithmeui/assets/imgs/shop_with_me.svg"/> #}
  724.             {#                                        <span class="section-5__home__experience_container_username typo-sub-text-4">{{ productVideo|first.postUser }}</span> #}
  725.             {#                                    </div> #}
  726.             {#                                    <div class="section-5__home__experience_container_video_infor d-flex flex-col gap-8px"> #}
  727.             {#                                        <span class="section-5__home__experience_container_video_infor_product_name">{{ productVideo|first.product.translated.name }}</span> #}
  728.             {#                                        <div id="userScore" #}
  729.             {#                                             class="section-5__home__experience_container_mobile_video_infor_truncate-text-container d-flex"> #}
  730.             {#                                            <span class="typo-sub-text-5-smb section-5__home__experience_container_video_infor_user_review truncate-text truncated"> #}
  731.             {#                                            {{ productVideo|first.product.translated.description|raw }} #}
  732.             {#                                        </span> #}
  733.             {#                                            <span class="typo-sub-text-5-smb show-more-btn">more</span> #}
  734.             {#                                        </div> #}
  735.             {#                                    </div> #}
  736.             {#                                </div> #}
  737.             {#                                <div class="section-5__home__experience_container_mobile_video_pause_button position-absolute"> #}
  738.             {#                                    <img id="home_aiStream_play_button" #}
  739.             {#                                         src="/bundles/shopwithmetheme/assets/imgs/aiStream_play.svg"/> #}
  740.             {#                                </div> #}
  741.             {#                            </div> #}
  742.             {#                            <video id="home_aiStream_vid" #}
  743.             {#                                   class="section-5__home__experience-container-item-img item_experience_img" muted #}
  744.             {#                                   playsinline loop> #}
  745.             {#                                <source src="/bundles/shopwithmetheme/assets/video-eg.mp4" type="video/mp4"/> #}
  746.             {#                            </video> #}
  747.             {#                            <div class="section-5__home__experience-container-item-overlay position-absolute"></div> #}
  748.             {#                        </div> #}
  749.             {#                    {% endif %} #}
  750.             {#                </div> #}
  751.         </div>
  752.         {# Modal #}
  753.         {% sw_include '@Storefront/storefront/component/aistream/desktop-common-modal.html.twig' with {
  754.             id: desktopShareModal,
  755.             height: '100%',
  756.             className: 'lazy-load-modal full-screen appear-center',
  757.             style: 'position: fixed !important; background-color: #00000066;',
  758.             content: desktopShareModalContent|raw,
  759.             showTopNut: false,
  760.         } %}
  761.     {% endblock %}
  762.     <script>
  763.         const caodaoTimeProductDetail = {{ currentDeal.endDate|date("U") is not empty ? currentDeal.endDate|date("U")|json_encode|raw : 'null' }};
  764.         const translationsProductDetail = {
  765.             expired: "{{ 'app.expired'|trans|sw_sanitize }}",
  766.             addToCartSuccess: "{{ 'app.addToCartSuccess'|trans|sw_sanitize }}",
  767.             addToCartFailed: "{{ 'app.addToCartFailed'|trans|sw_sanitize }}",
  768.         };
  769.         const checkoutLinks = {
  770.             checkoutCartLink: "{{ seoUrl('frontend.checkout.cart.page') }}",
  771.         }
  772.     </script>
  773. {% endblock %}