{#
This file is part of EC-CUBE
Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
http://www.ec-cube.co.jp/
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% extends 'default_frame.twig' %}
{% set body_class = 'product_page' %}
{% block main %}
<div class="products">
<div class="main-image"><img class="pc" src="/html/user_data/assets/img/products/main_image.jpg"><img class="sp" src="/html/user_data/assets/img/products/main_image_sp.jpg"></div>
<div class="content">
<div class="title"><img class="pc" src="/html/user_data/assets/img/products/title.svg"></div>
{% if products is not empty %}
<div class="ec-categoryNaviRole">
<div class="ec-itemNav">
<ul class="ec-itemNav__nav">
{% for product in products %}
<li>
<a href="" class="list-nav" category-id="{{ product["category"]["id"] }}">
{{ product["category"]["category_name"] }}<img src="/html/user_data/assets/img/products/arrow.svg">
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
{% for product in products %}
<div class="category" id="Cat{{product["category"]["id"]}}">
<div class="category-title">
<div class="en">{{product["category"]["en"]}}</div>
<div class="ja">{{product["category"]["category_name"]}}</div>
</div>
<div class="items">
{% for item in product["products"] %}
<div class="item">
<div class="img"><img src="/html/upload/save_image/{{item["product_image"][0]["file_name"]}}" /></div>
<div class="name">{{item["name"]}}</div>
</div>
{% endfor %}
</div>
</div>
{% endfor %}
{% else %}
<div style="text-align:center;">商品はありません</div>
{% endif %}
</div>
</div>
{% endblock %}
{% block javascript %}
<script>
$(function() {
$(".list-nav").on("click",function(e){
e.preventDefault();
var category_id = $(this).attr("category-id");
var top = $("#Cat"+category_id).offset().top - 150;
$('html,body').animate({'scrollTop': top}, 500);
});
});
</script>
{% endblock javascript %}