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. <!-- ▼おすすめ商品▼ -->
  11. <section class="p-section bg-gray recommend-product">
  12.     <div class="inner">
  13.         <h2 class="p-title icon-top"><span>おすすめ商品</span></h2>
  14.         <p class="p-text">人気商品、季節のおすすめ、限定商品などをご紹介しております。</p>
  15.         <ul class="p-product-list">
  16.             {% for RecommendProduct in recommend_products %}
  17.                 <li class="p-product-item">
  18.                     <a href="{{ url('product_detail', {'id': RecommendProduct.Product.id}) }}">
  19.                         <div class="product-item-head">
  20.               {% if RecommendProduct.Product.ProductBadge is defined and
  21.                                     RecommendProduct.Product.ProductBadge is not null and
  22.                                     RecommendProduct.Product.ProductBadge.name is defined and
  23.                                     RecommendProduct.Product.ProductBadge.name is not null and
  24.                                     RecommendProduct.Product.ProductBadge.filename != '' %}
  25.                             <div class="product-item-badge">
  26.                                     <img
  27.                                             src="{{ asset(RecommendProduct.Product.ProductBadge.filename|no_image_product, 'save_image') }}"
  28.                                             alt="{{ RecommendProduct.Product.ProductBadge.name }}">
  29.                             </div>
  30.                             {% endif %}
  31.                             <img src="{{ asset(RecommendProduct.Product.mainFileName|no_image_product, "save_image") }}" alt="">
  32.                         </div>
  33.                         <div class="product-item-body">
  34.                             <h3 class="product-item-name">{{ RecommendProduct.Product.name }}</h3>
  35.                             <p class="product-item-desc">{{ RecommendProduct.comment|raw|purify|nl2br }}</p>
  36.                             <p class="product-item-price">
  37.                                 {% if RecommendProduct.Product.hasProductClass %}
  38.                                     {% if RecommendProduct.Product.getPrice02Min == RecommendProduct.Product.getPrice02Max %}
  39.                                         {{ RecommendProduct.Product.getPrice02IncTaxMin }}<span>円(税込)</span>
  40.                                     {% else %}
  41.                                         {{ RecommendProduct.Product.getPrice02IncTaxMin }}
  42.                                         ~
  43.                                         {{ RecommendProduct.Product.getPrice02IncTaxMax }}<span>円(税込)</span>
  44.                                     {% endif %}
  45.                                 {% else %}
  46.                                     {{ RecommendProduct.Product.getPrice02IncTaxMin }}<span>円(税込)</span>
  47.                                 {% endif %}
  48.                             </p>
  49.                         </div>
  50.                     </a>
  51.                 </li>
  52.             {% endfor %}
  53.         </ul>
  54.     <div class="p-button green">
  55.       <a href="{{ url('product_list') }}">商品一覧</a>
  56.     </div>
  57.     </div>
  58. </section>
  59. <!-- ▲おすすめ商品▲ -->