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\\Recommend4\\Entity\\RecommendProduct').getRecommendProduct %}
  10. <style type="text/css">
  11.     .sale_badge_area {
  12.         font-size: 10px;
  13.         position: relative;
  14.         bottom: 5px;
  15.         left: 5px;
  16.     }
  17.     .sale_badge_area ul {
  18.         margin: 0;
  19.         padding: 0;
  20.         position: absolute;
  21.         font-size: 10px;
  22.         bottom: 0;
  23.     }
  24.     .sale_badge_area ul li {
  25.         list-style: none;
  26.         padding: 5px 10px;
  27.         background-color: #fd565f;
  28.         color: #FFF;
  29.         z-index: 1;
  30.     }
  31.     @media screen and (max-width:768px) {
  32.         .sale_badge_area ul li {
  33.             padding: 2px 5px;
  34.         }
  35.     }
  36. </style>
  37. <!-- ▼item_list▼ -->
  38. <div class="ec-shelfRole custom_ru_pro">
  39.     <div class="page-width">
  40.       <div class="section-header section-header--with-link">
  41.        <div class="section-header__title">
  42.           <h2 class="section-header__titleText">RECOMMEND</h2>
  43.           <p>おすすめ商品</p>
  44. </div>
  45. {#
  46. <a href="/RecommendProduct" class="section-header__link">一覧を見る</a>
  47. #}
  48.     </div>
  49.     
  50.     <ul class="ec-shelfGrid page-width">
  51.         {% for RecommendProduct in recommend_products %}
  52.             <li class="ec-shelfGrid__item">
  53.                 <a href="{{ url('product_detail', {'id': RecommendProduct.Product.id}) }}">
  54.                     <img src="{{ asset(RecommendProduct.Product.mainFileName|no_image_product, "save_image") }}">
  55.                     {% if RecommendProduct.Product.getPrice01IncTaxMin %}
  56.                     <div class="sale_badge_area">
  57.                         <ul>
  58.                             <li class="sale_badge">
  59.                                 {{ RecommendProduct.Product|sales_off }}
  60.                             </li>
  61.                         </ul>
  62.                     </div>
  63.                     {% endif %}
  64.                     <p>{{ RecommendProduct.comment|raw|nl2br }}</p>
  65.                     <dl>
  66.                         <dt class="item_name">{{ RecommendProduct.Product.name }}</dt>
  67.                         <dd class="item_price">
  68.                             {% if RecommendProduct.Product.hasProductClass %}
  69.                                 {% if RecommendProduct.Product.getPrice02Min == RecommendProduct.Product.getPrice02Max %}
  70.                                     {{ RecommendProduct.Product.getPrice02IncTaxMin|price }}
  71.                                 {% else %}
  72.                                     {{ RecommendProduct.Product.getPrice02IncTaxMin|price }} ~ {{ RecommendProduct.Product.getPrice02IncTaxMax|price }}
  73.                                 {% endif %}
  74.                             {% else %}
  75.                                 {{ RecommendProduct.Product.getPrice02IncTaxMin|price }}
  76.                             {% endif %}
  77.                         </dd>
  78.                     </dl>
  79.                 </a>
  80.             </li>
  81.         {% endfor %}
  82.     </ul>
  83. </div>
  84. </div>
  85. <!-- ▲item_list▲ -->