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

Open in your IDE?
  1. {#
  2. ランキング
  3. #}
  4. {# 親カテゴリの判定|default_frameで設定 #}
  5. {% if category_base == '7' %}{# YAMASHITA #}
  6.     {%
  7.     set rankData = {
  8.         item: [ 59, 46, 23, 33, 34, 44, 22, 21, ],
  9.         url: '/products/list?category_id=7'
  10.     }
  11.     %}
  12. {% elseif category_base == '8' %}{# Maria #}
  13.     {%
  14.     set rankData = {
  15.         item: [ 114, 41, 58, 17, 42, ],
  16.         url: '/products/list?category_id=8'
  17.     }
  18.     %}
  19. {% else %}{# 総合 #}
  20.     {%
  21.     set rankData = {
  22.         item: [ 59, 60, 13, 40, 23, 33, 50, 45, 24, 19 ],
  23.         url: '/products/list'
  24.     }
  25.     %}
  26. {% endif %}
  27. <!-- ランキング -->
  28. <div class="ec-shelfRole ym-rankingRole ym-role">
  29.     <div class="ec-secHeading">
  30.         <span class="ec-secHeading__en">RANKING</span>
  31.         <span class="ec-secHeading__line"></span>
  32.         <span class="ec-secHeading__ja">最新人気商品ランキング</span>
  33.     </div>
  34.     <ol class="ym-rankingRole__list ym-item__list">
  35.         {% for key, productId in rankData.item %}
  36.             {% set Product = repository('Eccube\\Entity\\Product').find(productId) %}
  37.             <li class="ym-rankingRole__item ym-item">
  38.                 <a href="{{ url('product_detail', {'id': Product.id}) }}">
  39.                     <p class="ym-item__image">
  40.                         <img src="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}" alt="">
  41.                     </p>
  42.                     <p class="ym-item__name">{{ Product.name }}</p>
  43.                     <p class="ym-item__price">
  44.                         {% if Product.hasProductClass %}
  45.                             {% if Product.getPrice02Min == Product.getPrice02Max %}
  46.                                 {{ Product.getPrice02IncTaxMin|price|replace({ '¥': '¥' }) }}
  47.                             {% else %}
  48.                                 {{ Product.getPrice02IncTaxMin|price|replace({ '¥': '¥' }) }}~{{ Product.getPrice02IncTaxMax|price|replace({ '¥': '¥' }) }}
  49.                             {% endif %}
  50.                         {% else %}
  51.                             {{ Product.getPrice02IncTaxMin|price|replace({ '¥': '¥' }) }}
  52.                         {% endif %}
  53.                     </p>
  54.                 </a>
  55.             </li>
  56.             {% endfor %}
  57.         {#
  58.         <li class="ym-rankingRole__item ym-item">
  59.             <a href="">
  60.                 <p class="ym-item__image">
  61.                     <img src="/html/user_data/assets/img/dummy/img_dummy_01.jpg">
  62.                 </p>
  63.                 <p class="ym-item__name">エギ王エギングバッグ</p>
  64.                 <p class="ym-item__price">¥4,400(税込)</p>
  65.             </a>
  66.         </li>
  67.         <li class="ym-rankingRole__item ym-item">
  68.             <a href="">
  69.                 <p class="ym-item__image">
  70.                     <img src="/html/user_data/assets/img/dummy/img_dummy_02.jpg">
  71.                 </p>
  72.                 <p class="ym-item__name">エギ王カスタムハンドル</p>
  73.                 <p class="ym-item__price">¥27,500(税込)</p>
  74.             </a>
  75.         </li>
  76.         <li class="ym-rankingRole__item ym-item">
  77.             <a href="">
  78.                 <p class="ym-item__image">
  79.                     <img src="/html/user_data/assets/img/dummy/img_dummy_03.jpg">
  80.                 </p>
  81.                 <p class="ym-item__name">YAMASHITAカッティングステッカー</p>
  82.                 <p class="ym-item__price">¥1,650(税込)</p>
  83.             </a>
  84.         </li>
  85.         <li class="ym-rankingRole__item ym-item">
  86.             <a href="">
  87.                 <p class="ym-item__image">
  88.                     <img src="/html/user_data/assets/img/dummy/img_dummy_04.jpg">
  89.                 </p>
  90.                 <p class="ym-item__name">エギ王Tシャツ</p>
  91.                 <p class="ym-item__price">¥3,300(税込)</p>
  92.             </a>
  93.         </li>
  94.         <li class="ym-rankingRole__item ym-item">
  95.             <a href="">
  96.                 <p class="ym-item__image">
  97.                     <img src="/html/user_data/assets/img/dummy/img_dummy_05.jpg">
  98.                 </p>
  99.                 <p class="ym-item__name">エギ王 ライフジャケット 肩掛</p>
  100.                 <p class="ym-item__price">¥2,4200(税込)</p>
  101.             </a>
  102.         </li>
  103.         <li class="ym-rankingRole__item ym-item">
  104.             <a href="">
  105.                 <p class="ym-item__image">
  106.                     <img src="/html/user_data/assets/img/dummy/img_dummy_06.jpg">
  107.                 </p>
  108.                 <p class="ym-item__name">YAMASHITA キャップ</p>
  109.                 <p class="ym-item__price">¥3,300(税込)</p>
  110.             </a>
  111.         </li>
  112.         #}
  113.     </ol>
  114.     <p class="ym-more ym-btn"><a href="{{ rankData.url }}">もっと見る</a></p>
  115. </div>