app/template/tanzo/Block/recommend_product_block.twig line 1

Open in your IDE?
  1. {#
  2.  * This file is part of the Recommend Product plugin
  3.  *
  4.  * Copyright (C) EC-CUBE CO.,LTD. All Rights Reserved.
  5.  *
  6.  * For the full copyright and license information, please view the LICENSE
  7.  * file that was distributed with this source code.
  8. #}
  9. {% block javascript %}
  10.     <script>
  11.         $(function() {
  12.             $('.recommend_slider').slick({
  13.                 slidesToShow: 4,
  14.                 slidesToScroll: 1,
  15.                 dots: false,
  16.                 //arrows: false,
  17.                 autoplay: true,
  18.                 speed: 2000,
  19.                 autoplaySpeed: 2000,
  20.                 responsive: [{
  21.                     breakpoint: 1067,
  22.                     settings: {
  23.                         slidesToShow: 3,
  24.                     }
  25.                 }, {
  26.                     breakpoint: 767,//切り替えたいデバイス幅を入れる
  27.                     settings: {
  28.                         slidesToShow: 2,
  29.                     }
  30.                 }],
  31.             });
  32.         });
  33.     </script>
  34. {% endblock javascript %}
  35. {% set recommend_products = repository('Plugin\\Recommend42\\Entity\\RecommendProduct').getRecommendProduct %}
  36. <div class="ec-shelfRole bg-white">
  37.     <div class="ec-newItemRole__listItem pt-5">
  38.         <div class="ec-secHeading my-4 text-center">
  39.             <p class="ec-secHeading__en fs-2">{{ 'RECOMMENDED'|trans }}</p>
  40.             <!--<p class="ec-secHeading__line"></p>-->
  41.             <p class="ec-secHeading__ja fs-6">{{ 'おすすめ商品'|trans }}</p>
  42.         </div>
  43.     </div>
  44.     <div class="ec-sliderRole overflow-hidden">
  45.         <div class="recommend_slider">
  46.             {% for RecommendProduct in recommend_products %}
  47.                 <div class="item slick-slide px-2">
  48.                     <a href="{{ url('product_detail', {'id': RecommendProduct.Product.id}) }}">
  49.                         <img src="{{ asset(RecommendProduct.Product.mainFileName|no_image_product, "save_image") }}">
  50.                     </a>
  51.                 </div>
  52.             {% endfor %}
  53.         </div>
  54.     </div>
  55.     <!--
  56.     <ul class="ec-shelfGrid">
  57.         {% for RecommendProduct in recommend_products %}
  58.             <li class="ec-shelfGrid__item">
  59.                 <a href="{{ url('product_detail', {'id': RecommendProduct.Product.id}) }}">
  60.                     <img src="{{ asset(RecommendProduct.Product.mainFileName|no_image_product, "save_image") }}">
  61.                     {#<p>{{ RecommendProduct.comment|raw|purify|nl2br }}</p>
  62.                     <dl>
  63.                         <dt class="item_name">{{ RecommendProduct.Product.name }}</dt>
  64.                         <dd class="item_price">
  65.                             {% if RecommendProduct.Product.hasProductClass %}
  66.                                 {% if RecommendProduct.Product.getPrice02Min == RecommendProduct.Product.getPrice02Max %}
  67.                                     {{ RecommendProduct.Product.getPrice02IncTaxMin|price }}
  68.                                 {% else %}
  69.                                     {{ RecommendProduct.Product.getPrice02IncTaxMin|price }} ~ {{ RecommendProduct.Product.getPrice02IncTaxMax|price }}
  70.                                 {% endif %}
  71.                             {% else %}
  72.                                 {{ RecommendProduct.Product.getPrice02IncTaxMin|price }}
  73.                             {% endif %}
  74.                         </dd>
  75.                     </dl>#}
  76.                 </a>
  77.             </li>
  78.         {% endfor %}
  79.     </ul>-->
  80. </div>
  81. <!-- ▲item_list▲ -->