app/template/yamaria/Block/common_item_list.twig line 1

Open in your IDE?
  1. {#
  2. 親カテゴリに基づく商品一覧を表示
  3. setMaxResultsで取得したアイテムに対してカテゴリフィルタがかかる為、
  4. ループ時に8件表示指定。
  5. #}
  6. <!-- アイテムリスト -->
  7. {% set Category = repository("Eccube\\Entity\\Category").find( category_base ) %}
  8. {% set OrderbyObj = repository("Eccube\\Entity\\Master\\ProductListOrderBy").find('4') %}
  9. {% set products = repository("Eccube\\Entity\\Product")
  10.     .getQueryBuilderBySearchData({'category_id':Category,'orderby':OrderbyObj})
  11.     .setMaxResults( 100 )
  12.     .getQuery()
  13.     .getResult() 
  14. %}
  15. {% if products %}
  16. <div class="ec-shelfRole ym-role">
  17.     <div class="ec-secHeading">
  18.         <span class="ec-secHeading__en">PRODUCTS</span>
  19.         <span class="ec-secHeading__line"></span>
  20.         <span class="ec-secHeading__ja">商品一覧</span>
  21.     </div>
  22.     <ul class="ec-shelfGrid">
  23.         {% for Product in products | slice( 0, 8 ) %}
  24.         <li class="ec-shelfGrid__item ym-item">
  25.             <a href="{{ url('product_detail', {'id': Product.id}) }}">
  26.                 <p class="ym-item__image">
  27.                     {% set tag_lb,tag_lt = '','' %}
  28.                     {% for Tag in Product.Tags %}
  29.                         {% if Tag.id == 3 %}
  30.                             {% set tag_lb %}<span class="list_tag tag_pos_lb tag_style_{{ Tag.id }}"><span class="tag_inner">{{ Tag }}</span></span>{% endset %}
  31.                         {% else %}
  32.                             {% set tag_lt %}<span class="list_tag tag_pos_lt tag_style_{{ Tag.id }}"><span class="tag_inner">{{ Tag }}</span></span>{% endset %}
  33.                         {% endif %}
  34.                     {% endfor %}
  35.                     {{ tag_lb }}{{ tag_lt }}
  36.                     <img src="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}">
  37.                 </p>
  38.                 <p class="ym-item__name">{{ Product.name }}</p>
  39.                 <p class="ym-item__price">{{ Product.getPrice02IncTaxMax|price }}</p>
  40.             </a>
  41.         </li>
  42.         {% endfor %}
  43.         {#
  44.         <li class="ec-shelfGrid__item ym-item">
  45.             <a href="">
  46.                 <p class="ym-item__image">
  47.                     <img src="/html/user_data/assets/img/dummy/img_dummy_07.jpg">
  48.                 </p>
  49.                 <p class="ym-item__name">Mariaプルオーバーパーカー</p>
  50.                 <p class="ym-item__price">¥5,500(税込)</p>
  51.             </a>
  52.         </li>
  53.         <li class="ec-shelfGrid__item ym-item">
  54.             <a href="">
  55.                 <p class="ym-item__image">
  56.                     <img src="/html/user_data/assets/img/dummy/img_dummy_08.jpg">
  57.                 </p>
  58.                 <p class="ym-item__name">Mariaドライポロシャツ</p>
  59.                 <p class="ym-item__price">¥3,850(税込)</p>
  60.             </a>
  61.         </li>
  62.         <li class="ec-shelfGrid__item ym-item">
  63.             <a href="">
  64.                 <p class="ym-item__image">
  65.                     <img src="/html/user_data/assets/img/dummy/img_dummy_09.jpg">
  66.                 </p>
  67.                 <p class="ym-item__name">abonetアクティブカレントハット Mariaモデル</p>
  68.                 <p class="ym-item__price">¥12,100(税込)</p>
  69.             </a>
  70.         </li>
  71.         <li class="ec-shelfGrid__item ym-item">
  72.             <a href="">
  73.                 <p class="ym-item__image">
  74.                     <img src="/html/user_data/assets/img/dummy/img_dummy_10.jpg">
  75.                 </p>
  76.                 <p class="ym-item__name">Maria×ST(ストリームトレイル) ロックショアバッグ</p>
  77.                 <p class="ym-item__price">¥18,700(税込)</p>
  78.             </a>
  79.         </li>
  80.         <li class="ec-shelfGrid__item ym-item">
  81.             <a href="">
  82.                 <p class="ym-item__image">
  83.                     <img src="/html/user_data/assets/img/dummy/img_dummy_11.jpg">
  84.                 </p>
  85.                 <p class="ym-item__name">Mariaカッティングステッカー</p>
  86.                 <p class="ym-item__price">¥1,650(税込)</p>
  87.             </a>
  88.         </li>
  89.         <li class="ec-shelfGrid__item ym-item">
  90.             <a href="">
  91.                 <p class="ym-item__image">
  92.                     <img src="/html/user_data/assets/img/dummy/img_dummy_07.jpg">
  93.                 </p>
  94.                 <p class="ym-item__name">Mariaプルオーバーパーカー</p>
  95.                 <p class="ym-item__price">¥5,500(税込)</p>
  96.             </a>
  97.         </li>
  98.         <li class="ec-shelfGrid__item ym-item">
  99.             <a href="">
  100.                 <p class="ym-item__image">
  101.                     <img src="/html/user_data/assets/img/dummy/img_dummy_08.jpg">
  102.                 </p>
  103.                 <p class="ym-item__name">Mariaドライポロシャツ</p>
  104.                 <p class="ym-item__price">¥3,850(税込)</p>
  105.             </a>
  106.         </li>
  107.         <li class="ec-shelfGrid__item ym-item">
  108.             <a href="">
  109.                 <p class="ym-item__image">
  110.                     <img src="/html/user_data/assets/img/dummy/img_dummy_09.jpg">
  111.                 </p>
  112.                 <p class="ym-item__name">abonetアクティブカレントハット Mariaモデル</p>
  113.                 <p class="ym-item__price">¥12,100(税込)</p>
  114.             </a>
  115.         </li>
  116.         #}
  117.     </ul>
  118.     <p class="ym-more ym-btn"><a href="{{ url('product_list') }}?category_id={{ category_base }}">もっと見る</a></p>
  119. </div>
  120. {% endif %}