{#
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);
});
});
});
{# ページ内のフリーエリアの高さをすべて取得し、すべてのフリーエリアをその高さにあわせる #}
$(document).ready(function(){
var maxOuterHeight = 0;
$('.free_area').each(function() {
var elementOuterHeight = $(this).outerHeight();
if (elementOuterHeight > maxOuterHeight) {
maxOuterHeight = elementOuterHeight;
}
});
if(maxOuterHeight > 0 ){
$('.free_area').each(function(){
$(this).outerHeight(maxOuterHeight);
})
}
});
$('.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 %}
{% set category_id = app.request.query.get('category_id') %}
{% set colors =
[
{
code: "#000000",
},
{
code: "#ffffff",
},
]
%}
{% set category_descriptions = [
{
id: 2,
description: "あなたの想いを、置ける場所"
},
{
id: 1,
description: "想いそのものを、かたちに"
},
{
id: 3,
description: "あなたの想いに、らしさを加える"
},
{
id: 4,
description: "おすすめ、人気のコーディネート"
},
{
id: 21,
description: "お仏壇のない、小さなご供養"
},
] %}
{% set parent_category_ids = [1,2,3,4,21] %}
{% block main %}
{% if search_form.category_id.vars.errors|length > 0 %}
<div class="ec-searchnavRole"> <p class="errormsg text-danger">{{ 'front.product.search__category_not_found'|trans }}</p>
</div>
{% else %}
<div class="pt-24 pb-10 md:py-6 xl:px-7 max-w-[1120px] mx-auto lg:mx-0">
<div
class="w-full flex flex-col font-extralight">
{% if Category.Parent is not null %}
{% set parent_category_name = Category.Parent.name %}
{% set parent_category_id = Category.Parent.id %}
<h1 class="font-extralight text-[40px] tracking-[8px] md:tracking-[6px] md:text-[22px] mb-5 md:mb-2">
{% if parent_category_id == 2 %}
お仏壇・ステージ
{% elseif Category.id == 3 %}
仏具・日用品
{% else %}
{{parent_category_name}}
{% endif %}
</h1>
{% for category_description in category_descriptions %}
{% if parent_category_id == category_description.id %}
<p class="text-[22px] font-extralight md:text-sm">{{category_description.description}}</p>
{% endif %}
{% endfor %}
{% else %}
<h1 class="font-extralight text-[40px] tracking-[8px] md:tracking-[6px] md:text-[22px] mb-5 md:mb-2">
{% if Category.id == 2 %}
お仏壇・ステージ
{% elseif Category.id == 3 %}
仏具・日用品
{% else %}
{{Category.name}}
{% endif %}
</h1>
{% for category_description in category_descriptions %}
{% if Category.id == category_description.id %}
<p class="text-2xl font-extralight md:text-sm tracking-[2px]">{{category_description.description}}</p>
{% endif %}
{% endfor %}
{% endif %}
</div>
</div>
{# 商品一覧 #}
<div class="w-full max-w-[1120px] mx-auto xl:px-7">
<ul class="gap-4 md:gap-3 grid grid-cols-4 md:grid-cols-2 font-extralight">
{% set category_length = Category.getChildren|length %}
{# MEMO: isParentは中カテゴリの場合、trueとなる #}
{% set isParent = Category.Parent is not null %}
<a
{% if isParent %}
href="{{ url('product_list', {'category_id': Category.Parent.id}) }}"
{% else %}
href="{{ url('product_list', {'category_id': Category.id}) }}"
{% endif %}>
<li class="tabs w-full max-w-[calc(100%÷{{ category_length + 1 }})] border-[#E2DFD6] border hover:opacity-70 duration-700 py-3 md:text-sm rounded text-center {% if category_id in parent_category_ids %} bg-[#E2DFD6] {% endif %}">すべて</li>
</a>
{% set childCategories = isParent ? Category.Parent.Children : Category.Children %}
{% for category in childCategories %}
<a href="{{ url('product_list', {'category_id': category.id}) }}">
<li class="tabs w-full max-w-[calc(100%÷{{ category_length + 1 }})] border-[#E2DFD6] border hover:opacity-70 duration-700 py-3 md:text-sm rounded text-center {% if category.id == category_id %} bg-[#E2DFD6] {% else %} bg-white {% endif %}">
{{category.name}}
</li>
</a>
{% endfor %}
</ul>
<div class="tab-content">
<ul class="flex gap-8 grid grid-cols-3 lg:grid-cols-2 justify-center mt-16 md:mt-8 md:gap-4 md:px-0 mx-0 mx-auto">
{% for Product in pagination %}
<li class="w-full shadow-lg hover:opacity-70 duration-700 lg:w-full h-auto">
<a href="{{ url('product_detail', {'id': Product.id}) }}" class="flex flex-col h-full">
<div>
<img src="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}" alt="{{ Product.name }}" class="w-full h-[350px] md:h-[150px]">
<div class="px-8 py-6 md:p-3 bg-white min-h-[292px] md:min-h-[195px] h-auto">
<div class="min-h-10 flex flex-col items-center justify-end h-auto">
<p class="text-sm text-center md:text-[10px] h-auto tracking-[0.1em] mb-1 flex mt-auto min-h-5">
{% if Product.name_kana %}
{{ Product.name_kana }}
{% endif %}
</p>
<p class="text-2xl text-center md:text-sm tracking-[0.1em]">{{ Product.name }}</p>
</div>
{# カテゴリ #}
<p class="mx-auto w-fit px-3 whitespacenowrap text-sm py-1 border border-[#AFAFAF] text-center md:text-[8px] mt-3 mb-1 leading-normal">
{% if Category.id == 2 %}
お仏壇・ステージ
{% elseif Category.id == 3 %}
仏具・日用品
{% else %}
{{Category.name}}
{% endif %}
</p>
{# カラーコード #}
<div class="flex item-center flex-wrap justify-center gap-2 py-3">
{% for ProductClass in Product.ProductClasses %}
{# MEMO: Tailwindのbgクラスで変数展開ができなかった為、style属性を使ってスタイリングした #}
<span style="background-color: {{ ProductClass.color_code }};" class="w-4 h-4 rounded-[50%] md:w-2 md:h-2"></span>
{% endfor %}
</div>
<div>
{# 商品説明(一覧) #}
{% if Product.description_detail %}
<p class="text-center mb-4 md:text-xs md:mb-2 min-h-12 md:min-h-8 leading-normal tracking-[0.1em]">{{ Product.description_detail|raw|nl2br }}</p>
{% endif %}
{# 値段 #}
<p class="text-2xl text-center md:text-sm md:min-h-10 h-auto tracking-[0.1em]">
{% 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 %}
<span class="text-xs md:text-[10px]">円(税込)</span>
</p>
</div>
</div>
</div>
{# フリーエリア #}
{% if Product.free_area %}
<p class="free_area text-center px-10 py-3 bg-manakaBeige tracking-[0.2em] md:text-[10px] md:px-2 md:py-2 flex items-center justify-center mt-auto min-h-[72px]">
{{Product.free_area|raw|nl2br}}
</p>
{% endif %}
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
{# ショールームのご案内 #}
<a href={{url( "user_data", { route : "showroom" })}} class="block my-16 mx-auto w-[840px] lg:w-[calc(100%-60px)] hover h-auto">
<img src="{{ asset('assets/img/list/showroom_pc.jpg') }}" class="shadow-lg lg:hidden"/>
<img src="{{ asset('assets/img/list/showroom_sp.jpg') }}" class="hidden lg:block max-h-[300px] shadow-lg mx-auto"/>
</a>
{# 商品選びサポートサービス #}
<div class="flex flex-col gap-10 md:gap-8 py-20 px-[104px] bg-manakaBeige w-full max-w-[1120px] xl:w-[calc(100%-60px)] mx-auto lg:px-5 lg:py-8">
<h3 class="text-[40px] text-center md:text-xl font-extralight">商品選びサポートサービス</h3>
<p class="text-xl text-center md:text-xs leading-relaxed">
お客様と故人様の関係にふさわしい祈りのかたちを見つけていただくために、<br/>
いくつかのサポートサービスをご用意しました。
</p>
<ul class="w-full flex gap-12 flex-wrap justify-center md:gap-5">
<li class="w-[432px] xl:w-full hover">
<a href={{url( "user_data", { route : "catalog" })}} class="w-full">
<img src="{{ asset('assets/img/top/catalog-service.webp') }}" class="w-full"/>
</a>
</li>
<li class="w-[432px] xl:w-full hover">
<a href={{url('coordinate_confirm')}} class="w-full">
<img src="{{ asset('assets/img/top/coordinate-service.webp') }}" class="w-full"/>
</a>
</li>
<li class="w-[432px] xl:w-full hover">
<a href={{url("user_data", {route:"pick_up_altar"})}} class="w-full">
<img src="{{ asset('assets/img/top/takuover-service.webp') }}" class="w-full"/>
</a>
</li>
</ul>
</div>
{% endif %}
{% set breadcrumbs = [{'name': subtitle }] %}
{{ include('Block/breadcrumbs.twig') }}
{% endblock %}