app/template/default/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. {% set recommend_products = repository('Plugin\\Recommend42\\Entity\\RecommendProduct').getRecommendProduct %}
  10. <!-- ▼item_list▼ -->
  11. {% if recommend_products %}
  12.     <section class="p-home-recommend">
  13.         <h2 class="p-home-recommend__ttl c-ttl-sec">
  14.             <span class="jp">おすすめ商品</span>
  15.             <span class="en">RECOMMEND</span>
  16.         </h2>
  17.         <div class="p-home-recommend__list" id="js-recommend-slider">
  18.             {% for RecommendProduct in recommend_products %}
  19.                 {% if is_granted('view', RecommendProduct.Product) %}
  20.                     <div class="p-home-recommend__item">
  21.                         <a href="{{ url('product_detail', {'id': RecommendProduct.Product.id}) }}" class="p-home-recommend__item-link l-link">
  22.                             <div class="p-home-recommend__item-img-wrap">
  23.                                 <img src="{{ asset(RecommendProduct.Product.mainFileName|no_image_product, "save_image") }}" alt="">
  24.                             </div>
  25.                             <h3 class="p-home-recommend__item-ttl">{{ RecommendProduct.Product.name }}<span class="l-link__circle"><span class="l-link__arrow"></span></span></h3>
  26.                         </a>
  27.                     </div>
  28.                 {% endif %}
  29.             {% endfor %}
  30.         </div>
  31.         <div class="p-home-recommend__btn-row">
  32.             <a href="{{ url('product_list') }}" class="p-home-recommend__btn c-btn">すべての商品をみる</a>
  33.         </div>
  34.     </section>
  35. {% endif %}
  36. <!-- ▲item_list▲ -->