app/template/default/Block/new_item.twig line 1

Open in your IDE?
  1. {% if Category81 %}
  2. <div class="ec-role">
  3.     <!-- ▼item_list▼ -->
  4.     <div class="item_gallery flyer">
  5.         <h2><span>{{ Category81.name }}</span><a href="{{ url('product_list') }}?category_id={{ Category81.id }}&orderby=2">もっと見る</a></h2>
  6.         <ul class="row">
  7.         {% for Product in productsCategory81 %}
  8.             <li>
  9.                 <a href="{{ url('product_detail', {'id': Product.id}) }}" class="item_photo">
  10.                     <div class="item_photo overflow-hidden">
  11.                         {# <img src="{{ app.config.image_save_urlpath }}/{{ Product.main_list_image|no_image_product }}"> #}
  12.                         <img src="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}" class="rounded-0">
  13.                                 {% if app.user != null %}
  14.                                     {% if app.user.rank.getId == 1 %}
  15.                         {% if Product.MarkupRateMax and Product.MarkupRateMax > 0 %}
  16.                             <span class="multi_num"><em>掛率</em> 
  17.                                 {{ Product.MarkupRateMax|number_format(0) }}% 
  18.                             </span>
  19.                         {% endif %}
  20.                                     {% else %}
  21.                                       {% if Product.price01Min %}
  22.                                         {% set discount_rate = (Product.price02Min * app.user.rank.getDiscountRate / Product.price01Min) * 100 %}
  23.                         {% if Product.MarkupRateMax and Product.MarkupRateMax > 0 %}
  24.                             <span class="multi_num"><em>掛率</em> 
  25.                                         {{ discount_rate|number_format(0) }}% 
  26.                             </span>
  27.                         {% endif %}
  28.                                       {% endif %}
  29.                                     {% endif %}
  30.                                 {% else %}
  31.                         {% if Product.MarkupRateMax and Product.MarkupRateMax > 0 %}
  32.                             <span class="multi_num"><em>掛率</em> 
  33.                                 {{ Product.MarkupRateMax|number_format(0) }}% 
  34.                             </span>
  35.                         {% endif %}
  36.                                 {% endif %}
  37.                         {# 掛率は入力値をそのまま使う
  38.                         {% if Product.price01Min != 0 %}
  39.                             {% set discount_rate = (Product.price02Min / Product.price01Min) * 100 %}
  40.                             {% if discount_rate < 100 %}
  41.                                 <span class="multi_num"><em>掛率</em> {{ discount_rate|number_format(0) }}% </span>
  42.                             {% endif %}
  43.                         {% endif %}
  44.                         #}
  45.                     </div>
  46.                 </a>
  47.                 <dl>
  48.                     {% for ProductTag in Product.ProductTag %}
  49.                         <dd class="product_tag_list"><a href="{{ url('product_list') }}?tag_id={{ ProductTag.TagId}}">{{ ProductTag.Tag }}</a></dd>
  50.                     {% endfor %}
  51.                     <dt class="product_maker_image">
  52.                     {% if Product.Maker is not null %}
  53.                         {% set image_path = 'assets/img/maker/' ~ Product.Maker.maker_id ~ '.png' %}
  54.                     {% else %}
  55.                         {% set image_path = 'assets/img/maker/default.png' %}
  56.                     {% endif %}
  57.                     <img src="{{ asset(image_path, 'user_data') }}" onerror="this.onerror=null;this.style='display:none;'" alt="メーカーロゴ">
  58.                     </dt>
  59.                     <dt class="item_name"><a href="{{ url('product_detail', {'id': Product.id}) }}">{{ Product.name }}</a></dt>
  60.                     <dd class="item_price special_price">
  61.                         {% if app.user != null %}
  62.                             {% set price02min = Product.getPrice02Min * app.user.rank.getDiscountRate %}
  63.                         {% else %}
  64.                             {% set price02min = Product.getPrice02Min %}
  65.                         {% endif %}
  66.                         {{ price02min|price }}
  67.                     </dd>
  68.                 </dl>
  69.             </li>
  70.         {% endfor %}
  71.         </ul>
  72.     </div>
  73.     <!-- ▲item_list▲ -->
  74. </div>
  75. {% endif %}