{% extends '@user_data/layout/default_frame.twig' %}
{% block title %}
納期・発送日確認 | オリジナル缶バッジ/カンバッチ製作【個人小ロットから業務用OEMまで激安印刷】ZEAMI Goods
{% endblock %}
{% block js %}
{# https://www.npmjs.com/package/japanese-holidays #}
<script src="{{ asset('assets/js/holiday_calender.js') }}" type="text/javascript"></script>
<script>
document.addEventListener('DOMContentLoaded', async (event) => {
const today = new Date();
const year = today.getFullYear();
const month = today.getMonth();
const date = today.getDate();
const firstDayOfMonth = new Date(year, month, 1).getDay();
const lastDateOfMonth = new Date(year, month + 1, 0).getDate();
const lastDayOfMonth = new Date(year, month, lastDateOfMonth).getDay();
const lastDateOfPreviousMonth = new Date(year, month, 0).getDate();
const calendarMonth = document.querySelector('.calender_month');
const calendarTable = document.querySelector('.calender_table tbody');
const workingtimes = {{ workingtimes|json_encode|raw }};
const months = [
"1月",
"2月",
"3月",
"4月",
"5月",
"6月",
"7月",
"8月",
"9月",
"10月",
"11月",
"12月"
];
calendarMonth.textContent = `${year}年${
months[month]
}`;
let calendarHTML = '';
let dateCounter = 1;
let nextMonthDateCounter = 1;
for (let row = 0; row < 6; row++) {
calendarHTML += '<tr class="date">';
for (let day = 0; day < 7; day++) {
if (row === 0 && day < firstDayOfMonth) {
calendarHTML += `<td class="other_month">${
lastDateOfPreviousMonth - firstDayOfMonth + day + 1
}</td>`;
} else if (dateCounter > lastDateOfMonth) {
calendarHTML += `<td class="other_month">${nextMonthDateCounter}</td>`;
nextMonthDateCounter++;
} else {
let className = '';
if (day === 0 || day === 6) {
className = 'rest';
}
if (dateCounter === date && month === today.getMonth() && year === today.getFullYear()) {
className = 'active';
}
const time = new Date(`${year}-${month + 1}-${dateCounter}`);
const holiday = JapaneseHolidays.isHoliday(time);
if (holiday) {
className = 'holiday';
}
let current_date = `${year}-${month + 1}-${dateCounter}`;
for(let i = 0; i < workingtimes.length; i++) {
if((workingtimes[i]['date'].replace('-0', '-') == current_date) && workingtimes[i]['status']) {
className = 'holiday';
} else if((workingtimes[i]['date'].replace('-0', '-') == current_date )&& !workingtimes[i]['status']) {
className = 'working'
}
}
calendarHTML += `<td class="${className}">${dateCounter}</td>`;
dateCounter++;
}
}
calendarHTML += '</tr>';
}
await calendarTable.insertAdjacentHTML('beforeend', calendarHTML);
});
document.addEventListener('DOMContentLoaded', async (event) => {
const today = new Date();
const year = today.getFullYear();
const month = today.getMonth() + 1;
const date = today.getDate();
const firstDayOfMonth = new Date(year, month, 1).getDay();
const lastDateOfMonth = new Date(year, month + 1, 0).getDate();
const lastDayOfMonth = new Date(year, month, lastDateOfMonth).getDay();
const lastDateOfPreviousMonth = new Date(year, month, 0).getDate();
const calendarMonth = document.querySelector('.calender_next_month');
const calendarTable = document.querySelector('.calender_next_table tbody');
const workingtimes = {{ workingtimes|json_encode|raw }};
const months = [
"1月",
"2月",
"3月",
"4月",
"5月",
"6月",
"7月",
"8月",
"9月",
"10月",
"11月",
"12月"
];
calendarMonth.textContent = month == 12 ? `${year + 1}年${months[0]}` : `${year}年${months[month]}`;
let calendarHTML = '';
let dateCounter = 1;
let nextMonthDateCounter = 1;
for (let row = 0; row < 6; row++) {
calendarHTML += '<tr class="date">';
for (let day = 0; day < 7; day++) {
if (row === 0 && day < firstDayOfMonth) {
calendarHTML += `<td class="other_month">${lastDateOfPreviousMonth - firstDayOfMonth + day + 1}</td>`;
} else if (dateCounter > lastDateOfMonth) {
calendarHTML += `<td class="other_month">${nextMonthDateCounter}</td>`;
nextMonthDateCounter++;
} else {
let className = '';
if (day === 0 || day === 6) {
className = 'rest';
}
if (dateCounter === date && month === today.getMonth() && year === today.getFullYear()) {
className = 'active';
}
const time = month == 12 ? new Date(`${year + 1}-${1}-${dateCounter}`): new Date(`${year}-${month + 1}-${dateCounter}`);
const holiday = JapaneseHolidays.isHoliday(time);
if (holiday) {
className = 'holiday';
}
let current_date = `${year}-${month + 1}-${dateCounter}`;
for(let i = 0; i < workingtimes.length; i++) {
if((workingtimes[i]['date'].replace('-0', '-') == current_date) && workingtimes[i]['status']) {
className = 'holiday';
} else if((workingtimes[i]['date'].replace('-0', '-') == current_date )&& !workingtimes[i]['status']) {
className = 'working'
}
}
calendarHTML += `<td class="${className}">${dateCounter}</td>`;
dateCounter++;
}
}
calendarHTML += '</tr>';
}
calendarTable.insertAdjacentHTML('beforeend', calendarHTML);
const now = new Date();
const checkHoliday = checkIsHoliday(now, workingtimes);
if(checkHoliday) {
$('.working-time').hide();
$('.holiday-time').show();
} else {
$('.holiday-time').hide();
$('.working-time').show();
}
if(checkHoliday) {
let nextBusiness = null;
do {
now.setDate(now.getDate() + 1);
nextBusiness = now;
} while (checkIsHoliday(now, workingtimes));
$('.holiday-time').text('翌営業日『' + formatDateJP(nextBusiness) + '』ご注文確定の場合、下記日程で発送いたします。')
}
});
function checkIsHoliday(date, workingtimes) {
date = formatDate(date);
const now_time = new Date(date);
const holiday = JapaneseHolidays.isHoliday(now_time);
let check = false;
if(holiday) {
check = true;
} else {
check = false;
}
for(let i = 0; i < workingtimes.length; i++) {
if((workingtimes[i]['date'] == date) && workingtimes[i]['status']) {
check = true;
} else if((workingtimes[i]['date'] == date )&& !workingtimes[i]['status']) {
check = false;
}
}
return check;
}
function formatTimeDelivery(totalDay) {
const workingtimes = {{ workingtimes|json_encode|raw }};
let working_time = [];
let holiday_time = [];
for(let i = 0; i < workingtimes.length; i++) {
if(workingtimes[i].status) {
holiday_time.push(workingtimes[i].date);
} else {
working_time.push(workingtimes[i].date);
}
}
const now = new Date();
now.setDate(now.getDate() + 1);
let index = 0;
for(let i = 0; i < totalDay; i++) {
const holiday = JapaneseHolidays.isHoliday(now);
if(holiday || now.getDay() == 6 || now.getDay() == 0) {
if(!working_time.includes(formatDate(now))) {
index++;
}
}
if(holiday_time.includes(formatDate(now))) {
index++;
}
now.setDate(now.getDate() + 1);
}
while((JapaneseHolidays.isHoliday(now) || now.getDay() == 6 || now.getDay() == 0 || holiday_time.includes(formatDate(now))) && !working_time.includes(formatDate(now))) {
now.setDate(now.getDate() + 1);
}
now.setDate(now.getDate() + index);
while((JapaneseHolidays.isHoliday(now) || now.getDay() == 6 || now.getDay() == 0 || holiday_time.includes(formatDate(now))) && !working_time.includes(formatDate(now))) {
now.setDate(now.getDate() + 1);
}
return formatDateJP(now);
}
function formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
function formatDateJP(time) {
const daysOfWeek = ['日', '月', '火', '水', '木', '金', '土'];
const year = time.getFullYear();
const month = time.getMonth() + 1;
const day = time.getDate();
const dayOfWeek = time.getDay();
return `${year}年${month}月${day}日(${daysOfWeek[dayOfWeek]})`;
}
</script>
<script>
$(document).ready(function () {
$('input[type=radio][name=category]').change(function () {
let cate = this.value;
const admin_router = "{{ eccube_config.eccube_admin_route }}";
$.ajax({
url: `/category-products/` + cate,
dataType: 'json', // added data type
success: function (res) {
$('.product-block').show();
let html = '';
for (let i = 0; i < res.products.length; i++) {
html += `
<li class="type_check up moveup">
<label style="display: flex !important"><input type="radio" onchange="handleProductChange(this)" name="product" value="${res.products[i].id}" class="form_check"/>
<span></span>
<div style="text-wrap: wrap;width: 60%;">${res.products[i].name}</div>
</label>
</li>
`;
}
$('.product-list').html(html);
}
});
});
});
function handleProductChange(radio) {
var selectedProductId = radio.value;
$.ajax({
url: `/get_delivery/`+selectedProductId,
dataType: 'json', // added data type
success: function (res) {
$('.add_line').remove();
$('.delivery_confirm').show();
let html = '';
for (let i = 0; i < res.data.length; i++) {
html += `
<tr class="add_line">
<td class="table_headline">
<p>${res.data[i].quantity}</p>
</td>
`;
for(let j = 0; j < res.data[i].options.length; j++) {
if(res.data[i].options[j].deliverty_time == '0') {
html += `
<td>
<p class="delivery_date" style="min-width: 50px">-</p>
</td>
`;
} else {
html += `
<td>
<p class="delivery_date">${res.data[i].options[j].deliverty_time}営業日後発送</p><br>${formatTimeDelivery(res.data[i].options[j].deliverty_time)}
</td>
`;
}
}
html += `
</tr>
`;
}
$('#root-table').after(html);
}
});
}
async function checkStatusDate(date) {
return new Promise((resolve, reject) => {
$.ajax({
url: "{{ url('workingtime_check_status') }}",
method: 'POST',
data: {
date: date,
},
dataType: 'json',
success: function(res) {
resolve(res.result);
},
error: function(err) {
reject(err);
}
});
});
}
</script>
{% endblock %}
{% block content %}
<!-- // ++ パンクズ ++ //////////////////////////////////////////////////////////// // -->
<div id="bread_crumbBloc" class="fades">
<ul id="breadCrumb" class="fades">
<li class="up">
<a href="/"><img src="{{ asset('assets/img/icon_home.png') }}" alt="ホーム"></a>
</li>
<li class="up">納期・発送日確認</li>
</ul>
<!-- ///// #breadCrumb +++++ ///// -->
<!-- ///// +++++ #bread_crumbBloc +++++ ///// -->
</div>
<!-- ▼▼ MAIN CONTENTS __________________________________________________________________________________________________ ▼▼ -->
<main
id="mainContents" class="">
<!-- // == MAIN ================================================================================ // -->
<section
id="Confirm" class="section_basic full">
<!-- // ++ ページタイトル ++ /////////////////////////////////////////////////////////////// -->
<div id="section_titleBloc" class="fades twolayout_body">
<div id="title_twoLayout">
<h3 class="section_title up">納期・発送日確認</h3>
<p class="title_cap up">ご注文確定の日より、当店から出荷の日をご確認いただけます</p>
<p class="section_note up">デザイン決定後、ご決済いただき次第ご注文確定となります。個人のお客様で銀行振込をご選択の場合、ご入金を確認次第ご注文確定となりますのでご注意ください。
ヤマト運輸をご選択の場合、到着時間帯をご指定可能です。(午前中、14~16時、16~18時、18~20時、19~21時)<br>
日本国外発送可能 International delivery</p>
</div>
<!-- //// ++++ #title_twoLayout ++++ //// -->
<figure id="titlePic" class="two_layout"><img src="{{ asset('assets/img/delivery/confirm_title_pic.jpg') }}"></figure>
<!-- ///// #section_titleBloc +++++ ///// -->
</div>
<!-- // ++ 営業日カレンダー ++ /////////////////////////////////////////////////////////////// -->
<div id="Calender" class="one_box fades">
<div
class="calender_inner">
<!-- // △△ 見出し ++ △△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△ -->
<dl id="calender_titleArea" class="fades">
<dt>
<h4 id="calenderHeadline" class="up">
<span>営業日カレンダー</span>
</h4>
</dt>
<dd>
<span id="markClosed" class="up"><img src="{{ asset('assets/img/mark_closed.jpg') }}"></span>休業日</dd>
<!-- //// ++++ #calender_titleArea ++++ //// -->
</dl>
<!-- // △△ カレンダー ++ △△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△ -->
<ul
id="calenderList">
<!-- ■■ ++ ONE CALENDER ++ ■■ -->
<li class="one_calender">
<h5 class="calender_month">2024年xx月</h5>
<table class="calender_table">
<tbody>
<tr class="title_week">
<th>日</th>
<th>月</th>
<th>火</th>
<th>水</th>
<th>木</th>
<th>金</th>
<th>土</th>
</tr>
</tbody>
</table>
<!-- /// *** .calender_table *** /// -->
</li>
<!-- //// .one_calender **** //// -->
<!-- ■■ ++ ONE CALENDER ++ ■■ -->
<li class="one_calender">
<h5 class="calender_month calender_next_month">2024年xx月</h5>
<table class="calender_table calender_next_table">
<tbody>
<tr class="title_week">
<th>日</th>
<th>月</th>
<th>火</th>
<th>水</th>
<th>木</th>
<th>金</th>
<th>土</th>
</tr>
</tbody>
</table>
<!-- /// *** .calender_table *** /// -->
</li>
<!-- //// .one_calender **** //// -->
<!-- //// ++++ #calender_titleArea ++++ //// -->
</ul>
</div>
</div>
<!-- ///// #Calender +++++ ///// -->
<!-- // ++ 発送日確認 ++ /////////////////////////////////////////////////////////////// -->
<div id="Delivery" class="one_box fades">
<form
action="" class="input_content">
<!-- // △△ カテゴリ ++ △△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△ -->
<h3 class="section_title up">カテゴリを選択してください</h3>
<ul id="detail_checkList" class="confirm fades">
{% for category in categories %}
<!-- ☆☆ ++ ステッカー ++ ☆☆ -->
<li class="type_check up">
<label><input type="radio" name="category" value="{{ category.id }}" class="form_check"/>
<span>{{category.name}}</span>
</label>
</li>
{% endfor %}
</ul>
<!-- //// ++++ .detail_checkList ++++ //// -->
<!-- // △△ 商品 ++ △△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△ -->
<h3 class="section_title up product-block" style="display: none">商品を選択してください</h3>
<ul id="detail_checkList" class="product-block product-list confirm fades" style="display: none">
</ul>
<!-- //// ++++ .detail_checkList ++++ //// -->
<!-- // △△ 発送日確認 ++ △△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△ -->
{% set days = {'Mon': '月', 'Tue': '火', 'Wed': '水', 'Thu': '木', 'Fri': '金', 'Sat': '土', 'Sun': '日'} %}
{% set bussiness_day = "now"|date("D") %}
<div class="delivery_confirm" style="display: none">
<h3 class="section_title up">発送日確認
<p class="section_note up working-time">本日{{ "now"|date("Y年n月j日") }}({{ days[bussiness_day] }})』ご注文確定の場合、下記日程で発送いたします。</p>
<p class="section_note up holiday-time"></p>
</h3>
<div id="tableBox" class="confirm fades">
<table cellpadding="0" cellspacing="0" id="cart_indexTable" class="confirm fades">
<tbody>
<tr id="root-table">
<th class="order_num">
<p>枚数</p>
</th>
<th>
<p>最安値</p>
</th>
<th class="line" colspan="3">
<span></span>
</th>
<th>
<p>最短納期</p>
</th>
</tr>
</tbody>
</table>
<!-- //// ++++ #cart_indexTable ++++ //// -->
<!-- //// ++++ #tableBox ++++ //// -->
</div>
<div class="table_info up">
<span>大口注文はメールでお問い合わせください</span>
</div>
</div>
<!-- //// .table_info **** //// -->
{% if data.product is defined %}
<a href="{{ url('detail_product', {id: data.product.id}) }}" style="text-decoration: none">
<div id="btnSubmit" class="up"><input style="submit" name="submit" value="商品ページへ" class="btn_submit"></div>
</a>
{% endif %}
<!-- // △△ データ作成上のご注意 ++ △△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△ -->
<aside class="one_box caution_box fades">
<div class="caution_inner">
<h5 class="caution_title up">データ作成上のご注意</h5>
<p class="indent up">◯悪天候・天災及び年末年始は物流の混雑や交通渋滞の影響により1日程度の遅れが生じることがあります。</p>
<p class="indent up">◯配送遅延につきましては当店では一切の責任を負いかねますのであらかじめご了承ください。</p>
<!-- // ** .caution_box ** // -->
</div>
</aside>
</form>
</div>
<!-- ///// #Delivery +++++ ///// -->
<!-- // ++ 店頭引取について ++ /////////////////////////////////////////////////////////////// -->
<dl id="Store" class="one_box">
<dt id="storeLeft">
<article class="one_group">
<h3 class="section_title up">店頭引取について</h3>
<h4 class="guide_headline fades">本社/FACTO_OSAKA [大阪・江坂]</h4>
<p class="flow_notes indent up">◯ 商品お受取時店頭支払(現金・クレジットカード・PayPay・au PAY)</p>
<p class="flow_notes indent up">◯ 店頭引取をご希望の場合は、完成予定日の翌営業日11時からお引取可能。事前のご予約にご協力ください</p>
<!-- //// **** .one_group **** //// -->
</article>
<article class="one_group">
<h4 class="guide_headline fades">アクセスマップ</h4>
<p class="flow_notes up">〒564-0051 大阪府吹田市豊津町21-10 クルーズ江坂第二ビル2F<br>
<span class="nolink">tel 06-6384-8422</span><br>
営業時間:11:00〜18:00</p>
<!-- //// **** .one_group **** //// -->
</article>
</dt>
<!-- //// +++ #storeLeft ++++ //// -->
<dd id="storeRight">
<figure id="payment-accessMap" class="up">
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3277.868877398006!2d135.4902870757471!3d34.75889572289904!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x6000e5b6f9ba168b%3A0x3185ef8a686677c2!2sFACTO_OSAKA!5e0!3m2!1sja!2sjp!4v1713609119019!5m2!1sja!2sjp" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
<!-- //// #payment-accessMap ++++ //// -->
</figure>
</dd>
<!-- //// +++ #storeRight ++++ //// -->
<!-- ///// #Store +++++ ///// -->
</dl>
</section>
<!-- ///// +++++ #Delivery +++++ ///// -->
<!-- ///// +++++ #mainContents +++++ ///// -->
</main>
<!-- // ++ パンクズ ++ //////////////////////////////////////////////////////////// // -->
<div id="bread_crumbBloc" class="fades">
<ul id="breadCrumb" class="fades">
<li class="up">
<a href="/"><img src="{{ asset('assets/img/icon_home.png') }}" alt="ホーム"></a>
</li>
<li class="up">納期・発送日確認</li>
</ul>
<!-- ///// #breadCrumb +++++ ///// -->
<!-- ///// +++++ #bread_crumbBloc +++++ ///// -->
</div>
{% endblock %}