{#
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.
#}
{% block stylesheet %}
<style>
.search-menu {
background: #FFE8F2;
width: 100%;
height: 100vh;
position: fixed;
top: 0;
left: 0;
z-index: 99999;
overflow-y: auto;
padding: 1.2em;
box-sizing: border-box;
font-family: sans-serif;
}
.search-menu__header {
display: flex;
justify-content: flex-start;
align-items: center;
}
.close-btn {
background: none;
border: none;
font-size: 1.2em;
color: black;
text-align: center;
font-weight: bold;
}
.close-btn span {
font-size: 0.7em;
display: block;
}
.search-menu__title {
text-align: center;
font-size: 0.9em;
margin: 0.5em 0 1em;
color: #C60D69;
}
.search-menu__subtitle {
font-size: 0.8em;
text-align: center;
margin-top: 1.2em;
font-style: italic;
color: #black;
}
.input-text {
width: 100%;
padding: 0.7em;
margin-bottom: 1em;
border-radius: 5px;
border: none;
font-size: 1em;
box-sizing: border-box;
}
.form-group {
display: flex;
align-items: center;
margin-bottom: 0.8em;
}
.label-box {
background-color: #FC7CB3;
padding: 0.4em 0.8em;
border-radius: 3px;
font-size: 0.8em;
font-style: italic;
margin-right: 0.5em;
white-space: nowrap;
color: #444;
}
.select-box {
flex: 1;
padding: 0.5em;
border: none;
border-radius: 4px;
font-size: 1em;
}
.search-menu__buttons {
display: flex;
justify-content: space-between;
margin-top: 1.5em;
}
.btn-reset {
background: white;
border: 1px solid #aaa;
padding: 0.5em 1.2em;
border-radius: 5px;
font-weight: bold;
}
.btn-search {
background: #C60D69;
color: white;
border: none;
padding: 0.5em 2em;
border-radius: 5px;
font-weight: bold;
}
</style>
{% endblock %}
{% block javascript %}
<script>
var makers = {{ global_makers|map(m => {'id': m.id, 'name': m.name})|json_encode|raw }};
</script>
<script>
$(function () {
let select = $('#makerSelect'); // id="makerSelect" をターゲット
if (typeof makers !== 'undefined') {
makers.forEach(function (m) {
select.append($('<option>', { value: m.id, text: m.name }));
});
// URLパラメータ維持
const params = new URLSearchParams(window.location.search);
if (params.has('maker_id')) {
select.val(params.get('maker_id'));
}
}
$('#searchMenu').hide();
$('#openSearchMenu').on('click', function () {
$('#searchMenu').fadeIn();
});
$('#closeSearchMenu').on('click', function () {
$('#searchMenu').fadeOut();
});
});
</script>
{% endblock %}
<div class="ec-footerRole">
<div class="ec-footerRole__top"></div>
<div class="ec-footerRole__inner">
<div class="ec-footerTitle__logo">
<a href="{{ url('homepage') }}">
<img src="{{ asset('assets/img/new/img_logo.png') }}" alt="logo" />
</a>
</div>
</div>
</div>
<div class="ec-footerRoleSP">
<ul>
<li>
<div id="openSearchMenu" class="ec-footerRoleSP_navi before-search">検索</div>
</li>
<li>
<a href="{{ url('cart') }}" class="ec-footerRoleSP_navi before-cart">カート</a>
</li>
<li>
<a href="{{ url('mypage_favorite') }}" class="ec-footerRoleSP_navi before-favorite">お気に入り</a>
</li>
<li>
<a href="{{ url('mypage') }}" class="ec-footerRoleSP_navi before-history">注文履歴</a>
</li>
<li>
<a href="{{ url('mypage') }}" class="ec-footerRoleSP_navi before-user">マイページ</a>
</li>
</ul>
</div>
<div id="searchMenu" class="search-menu" style="display: none;">
<div class="search-menu__header">
<button id="closeSearchMenu" class="close-btn">✕<br><span>CLOSE</span></button>
</div>
<div class="search-menu__body">
<p class="search-menu__title">検索メニュー</p>
<form method="get" class="searchform" action="{{ path('product_list') }}">
<input type="text" name="keyword" class="input-text" placeholder="フリーワード" />
<div class="form-group">
<label class="label-box">入荷日</label>
<input type="date" name="date" value="" class="select-box">
</div>
<div class="form-group">
<label class="label-box">メーカー</label>
<select name="maker_id" class="select-box" id="makerSelect">
<option value="">すべてのメーカー</option>
{# オプションはサーバ側でGET受信して処理 #}
</select>
</div>
<div class="search-menu__buttons">
<button type="reset" class="btn-reset">リセット</button>
<button type="submit" class="btn-search">検索</button>
</div>
</form>
</div>
</div>