{#
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 javascript %}
<script>
eccube.productsClassCategories = {
{% for Product in pagination %}
"{{ Product.id|escape('js') }}" : {{ class_categories_as_json(Product)|raw }}
{% if loop.last == false %},{% endif %}{% endfor %}
};
$(function () { // 表示件数を変更
$('.disp-number').change(function () {
var dispNumber = $(this).val();
$('#disp_number').val(dispNumber);
$('#pageno').val(1);
$("#form1").submit();
});
// 並び順を変更
$('.order-by').change(function () {
var orderBy = $(this).val();
$('#orderby').val(orderBy);
$('#pageno').val(1);
$("#form1").submit();
});
$('.add-cart').on('click', function (e) {
var $form = $(this).parents('li').find('form');
// 個数フォームのチェック
var $quantity = $form.parent().find('.quantity');
if ($quantity.val() < 1) {
$quantity[0].setCustomValidity('{{ 'front.product.invalid_quantity'|trans }}');
setTimeout(function () {
loadingOverlay('hide');
}, 100);
return true;
} else {
$quantity[0].setCustomValidity('');
} e.preventDefault();
$.ajax({
url: $form.attr('action'),
type: $form.attr('method'),
data: $form.serialize(),
dataType: 'json',
beforeSend: function (xhr, settings) { // Buttonを無効にする
$('.add-cart').prop('disabled', true);
}
}).done(function (data) { // レスポンス内のメッセージをalertで表示
$.each(data.messages, function () {
$('#ec-modal-header').text(this);
});
$('.ec-modal').show()
// カートブロックを更新する
$.ajax({url: '{{ url('block_cart') }}', type: 'GET', dataType: 'html'}).done(function (html) {
$('.ec-headerRole__cart').html(html);
});
}).fail(function (data) {
alert('{{ 'front.product.add_cart_error'|trans }}');
}).always(function (data) { // Buttonを有効にする
$('.add-cart').prop('disabled', false);
});
});
});
$('.ec-modal-wrap').on('click', function (e) { // モーダル内の処理は外側にバブリングさせない
e.stopPropagation();
});
$('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function () {
$('.ec-modal').hide()
});
</script>
{% endblock %}
{% block main %}
<div class="pb-[120px] md:pb-20 w-full">
<div>
<div class="flex gap-4 md:gap-2 items-start mx-auto w-full pl-[10.625vw] md:pl-6 pt-[120px] md:pt-20 pb-10 md:pb-1">
<hr class="md:h-[64px] h-[120px] w-[2px] bg-gradient-to-b from-[#ADAAA6] to-[#F0EDE900] border-none">
<h1 class="text-2xl md:text-xl font-light leading-9 tracking-widest">LINEUP</h1>
</div>
{% set breadcrumbs = [{'name': "LINEUP" }] %}
{{ include('Block/breadcrumb.twig') }}
</div>
{% if pagination.totalItemCount > 0 %}
<div class="w-full flex flex-col items-center lg:px-6 justify-center">
<ul class="grid grid-cols-2 md:flex md:flex-col gap-x-[140px] lg:gap-x-20 gap-y-[120px] md:gap-y-10 w-full md:items-center justify-center max-w-[800px]">
{% for Product in pagination %}
<a href="{{ url('product_detail', { id: Product.id }) }}">
<li class="flex flex-col items-center text-center w-[330px] lg:w-full hover">
<div class="flex flex-col items-center">
<img src="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}" alt="{{ Product.name }}" {% if loop.index > 5 %} loading="lazy" {% endif %} class="w-[330px] h-[330px] md:w-[327px] md:h-[327px] mb-10 md:mb-6">
<div class="mb-6">
<p class="font-light font-notoserif text-[32px] mb-2 tracking-[6.4px]">{{ Product.name }}</p>
<p class="text-xs font-notoserif font-light tracking-wide">{{Product.name_kana}}</p>
</div>
<p class="h-14 mb-4 text-sm text-center leading-7 flex items-center">{{ Product.description_list|raw|nl2br }}</p>
<div class="flex items-baseline gap-1 mb-6">
<p class="text-xl leading-9">
{% if Product.hasProductClass %}
{% if Product.getPrice02Min == Product.getPrice02Max %}
{{ Product.getPrice02IncTaxMin| number_format }}
{% else %}
{{ Product.getPrice02IncTaxMin| number_format }}
~
{{ Product.getPrice02IncTaxMax| number_format}}
{% endif %}
{% else %}
{{ Product.getPrice02IncTaxMin| number_format }}
{% endif %}
</p>
<p class="text-xs leading-4 font-medium">円(税込)</p>
</div>
</div>
<div href="{{ url('product_detail', {'id': Product.id}) }}" class="w-[238px] border-black border py-3 rounded-[3px] md:w-[258px] mb-10 text-sm">詳しくはこちら</div>
<div class="w-[330px] h-[88px] sm:w-[100vw] md:mx-[calc(50%-50vw)] sm:px-[calc(50%-50vw)] bg-background-default">
<p class="px-8 py-4 text-center leading-7 text-sm">{{Product.free_area|raw|nl2br}}</p>
</div>
</li>
</a>
{% endfor %}
</ul>
</div>
<div class="ec-pagerRole">
{% include "pager.twig" with {'pages': pagination.paginationData} %}
</div>
{% endif %}
</div>
{% endblock %}