app/template/main/Block/new_arrival.twig line 1

Open in your IDE?
  1. {% set Category = repository("Eccube\\Entity\\Category").find(2) %}
  2. {% 
  3. set products = repository("Eccube\\Entity\\Product")
  4. .getQueryBuilderBySearchData({'category_id':Category})
  5. .setMaxResults(5)
  6. .getQuery()
  7. .getResult()
  8. %}
  9. <div class="ec-role">
  10.     <div class="ec-newItemRole">
  11.         <div class="ec-newItemRole__list">
  12.             <div class="ec-newItemRole__listItem">
  13.                 <div class="ec-newItemRole__listItemHeading ec-secHeading--tandem">
  14.                     <span class="ec-secHeading__en">{{ 'front.block.new_item.title__en'|trans }}</span>
  15.                     <span class="ec-secHeading__line"></span>
  16.                     <span class="ec-secHeading__ja">{{ 'front.block.new_item.title__ja'|trans }}</span>
  17.                     <a class="ec-inlineBtn--top" href="{{ url('product_list') }}">{{ 'front.block.new_item.more'|trans }}</a>
  18.                 </div>
  19.             </div>
  20.             {% if products %}
  21.             {% for p in products %}
  22.             <div class="ec-newItemRole__listItem">
  23.                 <a href="{{ url('product_detail', {'id': p.id}) }}">
  24.                     <img src="{{ asset(p.main_list_image|no_image_product, 'save_image') }}">
  25.                     <p class="ec-newItemRole__listItemTitle">{{ p.name }}</p>
  26.                 </a>
  27.             </div>
  28.             {% endfor %}
  29.             {% endif %}
  30.         </div>
  31.     </div>
  32. </div>