text
<div class="ec-role mt-1">
<div class="d-flex flex-column flex-md-row justify-content-between">
<h2 class="ec-secHeading mt-0">
<span class="ec-secHeading__en">PRODUCTS</span>
<span class="ec-secHeading__line"></span>
<span class="ec-secHeading__ja">製品一覧</span>
</h2>
<div class="d-none d-md-block ec-headerNaviRole__search">
{{ render(path('block_search_product')) }}
</div>
</div>
{# tag list #}
{% set tags = repository('Eccube\\Entity\\Tag').findAll() %}
{% if tags|length > 0 %}
<div class="tag-list mt-2">
<ul class="d-flex gap-1" style="padding-left:0">
{% for tag in tags %}
{% set isActive = app.request.get('tag_id') == tag.id %}
<li class="">
<a class="btn btn-sm btn-outline-secondary{% if isActive %} btn-primary{% endif %}" href="{{ url('product_list', {'tag_id': tag.id}) }}">{{ tag.name }}</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{#{% set products = repository("Eccube\\Entity\\Product")#}
{# .createQueryBuilder('product')#}
{# .setMaxResults(12)#}
{# .getQuery()#}
{# .getResult()#}
{#%}#}
{% if products is not null %}
<div class="ec-newItemRole pt-2">
<div class="ec-shelfGrid">
{% for product in products %}
<div class="ec-shelfGrid__item">
<a href="{{ url('product_detail', {'id': product.id}) }}">
<img src="{{ asset(product.main_list_image|no_image_product, 'save_image') }}">
<p class="ec-newItemRole__listItemTitle">{{ product.name }}</p>
<p class="ec-newItemRole__listItemPrice">
{% if is_granted("ROLE_USER") %}
{% if product.hasProductClass %}
{% if product.getPrice02Min == product.getPrice02Max %}
{% set getPrice02NoTaxMin = ceil(product.getPrice02IncTaxMin / 1.1) %}
{{ product.getPrice02IncTaxMin|price }}(税込)/
{{ getPrice02NoTaxMin|price }}(税抜)
{% else %}
{% set getPrice02NoTaxMin = ceil(product.getPrice02IncTaxMin / 1.1) %}
{% set getPrice02NoTaxMax = ceil(product.getPrice02IncTaxMax / 1.1) %}
{{ product.getPrice02IncTaxMin|price }} ~ {{ product.getPrice02IncTaxMax|price }}(税込)/<br>
{{ getPrice02NoTaxMin|price }} ~ {{ getPrice02NoTaxMax|price }}(税抜)
{% endif %}
{% else %}
{% set getPrice02NoTaxMin = ceil(product.getPrice02IncTaxMin / 1.1) %}
{{ product.getPrice02IncTaxMin|price }}(税込)/
{{ getPrice02NoTaxMin|price }}(税抜)
{% endif %}
{% for productClass in product.ProductClasses %}
<p class="ec-newItemRole__listItemPrice">在庫数:{{ productClass.getSaleLimit() }}</p>
{% endfor %}
{% else %}
価格・在庫数:お問い合わせください
{% endif %}
</p>
</a>
</div>
{% endfor %}
</div>
</div>
{% endif %}
{# search box #}
<div class="d-md-none ec-headerNaviRole__search">
{{ render(path('block_search_product')) }}
</div>
<a class="ec-blockBtn--top btn-center mt-3" href="{{ url('product_list') }}">販売商品をもっと見る</a>
</div>