{#
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 stylesheet %}
<style>
.slick-slider {
margin-bottom: 10px;
margin-top: -20px;
}
.slick-dots {
position: absolute;
bottom: -45px;
display: block;
width: 100%;
padding: 0;
list-style: none;
text-align: center;
}
.slick-dots li {
position: relative;
display: inline-block;
width: 20px;
height: 20px;
margin: 0 5px;
padding: 0;
cursor: pointer;
}
.slick-dots li button {
font-size: 0;
line-height: 0;
display: block;
width: 20px;
height: 20px;
padding: 5px;
cursor: pointer;
color: transparent;
border: 0;
outline: none;
background: transparent;
}
.slick-dots li button:hover,
.slick-dots li button:focus {
outline: none;
}
.slick-dots li button:hover:before,
.slick-dots li button:focus:before {
opacity: 1;
}
.slick-dots li button:before {
content: " ";
line-height: 20px;
position: absolute;
top: 0;
left: 0;
width: 12px;
height: 12px;
text-align: center;
opacity: .25;
background-color: black;
border-radius: 50%;
}
.slick-dots li.slick-active button:before {
opacity: .75;
background-color: black;
}
.slick-dots li button.thumbnail img {
width: 0;
height: 0;
}
</style>
<link rel="stylesheet" href="/html/user_data/js/style.css">
<link rel="stylesheet" href="/html/plugins/icheck-bootstrap/icheck-bootstrap.min.css">
<style>
/* ============================================
商品詳細グリッド: 画像50% / 内容50%(均等)
============================================ */
@media (min-width: 768px) {
body.product_page .ec-grid2 {
display: flex;
align-items: flex-start;
}
body.product_page .ec-grid2 .ec-grid2__cell {
width: 50%;
flex: 0 0 50%;
min-width: 0;
}
body.product_page .ec-grid2 .ec-grid2__cell2 {
width: 50%;
flex: 0 0 50%;
min-width: 0;
}
}
/* ============================================
商品説明欄内のHTMLが画面幅を突き抜けないように
============================================ */
body.product_page .ec-productRole__description {
min-width: 0;
overflow-wrap: break-word;
word-break: break-word;
}
body.product_page .ec-productRole__description img,
body.product_page .ec-productRole__description table,
body.product_page .ec-productRole__description iframe,
body.product_page .ec-productRole__description video {
max-width: 100% !important;
height: auto;
}
body.product_page .ec-productRole__description table {
display: block;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
/* ============================================
スマホ用 見積金額 下部固定バー
============================================ */
#sp-mitsumori-bar {
display: none;
}
/* ============================================
商品タイプ選択 共通スタイル
============================================ */
/* セクションラベル */
.rp-section-label {
font-size: 14px;
font-weight: bold;
color: #333;
margin-bottom: 10px;
}
.rp-section-label span {
font-weight: normal;
color: #c00;
}
/* ---- 1. 画像付きカード ---- */
.rp-card-group {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 4px;
}
.rp-card {
position: relative;
cursor: pointer;
width: 110px;
border: 2px solid #ddd;
border-radius: 10px;
overflow: hidden;
transition: border-color 0.2s, box-shadow 0.2s;
background: #fff;
}
.rp-card:hover {
border-color: #999;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.rp-card.is-selected {
border-color: #1a6fcf;
box-shadow: 0 2px 10px rgba(26,111,207,0.25);
}
.rp-card input[type="radio"] { display: none; }
.rp-card__image {
width: 100%;
aspect-ratio: 1 / 1;
object-fit: cover;
display: block;
background: #f5f5f5;
}
.rp-card__placeholder {
width: 100%;
aspect-ratio: 1 / 1;
background: #f0f0f0;
display: flex;
align-items: center;
justify-content: center;
color: #bbb;
font-size: 24px;
}
.rp-card__name {
display: block;
padding: 5px 5px;
font-size: 11px;
color: #333;
text-align: center;
line-height: 1.4;
word-break: break-all;
}
.rp-card.is-selected .rp-card__name { color: #1a6fcf; font-weight: bold; }
.rp-card.is-selected::after {
content: "✓";
position: absolute;
top: 3px; right: 6px;
color: #1a6fcf;
font-size: 13px;
font-weight: bold;
}
/* ---- 2. ボタン式ラジオ(画像なし・8個以内)---- */
.rp-btn-group {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 4px;
max-width: 100%;
min-width: 0;
}
.rp-btn {
cursor: pointer;
padding: 8px 14px;
border: 2px solid #ddd;
border-radius: 10px;
font-size: 13px;
color: #333;
background: #fff;
transition: border-color 0.2s, background 0.2s;
white-space: nowrap;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
}
.rp-btn:hover { border-color: #999; }
.rp-btn.is-selected {
border-color: #1a6fcf;
color: #1a6fcf;
font-weight: bold;
background: #f0f6ff;
}
.rp-btn input[type="radio"] { display: none; }
/* ---- ボタン群が3行以上になる場合は1行横スクロール ---- */
.rp-btn-group.is-scroll,
.opt-btn-group.is-scroll {
flex-wrap: nowrap;
overflow-x: auto;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
scrollbar-width: thin;
padding-bottom: 6px;
}
.rp-btn-group.is-scroll::-webkit-scrollbar,
.opt-btn-group.is-scroll::-webkit-scrollbar {
height: 6px;
}
.rp-btn-group.is-scroll::-webkit-scrollbar-thumb,
.opt-btn-group.is-scroll::-webkit-scrollbar-thumb {
background: #c0c0c0;
border-radius: 3px;
}
.rp-btn-group.is-scroll > .rp-btn,
.opt-btn-group.is-scroll > .opt-btn {
flex: 0 0 auto;
}
/* ---- 3. プルダウン(画像なし・9個以上)---- */
.rp-select-wrap {
margin-bottom: 4px;
}
.rp-select {
width: 100%;
max-width: 420px;
padding: 8px 12px;
border: 2px solid #ddd;
border-radius: 10px;
font-size: 13px;
color: #333;
background: #fff;
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 12px center;
cursor: pointer;
}
.rp-select:focus {
outline: none;
border-color: #1a6fcf;
}
/* ---- オプション選択ボタン(枠線ラジオ)---- */
.opt-btn-group {
display: flex;
flex-wrap: wrap;
gap: 8px;
padding: 6px 0;
max-width: 100%;
min-width: 0;
}
.opt-btn {
cursor: pointer;
padding: 7px 14px;
border: 2px solid #ddd;
border-radius: 10px;
font-size: 13px;
color: #333;
background: #fff;
transition: border-color 0.2s, background 0.2s;
white-space: nowrap;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
}
.opt-btn:hover { border-color: #999; }
.opt-btn.is-selected {
border-color: #1a6fcf;
color: #1a6fcf;
font-weight: bold;
background: #f0f6ff;
}
.opt-btn input[type="radio"] { display: none; }
/* ============================================
施工エリア案内
============================================ */
.ec-areaNotice {
margin: 16px 0;
padding: 16px 20px;
background: #f8f9fa;
border-left: 4px solid #1a6fcf;
border-radius: 0 8px 8px 0;
}
.ec-areaNotice__inner {
display: flex;
align-items: flex-start;
gap: 12px;
}
.ec-areaNotice__icon {
font-size: 22px;
line-height: 1;
flex-shrink: 0;
margin-top: 2px;
}
.ec-areaNotice__body {
flex: 1;
}
.ec-areaNotice__title {
font-size: 13px;
font-weight: bold;
color: #1a6fcf;
margin: 0 0 6px;
}
.ec-areaNotice__text {
font-size: 13px;
color: #444;
line-height: 1.7;
margin: 0;
}
.ec-areaNotice__text strong {
color: #222;
}
.ec-areaNotice__link {
display: inline-block;
margin-top: 8px;
font-size: 12px;
color: #1a6fcf;
text-decoration: underline;
}
.ec-areaNotice__link:hover {
color: #0d4fa0;
}
/* ============================================
SNSシェア + ブランド名 タイトル行
============================================ */
.ec-productRole__titleRow {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
margin-bottom: 4px;
}
.ec-productRole__titleRow .ec-headingTitle {
margin: 0;
flex: 1;
font-size: 18px;
}
.ec-share-inline {
display: flex;
align-items: center;
gap: 8px;
flex-shrink: 0;
}
@media (max-width: 767px) {
/* maker_area の float を解除して独立表示 */
#maker_area {
float: none !important;
width: auto !important;
height: auto !important;
display: block;
margin-bottom: 4px;
}
/* タイトル行: 商品名が全幅を占有しSNSは右寄せ下段 */
.ec-productRole__titleRow {
flex-wrap: wrap;
clear: both;
}
.ec-productRole__titleRow .ec-headingTitle {
flex: 1 1 100%;
font-size: 16px;
}
.ec-share-inline {
flex: 0 0 auto;
margin-left: auto;
}
}
.ec-share-inline a {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: 50%;
font-size: 15px;
color: #fff;
text-decoration: none;
transition: opacity 0.2s;
}
.ec-share-inline a:hover { opacity: 0.8; }
.ec-share-inline .share-twitter { background: #000; }
.ec-share-inline .share-facebook { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.ec-share-inline .share-line { background: #06c755; }
/* description_detail下のシェアブロックはPC/スマホ共通で非表示(タイトル行に移動) */
.ec-productRole__share { display: none; }
/* ============================================
PC用: 現在のお見積り額カード強調
============================================ */
@media (min-width: 768px) {
.mitsumori-card-pc {
border: 2px solid #1a6fcf !important;
border-radius: 10px !important;
box-shadow: 0 4px 16px rgba(26,111,207,0.18) !important;
margin-top: 20px;
overflow: hidden;
background: linear-gradient(135deg, #1a6fcf, #0d4fa0) !important;
}
.mitsumori-card-pc .card-header {
background: linear-gradient(135deg, #1a6fcf, #0d4fa0) !important;
color: #fff !important;
padding: 14px 16px !important;
border-bottom: none !important;
}
.mitsumori-card-pc .card-title {
color: #fff !important;
font-size: 15px !important;
font-weight: bold !important;
margin: 0 !important;
}
.mitsumori-card-pc #mitsumori_message {
font-size: 22px !important;
font-weight: bold !important;
color: #fff !important;
}
.mitsumori-card-pc .btn-tool {
color: #fff !important;
}
/* 合計行を大きく強調 */
.mitsumori-card-pc .nav-item:first-child .nav-link {
font-size: 16px !important;
font-weight: bold !important;
color: #c00 !important;
background: #fff8f8 !important;
padding: 12px 16px !important;
}
.mitsumori-card-pc .nav-item:first-child #mitsumori_goukei {
font-size: 20px !important;
font-weight: bold !important;
color: #c00 !important;
}
/* card-body(明細リスト)を白背景に */
.mitsumori-card-pc .card-body {
background: #fff !important;
}
.mitsumori-card-pc .card-footer {
background: #f8faff !important;
border-top: 1px solid #dce8fb !important;
padding: 12px 16px !important;
}
}
@media (max-width: 767px) {
/* スマホでは現在のお見積り額カードの強調スタイルをすべてリセット */
.mitsumori-card-pc {
border: none !important;
border-radius: 0 !important;
box-shadow: none !important;
margin-top: 0 !important;
overflow: visible !important;
background: none !important;
}
.mitsumori-card-pc .card-header {
background: none !important;
color: inherit !important;
padding: inherit !important;
border-bottom: inherit !important;
}
.mitsumori-card-pc .card-title { color: inherit !important; }
.mitsumori-card-pc #mitsumori_message { font-size: inherit !important; color: inherit !important; }
.mitsumori-card-pc .btn-tool { color: inherit !important; }
/* 折りたたみトグルボタン */
.btn-mitsumori-toggle {
background: none !important;
border: 1px solid #aaa !important;
border-radius: 4px !important;
padding: 2px 8px !important;
font-size: 12px !important;
color: #333 !important;
line-height: 1.4 !important;
}
.btn-mitsumori-toggle .toggle-icon {
display: inline-block;
transition: transform 0.2s;
}
/* 展開状態: ▼→▲ */
.card:not(.collapsed-card) .btn-mitsumori-toggle .toggle-icon::before {
content: "▲ 閉じる";
}
.card:not(.collapsed-card) .btn-mitsumori-toggle .toggle-icon {
display: none;
}
.card:not(.collapsed-card) .btn-mitsumori-toggle::after {
content: "▲ 閉じる";
font-size: 12px;
}
.mitsumori-card-pc .nav-item:first-child .nav-link {
font-size: inherit !important;
color: inherit !important;
background: none !important;
padding: inherit !important;
}
.mitsumori-card-pc .nav-item:first-child #mitsumori_goukei {
font-size: inherit !important;
color: inherit !important;
}
.mitsumori-card-pc .card-footer {
background: none !important;
border-top: inherit !important;
padding: inherit !important;
}
/* 横スクロール禁止 */
body, html {
overflow-x: hidden;
max-width: 100vw;
}
/* ボタンの折り返しを許可(nowrapが原因で横スクロール発生するため) */
.opt-btn,
.rp-btn {
white-space: normal;
word-break: break-all;
}
/* エリア案内: スマホでコンパクト */
.ec-areaNotice {
margin: 8px 0;
padding: 8px 10px;
border-left-width: 3px;
cursor: pointer;
}
.ec-areaNotice__inner {
flex-direction: row;
gap: 8px;
align-items: flex-start;
}
.ec-areaNotice__icon { font-size: 15px; }
/* タイトル行: 展開トグル */
.ec-areaNotice__title {
font-size: 11px;
margin-bottom: 3px;
display: flex;
justify-content: space-between;
align-items: center;
}
.ec-areaNotice__title::after {
content: "▼";
font-size: 9px;
color: #888;
margin-left: 6px;
transition: transform 0.2s;
}
.ec-areaNotice.is-open .ec-areaNotice__title::after {
transform: rotate(180deg);
}
/* 折りたたみ対象: 閉じた状態では非表示 */
.ec-areaNotice__detail {
display: none;
}
.ec-areaNotice.is-open .ec-areaNotice__detail {
display: block;
}
.ec-areaNotice__text { font-size: 11px; line-height: 1.5; }
.ec-areaNotice__text br { display: none; }
.ec-areaNotice__link { font-size: 11px; margin-top: 3px; }
.rp-card { width: calc(33.333% - 6px); min-width: 80px; }
#sp-mitsumori-bar {
display: flex;
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 1000;
background: #fff;
border-top: 2px solid #e0e0e0;
box-shadow: 0 -2px 8px rgba(0,0,0,0.12);
align-items: center;
padding: 8px 12px;
gap: 10px;
}
#sp-mitsumori-bar .sp-bar__label {
font-size: 11px;
color: #666;
white-space: nowrap;
}
#sp-mitsumori-bar .sp-bar__price {
font-size: 18px;
font-weight: bold;
color: #c00;
flex: 1;
}
#sp-mitsumori-bar .sp-bar__btn {
font-size: 12px;
padding: 8px 12px;
background: #333;
color: #fff;
border: none;
border-radius: 6px;
white-space: nowrap;
cursor: pointer;
}
/* 下部バーの高さ分ページ下部にpaddingを追加 */
body {
padding-bottom: 64px;
}
}
</style>
{% endblock %}
{% block javascript %}
<script>
eccube.classCategories = {{ class_categories_as_json(Product)|raw }};
// 規格2に選択肢を割り当てる。
function fnSetClassCategories(form, classcat_id2_selected) {
var $form = $(form);
var product_id = $form.find('input[name=product_id]').val();
var $sele1 = $form.find('select[name=classcategory_id1]');
var $sele2 = $form.find('select[name=classcategory_id2]');
eccube.setClassCategories($form, product_id, $sele1, $sele2, classcat_id2_selected);
}
{% if form.classcategory_id2 is defined %}
fnSetClassCategories(
$('#form1'), {{ form.classcategory_id2.vars.value|json_encode|raw }}
);
{% elseif form.classcategory_id1 is defined %}
eccube.checkStock($('#form1'), {{ Product.id }}, {{ form.classcategory_id1.vars.value|json_encode|raw }}, null);
{% endif %}
</script>
<script>
$(function() {
// bfcache無効化
$(window).bind('pageshow', function(event) {
if (event.originalEvent.persisted) {
location.reload(true);
}
});
// Core Web Vital の Cumulative Layout Shift(CLS)対策のため
// img タグに width, height が付与されている.
// 630px 未満の画面サイズでは縦横比が壊れるための対策
// see https://github.com/EC-CUBE/ec-cube/pull/5023
$('.ec-grid2__cell').hide();
var removeSize = function () {
$('.slide-item').height('');
$('.slide-item img')
.removeAttr('width')
.removeAttr('height')
.removeAttr('style');
};
var slickInitial = function(slick) {
$('.ec-grid2__cell').fadeIn(1500);
var baseHeight = $(slick.target).height();
var baseWidth = $(slick.target).width();
var rate = baseWidth / baseHeight;
if(baseHeight * rate < 400){
$('.slide-item').height(baseHeight * rate); // 余白を削除する
}else{
$('.slide-item').height(400); // 余白を削除する
}
// transform を使用することでCLSの影響を受けないようにする
$('.slide-item img')
.css(
{
'transform-origin': 'top left',
'transform': 'scaleY(' + rate + ')',
'transition': 'transform .1s'
}
);
// 正しいサイズに近くなったら属性を解除する
setTimeout(removeSize, 500);
};
$('.item_visual').on('init', slickInitial);
// リサイズ時は CLS の影響を受けないため属性を解除する
$(window).resize(removeSize);
$('.item_visual').slick({
dots: false,
arrows: true,
responsive: [{
breakpoint: 768,
settings: {
dots: true,
arrows: false
}
}]
});
$('.slideThumb').on('click', function() {
var index = $(this).attr('data-index');
$('.item_visual').slick('slickGoTo', index, false);
})
});
</script>
<script>
$(function() {
$('.add-cart').on('click', function(event) {
{% if form.classcategory_id1 is defined %}
// 規格1フォームの必須チェック
if ($('#classcategory_id1').val() == '__unselected' || $('#classcategory_id1').val() == '') {
$('#classcategory_id1')[0].setCustomValidity('{{ '項目が選択されていません'|trans }}');
return true;
} else {
$('#classcategory_id1')[0].setCustomValidity('');
}
{% endif %}
{% if form.classcategory_id2 is defined %}
// 規格2フォームの必須チェック
if ($('#classcategory_id2').val() == '__unselected' || $('#classcategory_id2').val() == '') {
$('#classcategory_id2')[0].setCustomValidity('{{ '項目が選択されていません'|trans }}');
return true;
} else {
$('#classcategory_id2')[0].setCustomValidity('');
}
{% endif %}
// タイプ2: カート送信直前に set_count を quantity に同期
if($('#set_count').length){
var _sc = parseInt($('#set_count').val()) || 1;
$('#quantity').val(_sc);
$('input[name="quantity"]').val(_sc);
}
// 個数フォームのチェック
if ($('#quantity').val() < 1) {
$('#quantity')[0].setCustomValidity('{{ '1以上で入力してください。'|trans }}');
return true;
} else {
$('#quantity')[0].setCustomValidity('');
}
event.preventDefault();
$form = $('#form1');
$.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('{{ '施工検討リストへの追加に失敗しました。'|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()
});
var pw = "{% if mitsumori_json %}{{ mitsumori_json.pw }}{% endif %}";
var pd = "{% if mitsumori_json %}{{ mitsumori_json.pd }}{% endif %}";
var ph = "{% if mitsumori_json %}{{ mitsumori_json.ph }}{% endif %}";
var pm = "{% if mitsumori_json %}{{ mitsumori_json.pm }}{% endif %}";
var pc = "{% if mitsumori_json %}{{ mitsumori_json.pc }}{% endif %}";
var op0 = "{% if mitsumori_json %}{{ mitsumori_json.op[0] }}{% endif %}";
var op1 = "{% if mitsumori_json %}{{ mitsumori_json.op[1] }}{% endif %}";
var op2 = "{% if mitsumori_json %}{{ mitsumori_json.op[2] }}{% endif %}";
var op3 = "{% if mitsumori_json %}{{ mitsumori_json.op[3] }}{% endif %}";
var op4 = "{% if mitsumori_json %}{{ mitsumori_json.op[4] }}{% endif %}";
var op5 = "{% if mitsumori_json %}{{ mitsumori_json.op[5] }}{% endif %}";
var op6 = "{% if mitsumori_json %}{{ mitsumori_json.op[6] }}{% endif %}";
var op7 = "{% if mitsumori_json %}{{ mitsumori_json.op[7] }}{% endif %}";
var op8 = "{% if mitsumori_json %}{{ mitsumori_json.op[8] }}{% endif %}";
var op9 = "{% if mitsumori_json %}{{ mitsumori_json.op[9] }}{% endif %}";
var op10 = "{% if mitsumori_json %}{{ mitsumori_json.op[10] }}{% endif %}";
const formatter = new Intl.NumberFormat('ja-JP');
function mitsumori_simulation(type , value_id){
var pp = {{ pp|raw }};
if(type == "pw"){
pw = $('#'+value_id).val();
}
if(type == "pd"){
pd = $('#'+value_id).val();
}
if(type == "ph"){
ph = $('#'+value_id).val();
}
if(type == "pm"){
pm = $('#'+value_id).val();
}
if(type == "pc"){
pc = $('#'+value_id).val();
}
if(type == "op0"){ op0 = $('#'+value_id).val(); }
if(type == "op1"){ op1 = $('#'+value_id).val(); }
if(type == "op2"){ op2 = $('#'+value_id).val(); }
if(type == "op3"){ op3 = $('#'+value_id).val(); }
if(type == "op4"){ op4 = $('#'+value_id).val(); }
if(type == "op5"){ op5 = $('#'+value_id).val(); }
if(type == "op6"){ op6 = $('#'+value_id).val(); }
if(type == "op7"){ op7 = $('#'+value_id).val(); }
if(type == "op8"){ op8 = $('#'+value_id).val(); }
if(type == "op9"){ op9 = $('#'+value_id).val(); }
if(type == "op10"){ op10 = $('#'+value_id).val(); }
// op系: ボタンの is-selected を選択中のものに付け替え + radio チェック
if(/^op\d+$/.test(type)) {
var $clicked = $('#' + value_id);
$clicked.prop('checked', true);
var groupName = $clicked.attr('name');
$('input[name="' + groupName + '"]').closest('.opt-btn').removeClass('is-selected');
$clicked.closest('.opt-btn').addClass('is-selected');
// ラベルの選択値テキスト更新
var $group = $clicked.closest('.form-group');
var $label = $group.find('.rp-section-label');
if ($label.length) {
var labelText = $label.text().split(':')[0].trim();
$label.html(labelText + ': <span>' + $clicked.val() + '</span>');
}
}
if(pm == ""){
$('#mitsumori_message').text("素材を選択してください");
}
if(ph == ""){
$('#mitsumori_message').text("高さを選択してください");
}
if(pd == ""){
$('#mitsumori_message').text("奥行きを選択してください");
}
if(pw == ""){
$('#mitsumori_message').text("幅を選択してください");
}
if(pc == ""){
$('#mitsumori_message').text("カラーを選択してください");
$('#mitsumori_btn').hide();
$('#mitsumori_goukei').text("---円");
$('#mitsumori_off').text("---円");
$('#mitsumori_price').text("---円");
$('#maker_price').text("---円");
$('#mitsumori_ct').text("---円");
$('#mitsumori_option').text("---円");
}
if(pw != "" && pd != "" && ph != "" && pm != "" && pc != ""){
$('#mitsumori_btn').show();
var pp_matched = false;
pp.forEach((el) => {
if((pw == el.w || pw == "指定なし") && (pd == el.d || pd == "指定なし") && (ph == el.h || ph == "指定なし") && (pm == el.m || pm == "指定なし") && (pc == el.c || pc == "指定なし")){
pp_matched = true;
if(op0 == "商品購入のみ" || op1 == "商品購入のみ" || op2 == "商品購入のみ" || op3 == "商品購入のみ" || op4 == "商品購入のみ"
|| op5 == "商品購入のみ" || op6 == "商品購入のみ" || op7 == "商品購入のみ" || op8 == "商品購入のみ" || op9 == "商品購入のみ"){
$('#mitsumori_message').text(formatter.format(parseInt(el.price)) + "円");
$('#mitsumori_goukei').text(formatter.format(parseInt(el.price)) + "円");
$('#mitsumori_off').text(formatter.format(parseInt(el.price) - parseInt(el.maker_price)) + "円");
$('#mitsumori_price').text(formatter.format(parseInt(el.price)) + "円");
$('#maker_price').text(formatter.format(parseInt(el.maker_price)) + "円");
$('#mitsumori_ct').text("0円");
$('#mitsumori_option').text("0円");
$('#mitsumori_kei').text(formatter.format(parseInt(el.price)) + "円");
$('#mitsumori_price_01').text(formatter.format(parseInt(el.price)) + "円");
$('#mitsumori_price_02').text(formatter.format(parseInt(el.price)) + "円");
$('#mitsumori_ct_01').text("0円");
$('#mitsumori_ct_02').text("0円");
$('#mitsumori_goukei_02').text(formatter.format(parseInt(el.price)) + "円");
mitsumori_goukei = (parseInt(el.price));
shoukei = mitsumori_goukei / 1.1;
tax = parseInt(mitsumori_goukei - shoukei);
$('#mitsumori_shoukei').text(formatter.format(parseInt(shoukei)) + "円");
$('#mitsumori_tax').text(formatter.format(parseInt(tax)) + "円");
}else{
$('#mitsumori_message').text(formatter.format(parseInt(el.price) + parseInt(el.ct)) + "円");
$('#mitsumori_goukei').text(formatter.format(parseInt(el.price) + parseInt(el.ct)) + "円");
$('#mitsumori_off').text(formatter.format(parseInt(el.price) - parseInt(el.maker_price)) + "円");
$('#mitsumori_price').text(formatter.format(parseInt(el.price)) + "円");
$('#maker_price').text(formatter.format(parseInt(el.maker_price)) + "円");
$('#mitsumori_ct').text(formatter.format(parseInt(el.ct)) + "円");
$('#mitsumori_option').text("0円");
$('#mitsumori_kei').text(formatter.format(parseInt(el.price) + parseInt(el.ct)) + "円");
$('#mitsumori_price_01').text(formatter.format(parseInt(el.price)) + "円");
$('#mitsumori_price_02').text(formatter.format(parseInt(el.price)) + "円");
$('#mitsumori_ct_01').text(formatter.format(parseInt(el.ct)) + "円");
$('#mitsumori_ct_02').text(formatter.format(parseInt(el.ct)) + "円");
$('#mitsumori_goukei_02').text(formatter.format(parseInt(el.price) + parseInt(el.ct)) + "円");
mitsumori_goukei = (parseInt(el.price) + parseInt(el.ct));
shoukei = mitsumori_goukei / 1.1;
tax = parseInt(mitsumori_goukei - shoukei);
$('#mitsumori_shoukei').text(formatter.format(parseInt(shoukei)) + "円");
$('#mitsumori_tax').text(formatter.format(parseInt(tax)) + "円");
}
}
});
if (!pp_matched) {
$('#mitsumori_message').text("この組み合わせは対応しておりません");
$('#mitsumori_btn').hide();
$('#mitsumori_goukei').text("---円");
$('#mitsumori_off').text("---円");
$('#mitsumori_price').text("---円");
$('#maker_price').text("---円");
$('#mitsumori_ct').text("---円");
$('#mitsumori_option').text("---円");
$('#mitsumori_kei').text("---円");
$('#mitsumori_shoukei').text("---円");
$('#mitsumori_tax').text("---円");
}
// タイプ5: ステップ・フェンス・面積の現在値を取得
if($('input[name=deck_step]:checked').length){ deck_step = $('input[name=deck_step]:checked').val(); }
if($('input[name=deck_fence]:checked').length){ deck_fence = $('input[name=deck_fence]:checked').val(); }
// タイプ2: 窓サイズ・窓タイプ・ガラスタイプ・セット数
var mado_w_val = $('#mado_w').val() || '';
var mado_h_val = $('#mado_h').val() || '';
var mado_type_val = $('input[name=mado_type]:checked').val() || '';
var glass_type_val = $('input[name=glass_type]:checked').val() || '';
var set_count_val = parseInt($('#set_count').val()) || 1;
// タイプ3: 台数
var daisu_val = parseInt($('#daisu').val()) || 1;
// タイプ4・6: 枚数
var maisu_val = parseInt($('#maisu').val()) || 1;
// タイプ5: 面積
var area_val = $('#area').val() || '';
// sale_type
var sale_type_id = {{ ProductClass.SaleType.id }};
var mitsumori_json = { "mitsumori_goukei": $('#mitsumori_goukei').text(),
"mitsumori_goukei_02": $('#mitsumori_goukei_02').text(),
"mitsumori_price": $('#mitsumori_price').text(),
"maker_price": $('#maker_price').text(),
"mitsumori_off": $('#mitsumori_off').text(),
"mitsumori_ct": $('#mitsumori_ct').text(),
"mitsumori_option": $('#mitsumori_option').text(),
"product_id": {{ Product.id }},
"sale_type": sale_type_id,
"pw": pw,
"pd": pd,
"ph": ph,
"pm": pm,
"pc": pc,
"op": [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10],
"mado_w": mado_w_val,
"mado_h": mado_h_val,
"mado_type": mado_type_val,
"glass_type": glass_type_val,
"set_count": set_count_val,
"daisu": daisu_val,
"maisu": maisu_val,
"area": area_val,
"deck_step": deck_step,
"deck_fence": deck_fence };
$('#mitsumori_json').val(JSON.stringify(mitsumori_json));
}
}
{% if color and color|length == 1 %}
pc = "指定なし";
{% for cc in color %}{% if cc and cc['name'] %} pc = "{{ cc['name'] }}"; {% endif %}{% endfor %}
{% endif %}
{% if p_w and (p_w|length == 1 or p_w|join == "") %}
pw = "指定なし";
{% for pw in p_w %}{% if pw %} pw = "{{ pw }}"; {% endif %}{% endfor %}
{% endif %}
{% if p_d and (p_d|length == 1 or p_d|join == "") %}
pd = "指定なし";
{% for pd in p_d %}{% if pd %} pd = "{{ pd }}"; {% endif %}{% endfor %}
{% endif %}
{% if p_h and (p_h|length == 1 or p_h|join == "") %}
ph = "指定なし";
{% for ph in p_h %}{% if ph %} ph = "{{ ph }}"; {% endif %}{% endfor %}
{% endif %}
{% if p_m and (p_m|length == 1 or p_m|join == "") %}
pm = "指定なし";
{% for pm in p_m %}{% if pm %} pm = "{{ pm }}"; {% endif %}{% endfor %}
{% endif %}
// ページ読み込み時: タイプ別に quantity の初期値をセット
(function initQuantityByType(){
var saleType = {{ ProductClass.SaleType.id }};
if(saleType == 2 && $('#set_count').length){
var _v = parseInt($('#set_count').val()) || 1;
$('#quantity').val(_v);
$('input[name="quantity"]').val(_v);
} else if(saleType == 3 && $('#daisu').length){
$('#quantity').val(parseInt($('#daisu').val()) || 1);
} else if((saleType == 4 || saleType == 6) && $('#maisu').length){
$('#quantity').val(parseInt($('#maisu').val()) || 1);
} else if(saleType == 9 && $('#quantity_only').length){
$('#quantity').val(parseInt($('#quantity_only').val()) || 1);
}
})();
// type → ラベルのプレフィックス文字列
var optLabelMap = {pc:'カラー', pw:'幅', pd:'奥行き', ph:'高さ', pm:'素材'};
// type → input[name]
var optNameMap = {pc:'color', pw:'pw', pd:'pd', ph:'ph', pm:'pm'};
// opt-btn用: 値を直接受け取るラッパー
function mitsumori_simulation_val(type, value) {
if (type === 'pc') pc = value;
if (type === 'pw') pw = value;
if (type === 'pd') pd = value;
if (type === 'ph') ph = value;
if (type === 'pm') pm = value;
// is-selected クラスを同グループ内で付け替え
var inputName = optNameMap[type];
if (inputName) {
var $btns = $('input[name="' + inputName + '"]').closest('.opt-btn');
$btns.removeClass('is-selected');
$btns.filter(function(){
return $(this).find('input').val() === value;
}).addClass('is-selected');
}
// ラベル行の選択値テキストを更新(例: 「カラー: ブラック」)
var labelPrefix = optLabelMap[type];
if (labelPrefix) {
// 対象のrp-section-labelを特定(input[name]を含む親を遡る)
var $group = $('input[name="' + inputName + '"]').first().closest('.form-group');
var $label = $group.find('.rp-section-label');
$label.html(labelPrefix + ': <span>' + value + '</span>');
}
// simulation本体を呼ぶ(value_idは空でOK、グローバル変数を使う)
mitsumori_simulation('', '');
}
mitsumori_simulation("","");
// ボタン群: 親幅を超える、または3行以上になる場合は is-scroll で1行横スクロール化
function applyBtnGroupScroll() {
$('.rp-btn-group, .opt-btn-group').each(function() {
var $group = $(this);
$group.removeClass('is-scroll');
var $items = $group.children();
if ($items.length === 0) return;
var parentWidth = $group.parent().width() || $group.width();
var totalWidth = 0;
var gap = parseInt($group.css('gap'), 10) || 8;
$items.each(function() {
totalWidth += this.offsetWidth + gap;
});
// 単一ボタンが親幅を超える、もしくは合計幅が親幅を超える → 横スクロール化
var anyTooWide = false;
$items.each(function() {
if (this.offsetWidth > parentWidth) { anyTooWide = true; return false; }
});
// 折り返し時の行数も計測
var tops = {};
$items.each(function() { tops[this.offsetTop] = true; });
var rowCount = Object.keys(tops).length;
if (anyTooWide || totalWidth > parentWidth * 2 || rowCount >= 3) {
$group.addClass('is-scroll');
}
});
}
applyBtnGroupScroll();
$(window).on('resize', function() {
clearTimeout(window._btnScrollTimer);
window._btnScrollTimer = setTimeout(applyBtnGroupScroll, 150);
});
// onload: 見積金額が確定している場合は「工事費込み価格」表示を一致させる
(function syncPrice02Display() {
var goukeiEl = document.getElementById('mitsumori_goukei');
var displayEl = document.getElementById('price02-display');
if (!goukeiEl || !displayEl) return;
var goukeiText = goukeiEl.textContent.trim();
// ---円(未確定)の場合は書き換えない
if (goukeiText && goukeiText !== '---円') {
displayEl.textContent = goukeiText;
}
// 以降の変更にも追従: mitsumori_goukei を監視
new MutationObserver(function() {
var text = goukeiEl.textContent.trim();
if (text && text !== '---円') {
displayEl.textContent = text;
}
}).observe(goukeiEl, { childList: true, subtree: true, characterData: true });
})();
function contact_form(product_id){
$('#form1').attr('action', '{{ url('contact', {product:Product.id}) }}');
$('#form1').submit();
}
// maisu / madoset は下部の新しい関数定義を使用
function heibei(bei){
$('#heibei').val(parseInt($('#heibei').val()) + bei);
if(parseInt($('#heibei').val()) < 1){ $('#heibei').val(1); }
if(parseInt($('#heibei').val()) > 100){ $('#heibei').val(100); }
$('#quantity').val($('#heibei').val());
mitsumori_simulation('heibei','heibei');
}
function daisu(dai){
$('#daisu').val(parseInt($('#daisu').val()) + dai);
if(parseInt($('#daisu').val()) < 1){ $('#daisu').val(1); }
if(parseInt($('#daisu').val()) > 10){ $('#daisu').val(10); }
$('#quantity').val($('#daisu').val());
mitsumori_simulation('daisu','daisu');
}
function maisu(mai){
$('#maisu').val(parseInt($('#maisu').val()) + mai);
if(parseInt($('#maisu').val()) < 1){ $('#maisu').val(1); }
if(parseInt($('#maisu').val()) > 100){ $('#maisu').val(100); }
$('#quantity').val($('#maisu').val());
mitsumori_simulation('maisu','maisu');
}
// タイプ2: セット数プルダウン連動
function madosetSelect(val){
var v = parseInt(val);
if(v < 1) v = 1;
if(v > 20) v = 20;
// id="quantity" と name="quantity" 両方を確実に書き換え
$('#quantity').val(v);
$('input[name="quantity"]').val(v);
mitsumori_simulation('set','set_count');
}
// タイプ2: ±ボタン版(後方互換)
function madoset(mai){
var current = parseInt($('#set_count').val()) || 1;
var next = current + mai;
if(next < 1) next = 1;
if(next > 20) next = 20;
$('#set_count').val(next);
madosetSelect(next);
}
// タイプ5: ステップ・フェンス選択値を mitsumori_json に保存するためのグローバル変数
var deck_step = "{% if mitsumori_json %}{{ mitsumori_json.deck_step|default('不要') }}{% else %}不要{% endif %}";
var deck_fence = "{% if mitsumori_json %}{{ mitsumori_json.deck_fence|default('不要') }}{% else %}不要{% endif %}";
// PDF出力: モーダルの mitsumori_json をフォームに同期してから送信
function syncPdfJson(){
var jsonVal = $('#mitsumori_json').val();
$('#pdf_mitsumori_json').val(jsonVal);
}
// タイプ9: 商品のみ購入
function quantityOnly(val){
var current = parseInt($('#quantity_only').val()) || 1;
var next = current + val;
if(next < 1) next = 1;
$('#quantity_only').val(next);
$('#quantity').val(next);
}
// ===== スマホ用下部固定バーへの金額同期 =====
// mitsumori_message と mitsumori_goukei を監視して下部バーを更新
(function() {
var msgTarget = document.getElementById('mitsumori_message');
var goukeiTarget = document.getElementById('mitsumori_goukei');
var spPrice = document.getElementById('sp-mitsumori-price');
var spBtn = document.querySelector('#sp-mitsumori-bar .sp-bar__btn');
if (!spPrice || !spBtn) return;
function syncBar() {
var msg = msgTarget ? msgTarget.textContent : '';
var goukei = goukeiTarget ? goukeiTarget.textContent : '---円';
// メッセージが「〇〇を選択してください」の場合はメッセージを表示しボタンを非表示
if (msg.indexOf('選択してください') !== -1) {
spPrice.textContent = msg;
spPrice.style.fontSize = '13px';
spPrice.style.color = '#888';
spBtn.style.display = 'none';
} else {
// 価格確定時はボタンを表示
spPrice.textContent = goukei;
spPrice.style.fontSize = '18px';
spPrice.style.color = '#c00';
spBtn.style.display = 'block';
}
}
// 初期値を同期
syncBar();
// mitsumori_message の変化を監視
if (msgTarget) {
new MutationObserver(syncBar).observe(
msgTarget, { childList: true, subtree: true, characterData: true }
);
}
// mitsumori_goukei の変化も監視
if (goukeiTarget) {
new MutationObserver(syncBar).observe(
goukeiTarget, { childList: true, subtree: true, characterData: true }
);
}
})();
// ===== 現在のお見積り額: 折りたたみトグルボタンのテキスト切り替え =====
(function() {
var card = document.querySelector('.mitsumori-card-pc');
var btn = document.querySelector('.btn-mitsumori-toggle .toggle-icon');
if (!card || !btn) return;
// MutationObserverでcollapsed-cardクラスの変化を監視
new MutationObserver(function() {
if (card.classList.contains('collapsed-card')) {
btn.textContent = '▼ 詳細';
} else {
btn.textContent = '▲ 閉じる';
}
}).observe(card, { attributes: true, attributeFilter: ['class'] });
})();
// ===== エリア案内: スマホのみタップで展開 =====
(function() {
var notice = document.querySelector('.ec-areaNotice');
if (!notice) return;
notice.addEventListener('click', function(e) {
if (window.innerWidth > 767) return;
// リンククリック時は展開/折りたたみせずリンク遷移
if (e.target.tagName === 'A') return;
notice.classList.toggle('is-open');
});
})();
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Product",
"name": "{{ Product.name }}",
"image": [
{% for img in Product.ProductImage %}
"{{ app.request.schemeAndHttpHost }}{{ asset(img, 'save_image') }}"{% if not loop.last %},{% endif %}
{% else %}
"{{ app.request.schemeAndHttpHost }}{{ asset(''|no_image_product, 'save_image') }}"
{% endfor %}
],
"description": "{{ Product.description_list | default(Product.description_detail) | replace({'\n': '', '\r': ''}) | slice(0,300) }}",
{% if Product.code_min %}
"sku": "{{ Product.code_min }}",
{% endif %}
"offers": {
"@type": "Offer",
"url": "{{ url('product_detail', {'id': Product.id}) }}",
"priceCurrency": "{{ eccube_config.currency }}",
"price": {{ Product.getPrice02IncTaxMin ? Product.getPrice02IncTaxMin : 0}},
"availability": "{{ Product.stock_find ? "InStock" : "OutOfStock" }}"
}
}
</script>
{% endblock %}
{% block main %}
<div class="ec-productRole" style="margin-top:20px;">
<div class="ec-grid2">
<div class="ec-grid2__cell">
<div class="ec-sliderItemRole">
{# 商品名 + ブランド名 + SNSシェア #}
<div class="ec-productRole__title">
<div class="ec-productRole__titleRow">
<h2 class="ec-headingTitle">{{ Product.name }}</h2>
<div class="ec-share-inline">
<a href="https://twitter.com/share?url={{ app.request.uri|url_encode }}&text={{ Product.name|url_encode }}"
class="share-twitter" target="_blank" rel="noreferrer noopener" title="Xでシェア">
<svg viewBox="0 0 24 24" style="width:15px;height:15px;fill:#fff;"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-4.714-6.231-5.401 6.231H2.74l7.73-8.835L1.254 2.25H8.08l4.254 5.622L18.244 2.25zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
</a>
<a href="https://www.instagram.com/" class="share-facebook" target="_blank" rel="noreferrer noopener" title="Instagram">
<svg viewBox="0 0 24 24" style="width:15px;height:15px;fill:#fff;"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z"/></svg>
</a>
<a href="https://social-plugins.line.me/lineit/share?url={{ app.request.uri|url_encode }}"
class="share-line" target="_blank" rel="noreferrer noopener" title="LINEでシェア">
<i class="fab fa-line"></i>
</a>
</div>
</div>
</div>
{% if BaseInfo.option_favorite_product %}
<div style="position:relative;top: 20px;left: 10px;z-index:100;">
{% if is_favorite == false %}
<form action="{{ url('product_add_favorite', {id:Product.id}) }}" method="post">
<button type="submit" id="favorite" class="favorite">♡</button>
</form>
{% else %}
<form action="{{ url('product_add_favorite', {id:Product.id}) }}" method="post">
<button type="submit" id="favorite" class="favorite" style="color:red;">♥</button>
</form>
{% endif %}
</div>
{% endif %}
<div class="item_visual">
{% for ProductImage in Product.ProductImage %}
<div class="slide-item"><img src="{{ asset(ProductImage, 'save_image') }}" alt="{{ loop.first ? Product.name : '' }}" width="550" height="550" style="max-height: 400px;"{% if loop.index > 1 %} loading="lazy"{% endif %}></div>
{% else %}
<div class="slide-item"><img src="{{ asset(''|no_image_product, 'save_image') }}" alt="{{ loop.first ? Product.name : '' }}" width="550" height="550" style="max-height: 400px;"></div>
{% endfor %}
</div>
<div class="item_nav">
{% for ProductImage in Product.ProductImage %}
<div class="slideThumb" data-index="{{ loop.index0 }}"><img src="{{ asset(ProductImage, 'save_image') }}" alt="" width="80" height="80" loading="lazy"></div>
{% endfor %}
</div>
</div>
{# ===== 施工エリア案内(見積シミュレーションの下)===== #}
<div class="ec-areaNotice" style="margin-top:16px;margin-right:10px;">
<div class="ec-areaNotice__inner">
<div class="ec-areaNotice__icon">📍</div>
<div class="ec-areaNotice__body">
<p class="ec-areaNotice__title">施工対応エリアについて</p>
<div class="ec-areaNotice__detail">
<p class="ec-areaNotice__text">
当店の施工サービスは、<strong>山梨県全域</strong>および<br>
<strong>諏訪エリア(諏訪市・岡谷市・茅野市・諏訪郡)</strong>を対象としております。<br>
上記エリア外のお客様には、商品のみのご購入が可能でございます。<br>
ご不明な点がございましたら、お気軽にお問い合わせください。
</p>
<a class="ec-areaNotice__link" href="{{ url('contact') }}">エリア外のお客様・ご相談はこちら →</a>
</div>
</div>
</div>
</div>
</div>
<div class="ec-grid2__cell2">
<div class="ec-productRole__profile" >
{# 関連カテゴリ #}
{% if Product.ProductCategories is not empty %}
<div class="ec-productRole__category" style="padding:10px 0;">
{% for ProductCategory in Product.ProductCategories %}
<ul>
<li>
{% for Category in ProductCategory.Category.path %}
<a href="{{ url('product_list') }}?category_id={{ Category.id }}">{{ Category.name }}</a> {%- if loop.last == false %}
<span>></span>{% endif -%}
{% endfor %}
</li>
</ul>
{% endfor %}
</div>
{% endif %}
{# 販売価格 #}
<div class="ec-productRole__price">
<span style="color:black;font-size:15px;">工事費込み価格</span>
{% if Product.hasProductClass -%}
{% if Product.getPrice02IncTaxMin == Product.getPrice02IncTaxMax %}
<div class="ec-price">
<span id="price02-display" class="ec-price__price price02-default">{{ Product.getPrice02IncTaxMin|price }}</span>
<span class="ec-price__tax">({{ '税込'|trans }})~</span>
</div>
{% else %}
<div class="ec-price">
<span id="price02-display" class="ec-price__price price02-default">{{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}</span>
<span class="ec-price__tax">({{ '税込'|trans }})</span>
</div>
{% endif %}
{% else %}
<div class="ec-price">
<span id="price02-display" class="ec-price__price">{{ Product.getPrice02IncTaxMin|price }}</span>
<span class="ec-price__tax">({{ '税込'|trans }})~</span>
</div>
{% endif %}
</div>
{# タグ #}
<ul class="ec-productRole__tags">
{% for Tag in Product.Tags %}
<li class="ec-productRole__tag tag_{{ Tag.id }}">{{ Tag }}</li>
{% endfor %}
</ul>
{# 商品コード #}
{% if Product.code_min is not empty %}
<div class="ec-productRole__code">
{{ '商品コード'|trans }}: <span class="product-code-default">{{ Product.code_min }}{% if Product.code_min != Product.code_max %} ~ {{ Product.code_max }}{% endif %}</span>
</div>
{% endif %}
<div class="ec-productRole__description">
<div class="ec-rectHeading">
<h4>製品情報</h4>
</div>
{{ Product.sales_infomation|raw|nl2br }}
</div>
<div class="card card-danger" style="clear:both;margin:1px;">
<div class="card-header">
<h3 class="card-title">見積シミュレーション</h3>
</div>
<div class="card-body p-2">
{% set related_image = getProduct_field(Product.id,"related_image") %}
{# related_image は配列: ["1段目画像あり","2段目画像あり","3段目画像あり"] のうち該当するものが格納 #}
{% set img1 = related_image and ("1段目画像あり" in related_image) %}
{% set img2 = related_image and ("2段目画像あり" in related_image) %}
{% set img3 = related_image and ("3段目画像あり" in related_image) %}
{% set img4 = related_image and ("4段目画像あり" in related_image) %}
{% set type1 = getProduct_field(Product.id,"related_name1") %}
{% set type2 = getProduct_field(Product.id,"related_name2") %}
{% set type3 = getProduct_field(Product.id,"related_name3") %}
{% set type4 = getProduct_field(Product.id,"related_name4") %}
{% set hasRelated = (type1 and related_product1 and related_product1|length)
or (type2 and related_product2 and related_product2|length)
or (type3 and related_product3 and related_product3|length)
or (type4 and related_product4 and related_product4|length) %}
{% if hasRelated %}
<div class="row" style="border-bottom:1px solid rgba(0,0,0,.125)"><label class="col-12 col-form-label">この商品のタイプを選択してください。</label></div>
{% endif %}
{# ===== 1段目 ===== #}
{% if type1 and related_product1 and related_product1|length %}
<div class="form-group mt-3 pb-3" style="border-bottom:1px solid rgba(0,0,0,.125)">
<div class="rp-section-label">{{ type1 }}{% if img1 and base_select1 %}: <span>{{ base_select1 }}</span>{% endif %}</div>
{% if img1 %}
{# --- 画像付きカード --- #}
<div class="rp-card-group">
{% for rp_id, rp_name in related_product1 %}
<label class="rp-card{% if base_select1 == rp_name %} is-selected{% endif %}"
onclick="location.href='/products/detail/{{ rp_id }}';">
<input type="radio" name="rp1" value="{{ rp_name }}"
{% if base_select1 == rp_name %}checked{% endif %}>
<img class="rp-card__image"
src="{{ asset('p' ~ rp_id ~ '_cp_1.jpg', 'save_image') }}"
alt="{{ rp_name }}"
onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
<div class="rp-card__placeholder" style="display:none;">📦</div>
<span class="rp-card__name">{{ rp_name }}</span>
</label>
{% endfor %}
</div>
{% else %}
{# --- ボタン式ラジオ --- #}
<div class="rp-btn-group">
{% for rp_id, rp_name in related_product1 %}
<label class="rp-btn{% if base_select1 == rp_name %} is-selected{% endif %}"
onclick="location.href='/products/detail/{{ rp_id }}';">
<input type="radio" name="rp1" value="{{ rp_name }}"
{% if base_select1 == rp_name %}checked{% endif %}>
{{ rp_name }}
</label>
{% endfor %}
</div>
{% endif %}
</div>
{% endif %}
{# ===== 2段目 ===== #}
{% if type2 and related_product2 and related_product2|length %}
<div class="form-group mt-3 pb-3" style="border-bottom:1px solid rgba(0,0,0,.125)">
<div class="rp-section-label">{{ type2 }}{% if img2 and base_select2 %}: <span>{{ base_select2 }}</span>{% endif %}</div>
{% if img2 %}
<div class="rp-card-group">
{% for rp_id, rp_name in related_product2 %}
<label class="rp-card{% if base_select2 == rp_name %} is-selected{% endif %}"
onclick="location.href='/products/detail/{{ rp_id }}';">
<input type="radio" name="rp2" value="{{ rp_name }}"
{% if base_select2 == rp_name %}checked{% endif %}>
<img class="rp-card__image"
src="{{ asset('p' ~ rp_id ~ '_cp_1.jpg', 'save_image') }}"
alt="{{ rp_name }}"
onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
<div class="rp-card__placeholder" style="display:none;">📦</div>
<span class="rp-card__name">{{ rp_name }}</span>
</label>
{% endfor %}
</div>
{% else %}
<div class="rp-btn-group">
{% for rp_id, rp_name in related_product2 %}
<label class="rp-btn{% if base_select2 == rp_name %} is-selected{% endif %}"
onclick="location.href='/products/detail/{{ rp_id }}';">
<input type="radio" name="rp2" value="{{ rp_name }}"
{% if base_select2 == rp_name %}checked{% endif %}>
{{ rp_name }}
</label>
{% endfor %}
</div>
{% endif %}
</div>
{% endif %}
{# ===== 3段目 ===== #}
{% if type3 and related_product3 and related_product3|length %}
<div class="form-group mt-3 pb-3" style="border-bottom:1px solid rgba(0,0,0,.125)">
<div class="rp-section-label">{{ type3 }}{% if img3 and base_select3 %}: <span>{{ base_select3 }}</span>{% endif %}</div>
{% if img3 %}
<div class="rp-card-group">
{% for rp_id, rp_name in related_product3 %}
<label class="rp-card{% if base_select3 == rp_name %} is-selected{% endif %}"
onclick="location.href='/products/detail/{{ rp_id }}';">
<input type="radio" name="rp3" value="{{ rp_name }}"
{% if base_select3 == rp_name %}checked{% endif %}>
<img class="rp-card__image"
src="{{ asset('p' ~ rp_id ~ '_cp_1.jpg', 'save_image') }}"
alt="{{ rp_name }}"
onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
<div class="rp-card__placeholder" style="display:none;">📦</div>
<span class="rp-card__name">{{ rp_name }}</span>
</label>
{% endfor %}
</div>
{% else %}
<div class="rp-btn-group">
{% for rp_id, rp_name in related_product3 %}
<label class="rp-btn{% if base_select3 == rp_name %} is-selected{% endif %}"
onclick="location.href='/products/detail/{{ rp_id }}';">
<input type="radio" name="rp3" value="{{ rp_name }}"
{% if base_select3 == rp_name %}checked{% endif %}>
{{ rp_name }}
</label>
{% endfor %}
</div>
{% endif %}
</div>
{% endif %}
{# ===== 4段目 ===== #}
{% if type4 and related_product4 and related_product4|length %}
<div class="form-group mt-3 pb-3" style="border-bottom:1px solid rgba(0,0,0,.125)">
<div class="rp-section-label">{{ type4 }}{% if img4 and base_select4 %}: <span>{{ base_select4 }}</span>{% endif %}</div>
{% if img4 %}
{# --- 画像付きカード --- #}
<div class="rp-card-group">
{% for rp_id, rp_name in related_product4 %}
<label class="rp-card{% if base_select4 == rp_name %} is-selected{% endif %}"
onclick="location.href='/products/detail/{{ rp_id }}';">
<input type="radio" name="rp4" value="{{ rp_name }}"
{% if base_select4 == rp_name %}checked{% endif %}>
<img class="rp-card__image"
src="{{ asset('p' ~ rp_id ~ '_cp_1.jpg', 'save_image') }}"
alt="{{ rp_name }}" loading="lazy">
<span class="rp-card__label">{{ rp_name }}</span>
</label>
{% endfor %}
</div>
{% else %}
{# --- ボタン式ラジオ --- #}
<div class="rp-btn-group">
{% for rp_id, rp_name in related_product4 %}
<label class="rp-btn{% if base_select4 == rp_name %} is-selected{% endif %}"
onclick="location.href='/products/detail/{{ rp_id }}';">
<input type="radio" name="rp4" value="{{ rp_name }}"
{% if base_select4 == rp_name %}checked{% endif %}>
{{ rp_name }}
</label>
{% endfor %}
</div>
{% endif %}
</div>
{% endif %}
<div class="row" style="border-bottom:1px solid rgba(0,0,0,.125)"><label class="col-12 col-form-label">この商品のオプションを選択してください。</label></div>
{% if color and color|length and ProductClass.SaleType.id != 3 %}
<div class="form-group mt-3 pb-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<div class="rp-section-label">カラー{% if mitsumori_json and mitsumori_json.pc %}: <span>{{ mitsumori_json.pc }}</span>{% endif %}</div>
<div class="opt-btn-group">
{% set idx = 0 %}
{% for cc in color %}{% if cc and cc['name'] %}{% set idx = idx + 1 %}
<label class="opt-btn{% if (mitsumori_json and mitsumori_json.pc == cc['name']) or color|length == 1 %} is-selected{% endif %}"
onclick="mitsumori_simulation_val('pc', '{{ cc['name']|e('js') }}');">
<input type="radio" name="color" id="cc_{{ idx }}" value="{{ cc['name'] }}"
{% if (mitsumori_json and mitsumori_json.pc == cc['name']) or color|length == 1 %}checked{% endif %}>
{{ cc['name'] }}
</label>
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
{% if p_w and p_w|length and p_w|join != "" %}
<div class="form-group mt-3 pb-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<div class="rp-section-label">幅{% if mitsumori_json and mitsumori_json.pw %}: <span>{{ mitsumori_json.pw }}</span>{% endif %}</div>
<div class="opt-btn-group">
{% set idx = 0 %}
{% for pw in p_w %}{% if pw %}{% set idx = idx + 1 %}
<label class="opt-btn{% if (mitsumori_json and mitsumori_json.pw == pw) or p_w|length == 1 %} is-selected{% endif %}"
onclick="mitsumori_simulation_val('pw', '{{ pw|e('js') }}');">
<input type="radio" name="pw" id="pw_{{ idx }}" value="{{ pw }}"
{% if (mitsumori_json and mitsumori_json.pw == pw) or p_w|length == 1 %}checked{% endif %}>
{{ pw }}
</label>
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
{% if p_d and p_d|length and p_d|join != "" %}
<div class="form-group mt-3 pb-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<div class="rp-section-label">奥行き{% if mitsumori_json and mitsumori_json.pd %}: <span>{{ mitsumori_json.pd }}</span>{% endif %}</div>
<div class="opt-btn-group">
{% set idx = 0 %}
{% for pd in p_d %}{% if pd %}{% set idx = idx + 1 %}
<label class="opt-btn{% if (mitsumori_json and mitsumori_json.pd == pd) or p_d|length == 1 %} is-selected{% endif %}"
onclick="mitsumori_simulation_val('pd', '{{ pd|e('js') }}');">
<input type="radio" name="pd" id="pd_{{ idx }}" value="{{ pd }}"
{% if (mitsumori_json and mitsumori_json.pd == pd) or p_d|length == 1 %}checked{% endif %}>
{{ pd }}
</label>
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
{% if p_h and p_h|length and p_h|join != "" %}
<div class="form-group mt-3 pb-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<div class="rp-section-label">高さ{% if mitsumori_json and mitsumori_json.ph %}: <span>{{ mitsumori_json.ph }}</span>{% endif %}</div>
<div class="opt-btn-group">
{% set idx = 0 %}
{% for ph in p_h %}{% if ph %}{% set idx = idx + 1 %}
<label class="opt-btn{% if (mitsumori_json and mitsumori_json.ph == ph) or p_h|length == 1 %} is-selected{% endif %}"
onclick="mitsumori_simulation_val('ph', '{{ ph|e('js') }}');">
<input type="radio" name="ph" id="ph_{{ idx }}" value="{{ ph }}"
{% if (mitsumori_json and mitsumori_json.ph == ph) or p_h|length == 1 %}checked{% endif %}>
{{ ph }}
</label>
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
{% if p_m and p_m|length and p_m|join != "" %}
<div class="form-group mt-3 pb-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<div class="rp-section-label">素材{% if mitsumori_json and mitsumori_json.pm %}: <span>{{ mitsumori_json.pm }}</span>{% endif %}</div>
<div class="opt-btn-group">
{% set idx = 0 %}
{% for pm in p_m %}{% if pm %}{% set idx = idx + 1 %}
<label class="opt-btn{% if (mitsumori_json and mitsumori_json.pm == pm) or p_m|length == 1 %} is-selected{% endif %}"
onclick="mitsumori_simulation_val('pm', '{{ pm|e('js') }}');">
<input type="radio" name="pm" id="pm_{{ idx }}" value="{{ pm }}"
{% if (mitsumori_json and mitsumori_json.pm == pm) or p_m|length == 1 %}checked{% endif %}>
{{ pm }}
</label>
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
<!-- 1: 施工見積(通常) → 幅/奥行/高さ/素材/カラーは上部の共通ブロックで表示済み -->
{% if ProductClass.SaleType.id == 1 %}
{% endif %}
<!-- 2: 施工見積(補助金・窓) -->
{% if ProductClass.SaleType.id == 2 %}
{# 窓サイズ(自由入力) #}
<div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label">窓サイズ</label>
<div class="col-4">
<div class="input-group">
<span class="input-group-text">窓幅</span>
<input type="number" name="mado_w" id="mado_w" class="form-control" value="{{ mitsumori_json.mado_w|default('') }}" placeholder="例: 90" min="1" onchange="mitsumori_simulation('mado_w','mado_w');">
<span class="input-group-text">cm</span>
</div>
</div>
<div class="col-4">
<div class="input-group">
<span class="input-group-text">窓高さ</span>
<input type="number" name="mado_h" id="mado_h" class="form-control" value="{{ mitsumori_json.mado_h|default('') }}" placeholder="例: 110" min="1" onchange="mitsumori_simulation('mado_h','mado_h');">
<span class="input-group-text">cm</span>
</div>
</div>
</div>
{# 窓タイプ(p_d データから選択肢を生成) #}
{% if p_d and p_d|length and p_d|join != "" %}
<div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label">窓タイプ</label>
<div class="col-8">
<div class="form-group clearfix">
{% set idx = 0 %}
{% for pd_val in p_d %}
{% if pd_val %}
{% set idx = idx + 1 %}
<div class="icheck-danger d-inline">
<input type="radio" name="mado_type" id="mado_type_{{ idx }}" value="{{ pd_val }}"
{% if (mitsumori_json and mitsumori_json.pd == pd_val) or (p_d|length == 1) %}checked{% endif %}
onclick="mitsumori_simulation('pd','mado_type_{{ idx }}');">
<label for="mado_type_{{ idx }}">{{ pd_val }}</label>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>
{% endif %}
{# ガラスタイプ(p_m データから選択肢を生成) #}
{% if p_m and p_m|length and p_m|join != "" %}
<div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label">ガラスタイプ</label>
<div class="col-8">
<div class="form-group clearfix">
{% set idx = 0 %}
{% for pm_val in p_m %}
{% if pm_val %}
{% set idx = idx + 1 %}
<div class="icheck-danger d-inline">
<input type="radio" name="glass_type" id="glass_type_{{ idx }}" value="{{ pm_val }}"
{% if (mitsumori_json and mitsumori_json.pm == pm_val) or (p_m|length == 1) %}checked{% endif %}
onclick="mitsumori_simulation('pm','glass_type_{{ idx }}');">
<label for="glass_type_{{ idx }}">{{ pm_val }}</label>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>
{% endif %}
{# セット数(プルダウン) → quantity に連動 #}
<div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label">セット数</label>
<div class="col-8">
<select name="set_count" id="set_count" class="form-control" onchange="madosetSelect(this.value);">
{% for i in 1..20 %}
<option value="{{ i }}" {% if mitsumori_json and mitsumori_json.set_count == i %}selected{% endif %}>{{ i }} セット</option>
{% endfor %}
</select>
</div>
</div>
{% endif %}
<!-- 3: 施工見積(物置・ゴミステーション) -->
{% if ProductClass.SaleType.id == 3 %}
{# 幅・奥行き・高さ(p_w/p_d/p_h からラジオボタン生成) #}
{% if p_w and p_w|length and p_w|join != "" %}
<div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label">幅</label>
<div class="col-8">
<div class="form-group clearfix">
{% set idx = 0 %}
{% for pw_val in p_w %}{% if pw_val %}{% set idx = idx + 1 %}
<div class="icheck-danger d-inline">
<input type="radio" name="pw" id="pw3_{{ idx }}" value="{{ pw_val }}"
{% if (mitsumori_json and mitsumori_json.pw == pw_val) or p_w|length == 1 %}checked{% endif %}
onclick="mitsumori_simulation('pw','pw3_{{ idx }}');">
<label for="pw3_{{ idx }}">{{ pw_val }}</label>
</div>
{% endif %}{% endfor %}
</div>
</div>
</div>
{% endif %}
{% if p_d and p_d|length and p_d|join != "" %}
<div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label">奥行き</label>
<div class="col-8">
<div class="form-group clearfix">
{% set idx = 0 %}
{% for pd_val in p_d %}{% if pd_val %}{% set idx = idx + 1 %}
<div class="icheck-danger d-inline">
<input type="radio" name="pd" id="pd3_{{ idx }}" value="{{ pd_val }}"
{% if (mitsumori_json and mitsumori_json.pd == pd_val) or p_d|length == 1 %}checked{% endif %}
onclick="mitsumori_simulation('pd','pd3_{{ idx }}');">
<label for="pd3_{{ idx }}">{{ pd_val }}</label>
</div>
{% endif %}{% endfor %}
</div>
</div>
</div>
{% endif %}
{% if p_h and p_h|length and p_h|join != "" %}
<div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label">高さ</label>
<div class="col-8">
<div class="form-group clearfix">
{% set idx = 0 %}
{% for ph_val in p_h %}{% if ph_val %}{% set idx = idx + 1 %}
<div class="icheck-danger d-inline">
<input type="radio" name="ph" id="ph3_{{ idx }}" value="{{ ph_val }}"
{% if (mitsumori_json and mitsumori_json.ph == ph_val) or p_h|length == 1 %}checked{% endif %}
onclick="mitsumori_simulation('ph','ph3_{{ idx }}');">
<label for="ph3_{{ idx }}">{{ ph_val }}</label>
</div>
{% endif %}{% endfor %}
</div>
</div>
</div>
{% endif %}
{# 棚タイプ(p_m データから選択肢を生成) #}
{% if p_m and p_m|length and p_m|join != "" %}
<div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label">棚タイプ<br><small class="text-muted">(間仕切り仕様)</small></label>
<div class="col-8">
<div class="form-group clearfix">
{% set idx = 0 %}
{% for pm_val in p_m %}{% if pm_val %}{% set idx = idx + 1 %}
<div class="icheck-danger d-inline">
<input type="radio" name="pm" id="pm3_{{ idx }}" value="{{ pm_val }}"
{% if (mitsumori_json and mitsumori_json.pm == pm_val) or p_m|length == 1 %}checked{% endif %}
onclick="mitsumori_simulation('pm','pm3_{{ idx }}');">
<label for="pm3_{{ idx }}">{{ pm_val }}</label>
</div>
{% endif %}{% endfor %}
</div>
</div>
</div>
{% endif %}
{# カラー(共通の color データ使用) #}
{% if color and color|length %}
<div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label">カラー</label>
<div class="col-8">
<div class="form-group clearfix">
{% set idx = 0 %}
{% for cc in color %}{% if cc and cc['name'] %}{% set idx = idx + 1 %}
<div class="icheck-danger d-inline">
<input type="radio" name="color3" id="cc3_{{ idx }}" value="{{ cc['name'] }}"
{% if (mitsumori_json and mitsumori_json.pc == cc['name']) or color|length == 1 %}checked{% endif %}
onclick="mitsumori_simulation('pc','cc3_{{ idx }}');">
<label for="cc3_{{ idx }}">{{ cc['name'] }}</label>
</div>
{% endif %}{% endfor %}
</div>
</div>
</div>
{% endif %}
{# 台数 #}
<div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label">台数</label>
<div class="col-4">
<div class="input-group mb-3">
<input type="number" name="daisu" id="daisu" class="form-control" value="{{ mitsumori_json.daisu|default('1') }}" min="1" max="10" onchange="mitsumori_simulation('daisu','daisu');">
<span class="input-group-text">台</span>
</div>
</div>
<div class="col-4">
<button type="button" class="btn btn-info" onclick="daisu(+1);">+</button>
<button type="button" class="btn btn-danger" onclick="daisu(-1);">ー</button>
</div>
</div>
{% endif %}
<!-- 4: 施工見積(フェンス・組み立て式) -->
{% if ProductClass.SaleType.id == 4 %}
{# 枚数 #}
<div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label">枚数</label>
<div class="col-4 mb-3">
<div class="input-group">
<input type="number" name="maisu" id="maisu" class="form-control" value="{{ mitsumori_json.maisu|default('3') }}" min="3" max="20" onchange="mitsumori_simulation('maisu','maisu');">
<span class="input-group-text">枚</span>
</div>
</div>
<div class="col-4">
<button type="button" class="btn btn-info" onclick="maisu(+1);">+</button>
<button type="button" class="btn btn-danger" onclick="maisu(-1);">ー</button>
</div>
</div>
{% endif %}
<!-- 5: 施工見積(ウッドデッキ・タイルデッキ) -->
{% if ProductClass.SaleType.id == 5 %}
{# 施工面積(㎡ 直接入力) #}
<div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label">施工面積</label>
<div class="col-8">
<div class="input-group">
<input type="number" name="area" id="area"
class="form-control"
value="{{ mitsumori_json.area|default('') }}"
placeholder="例: 7.5"
min="0.1" step="0.1"
onchange="mitsumori_simulation('area','area');">
<span class="input-group-text">㎡</span>
</div>
<small class="text-muted">幅(cm) × 奥行き(cm) ÷ 10000 = ㎡</small>
</div>
</div>
{# ステップの有無 #}
<div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label">ステップ</label>
<div class="col-8">
<div class="form-group clearfix">
<div class="icheck-danger d-inline">
<input type="radio" name="deck_step" id="deck_step_yes" value="必要"
{% if mitsumori_json and mitsumori_json.deck_step == '必要' %}checked{% endif %}
onclick="mitsumori_simulation('op0','deck_step_yes');">
<label for="deck_step_yes">必要</label>
</div>
<div class="icheck-danger d-inline">
<input type="radio" name="deck_step" id="deck_step_no" value="不要"
{% if not mitsumori_json or mitsumori_json.deck_step == '不要' or not mitsumori_json.deck_step %}checked{% endif %}
onclick="mitsumori_simulation('op0','deck_step_no');">
<label for="deck_step_no">不要</label>
</div>
</div>
</div>
</div>
{# ウッドデッキフェンスの有無 #}
<div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label">デッキフェンス</label>
<div class="col-8">
<div class="form-group clearfix">
<div class="icheck-danger d-inline">
<input type="radio" name="deck_fence" id="deck_fence_yes" value="必要"
{% if mitsumori_json and mitsumori_json.deck_fence == '必要' %}checked{% endif %}
onclick="mitsumori_simulation('op1','deck_fence_yes');">
<label for="deck_fence_yes">必要</label>
</div>
<div class="icheck-danger d-inline">
<input type="radio" name="deck_fence" id="deck_fence_no" value="不要"
{% if not mitsumori_json or mitsumori_json.deck_fence == '不要' or not mitsumori_json.deck_fence %}checked{% endif %}
onclick="mitsumori_simulation('op1','deck_fence_no');">
<label for="deck_fence_no">不要</label>
</div>
</div>
</div>
</div>
{% endif %}
<!-- 6: 施工見積(芝生・枚数・数量買い) -->
{% if ProductClass.SaleType.id == 6 %}
{# 規格(p_m データ → 素材から抽出) #}
{% if p_m and p_m|length and p_m|join != "" %}
<div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label">規格</label>
<div class="col-8">
<div class="form-group clearfix">
{% set idx = 0 %}
{% for pm_val in p_m %}{% if pm_val %}{% set idx = idx + 1 %}
<div class="icheck-danger d-inline">
<input type="radio" name="pm" id="pm6_{{ idx }}" value="{{ pm_val }}"
{% if (mitsumori_json and mitsumori_json.pm == pm_val) or p_m|length == 1 %}checked{% endif %}
onclick="mitsumori_simulation('pm','pm6_{{ idx }}');">
<label for="pm6_{{ idx }}">{{ pm_val }}</label>
</div>
{% endif %}{% endfor %}
</div>
</div>
</div>
{% endif %}
{# 芝の長さ(p_w データ → 幅から抽出) #}
{% if p_w and p_w|length and p_w|join != "" %}
<div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label">芝の長さ</label>
<div class="col-8">
<div class="form-group clearfix">
{% set idx = 0 %}
{% for pw_val in p_w %}{% if pw_val %}{% set idx = idx + 1 %}
<div class="icheck-danger d-inline">
<input type="radio" name="pw" id="pw6_{{ idx }}" value="{{ pw_val }}"
{% if (mitsumori_json and mitsumori_json.pw == pw_val) or p_w|length == 1 %}checked{% endif %}
onclick="mitsumori_simulation('pw','pw6_{{ idx }}');">
<label for="pw6_{{ idx }}">{{ pw_val }}</label>
</div>
{% endif %}{% endfor %}
</div>
</div>
</div>
{% endif %}
{# 施工面積(㎡ 自由入力) #}
<div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label">施工面積</label>
<div class="col-8">
<div class="input-group">
<input type="number" name="area" id="area"
class="form-control"
value="{{ mitsumori_json.area|default('') }}"
placeholder="例: 10.5"
min="0.1" step="0.1"
onchange="mitsumori_simulation('area','area');">
<span class="input-group-text">平米</span>
</div>
</div>
</div>
{% endif %}
<!-- 9: 商品のみ購入 -->
{% if ProductClass.SaleType.id == 9 %}
<div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label">数量</label>
<div class="col-4">
<div class="input-group mb-3">
<input type="number" name="quantity_only" id="quantity_only" class="form-control" value="1" min="1" onchange="$('#quantity').val(this.value);">
<span class="input-group-text">個</span>
</div>
</div>
<div class="col-4">
<button type="button" class="btn btn-info" onclick="quantityOnly(+1);">+</button>
<button type="button" class="btn btn-danger" onclick="quantityOnly(-1);">ー</button>
</div>
</div>
{% endif %}
<div class="row" style="border-bottom:1px solid rgba(0,0,0,.125)"><label class="col-12 col-form-label">取り付け工事のご希望に関してお答えください。</label></div>
{% for i in 0..10 %}
{% if op and op|length >= i+1 %}
{% if op[i]['name'] %}
<div class="form-group mt-3 pb-3" style="border-bottom:1px solid rgba(0,0,0,.125)">
<div class="rp-section-label">{{ op[i]['name'] }}{% if mitsumori_json and mitsumori_json.op[i] %}: <span>{{ mitsumori_json.op[i] }}</span>{% endif %}</div>
{% if op[i]['comment'] %}<div class="opt-comment" style="font-size:12px;color:#666;margin:4px 0 6px;">{{ op[i]['comment'] }}</div>{% endif %}
<div class="opt-btn-group">
<label class="opt-btn{% if mitsumori_json and mitsumori_json.op[i] == op[i]['on'] %} is-selected{% endif %}"
onclick="mitsumori_simulation('op{{ i }}','op{{ i }}_1');">
<input type="radio" name="op{{ i }}" id="op{{ i }}_1" value="{{ op[i]['on'] }}" {% if mitsumori_json and mitsumori_json.op[i] == op[i]['on'] %}checked{% endif %}>
{{ op[i]['on'] }}
</label>
<label class="opt-btn{% if mitsumori_json and mitsumori_json.op[i] == op[i]['off'] %} is-selected{% endif %}"
onclick="mitsumori_simulation('op{{ i }}','op{{ i }}_2');">
<input type="radio" name="op{{ i }}" id="op{{ i }}_2" value="{{ op[i]['off'] }}" {% if mitsumori_json and mitsumori_json.op[i] == op[i]['off'] %}checked{% endif %}>
{{ op[i]['off'] }}
</label>
</div>
</div>
{% endif %}
{% endif %}
{% endfor %}
</div>
<!-- /.card-body -->
</div>
<form action="{{ url('product_add_cart', {id:Product.id}) }}" method="post" id="form1" name="form1">
{% if Product.stock_find %}
<div class="ec-productRole__actions">
{% if form.classcategory_id1 is defined %}
<div class="ec-select">
{{ form_row(form.classcategory_id1) }}
{{ form_errors(form.classcategory_id1) }}
</div>
{% if form.classcategory_id2 is defined %}
<div class="ec-select">
{{ form_row(form.classcategory_id2) }}
{{ form_errors(form.classcategory_id2) }}
</div>
{% endif %}
{% endif %}
<div class="ec-numberInput">
{{ form_widget(form.quantity, { type: 'hidden' }) }}
{{ form_errors(form.quantity) }}
</div>
</div>
{% else %}
<div class="ec-productRole__btn">
<button type="button" class="ec-blockBtn--action" disabled="disabled">
{{ 'ただいま品切れ中です。'|trans }}
</button>
</div>
{% endif %}
<div class="ec-productRole__btn mt-3">
<button type="submit" id="cart_btn" class="ec-blockBtn--action add-cart">施工検討リストに入れる</button>
</div>
{{ form_rest(form) }}
</form>
<div class="ec-modal">
<div class="ec-modal-overlay">
<div class="ec-modal-wrap">
<span class="ec-modal-close"><span class="ec-icon"><img src="{{ asset('assets/icon/cross-dark.svg') }}" alt=""/></span></span>
<div id="ec-modal-header" class="text-center">{{ '施工検討リストに追加しました。'|trans }}</div>
<div class="ec-modal-box">
<div class="ec-role">
<span class="ec-inlineBtn--cancel">{{ '商品検索を続ける'|trans }}</span>
<a href="{{ url('cart') }}" class="ec-inlineBtn--action">{{ '施工検討リストへ進む'|trans }}</a>
</div>
</div>
</div>
</div>
</div>
<div class="ec-productRole__description">{{ Product.description_detail|raw|nl2br }}
</div>
{# SNSシェア #}
<div class="ec-productRole__share">
<ul class="ec-share">
<li class="ec-share__item">
<a href="https://twitter.com/share?url={{ app.request.uri|url_encode }}&text={{ Product.name|url_encode }}" class="ec-share__link ec-share__link--twitter" target="_blank" rel="noreferrer noopener">
<i class="fab fa-twitter"></i>
</a>
</li>
<li class="ec-share__item">
<a href="https://www.facebook.com/sharer/sharer.php?u={{ app.request.uri|url_encode }}" class="ec-share__link ec-share__link--facebook" target="_blank" rel="noreferrer noopener">
<i class="fab fa-facebook-f"></i>
</a>
</li>
<li class="ec-share__item">
<a href="https://social-plugins.line.me/lineit/share?url={{ app.request.uri|url_encode }}" class="ec-share__link ec-share__link--line" target="_blank" rel="noreferrer noopener">
<i class="fab fa-line"></i>
</a>
</li>
</ul>
</div>
</div>
{# ===== スマホ用 見積金額 下部固定バー ===== #}
<div id="sp-mitsumori-bar">
<div>
<div class="sp-bar__label">合計(工事費・税込)</div>
<div class="sp-bar__price" id="sp-mitsumori-price">---円</div>
</div>
<button type="button" class="sp-bar__btn"
onclick="document.getElementById('cart_btn2') && document.getElementById('cart_btn2').click();">
検討リストへ
</button>
</div>
<div class="card col-12 collapsed-card sticky-top float-right mitsumori-card-pc">
<div class="card-header">
<h3 class="card-title">現在のお見積り額</h3>
<div class="card-tools">
<span class="float-left" id="mitsumori_message">395000円</span>
<button type="button" class="btn btn-tool btn-mitsumori-toggle" data-card-widget="collapse" title="詳細を表示">
<span class="toggle-icon">▼ 詳細</span>
</button>
</div>
</div>
<div class="card-body p-0">
<ul class="nav nav-pills flex-column">
<li class="nav-item active">
<a class="nav-link">
<i class="far fa-file-alt"></i> 合計(工事費・税込)
<span class="float-right" id="mitsumori_goukei">395,000円</span>
</a>
</li>
<li class="nav-item active">
<a class="nav-link">
<i class="far fa-file-alt"></i> 商品価格
<span class="float-right" id="mitsumori_price">307,008円</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link">
<i class="far fa-file-alt"></i> カタログ価格
<span class="float-right" id="maker_price">479,700円</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link">
<i class="far fa-file-alt"></i> お値引き
<span class="float-right" id="mitsumori_off">-172,692円</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link">
<i class="far fa-file-alt"></i> 基本工事費
<span class="float-right" id="mitsumori_ct">53,250円</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link">
<i class="far fa-file-alt"></i> 施工オプション
<span class="float-right"id="mitsumori_option">6,297円</span>
</a>
</li>
</ul>
</div>
<div class="card-footer">
<button type="button" id="mitsumori_btn" class="btn btn-info" data-toggle="modal" data-target="#modal-mitsumori">
見積書表示
</button>
<button type="submit" id="cart_btn2" class="btn btn-info add-cart">施工検討リストに入れる</button>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="modal-mitsumori">
<div class="modal-dialog modal-mitsumori" style="max-width:1000px">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">お見積書</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="invoice p-3 mb-5" style="max-width:1000px; margin:auto;">
<!-- title row -->
<div class="row">
<div class="col-12">
<h2>概算お見積書
<small class="float-right" style="font-size:14px;">発行日: 2025/03/14</small>
</h2>
</div>
<!-- /.col -->
</div>
<!-- info row -->
<div class="row invoice-info">
<div class="col-sm-8 invoice-col">
<h3>お客様</h3>
<span>下記の通り、お見積もり申し上げます。</span>
<br />
<br / >
<br />
<h2>お見積金額: <span id="mitsumori_kei">399,080円</span></h2>
<span>
<br/>
<br/>
<br/>
<br/>
</span>
</div>
<div class="col-sm-4 invoice-col">
<p>
<img alt="" src="/html/user_data/js/images/logo.png" style="width: 260px; max-width: 100%; max-height: 10mm;">
</p>
<p>有限会社プラス</p>
<p>〒400-0334</p>
<p>山梨県南アルプス市藤田1450番地2</p>
<p>TEL: 055-284-6480</p>
<img alt="" src="/html/user_data/js/images/seal.svg" style="z-index: 2; position: absolute; width: 21mm; left: 58mm; top: 36mm;">
</div>
<!-- /.col -->
<!-- /.col -->
</div>
<!-- /.row -->
<!-- Table row -->
<div class="row">
<div class="col-12 table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>項目</th>
<th>数量</th>
<th>単位</th>
<th>単価</th>
<th>小計</th>
</tr>
</thead>
<tbody>
<tr>
<td>プレーンルーフ 600タイプ 1台用 単体セット</td>
<td>1</td>
<td>式</td>
<td id="mitsumori_price_01">352,800</td>
<td id="mitsumori_price_02">352,800</td>
</tr>
<tr>
<td>基本工事費</td>
<td>1</td>
<td>式</td>
<td id="mitsumori_ct_01">10,000</td>
<td id="mitsumori_ct_02">10,000</td>
</tr>
<tr>
<td>残土・ガラ処理</td>
<td>1</td>
<td>式</td>
<td>0円</td>
<td></td>
</tr>
<tr>
<td> </td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<!-- /.col -->
</div>
<!-- /.row -->
<div class="row">
<!-- accepted payments column -->
<div class="col-6">
<p class="lead">お支払い方法</p>
<p class="text-muted well well-sm shadow-none" style="margin-top: 10px;">銀行振込、クレジットカード決済、PAYPAY決済
<br>銀行振込:山梨中央銀行 白根支店 普通口座 391402
<br>※商品代金と工事代金の総額が金100万円(税込)を超える場合、着手金として代金の半額をご契約後お支払いいただきます。
</p>
</div>
<!-- /.col -->
<div class="col-6">
<div class="table-responsive">
<table class="table">
<tbody>
<tr>
<th style="width:50%">小計:</th>
<td id="mitsumori_shoukei">362,800</td>
</tr>
<tr>
<th>消費税 (10%)</th>
<td id="mitsumori_tax">36,280</td>
</tr>
<tr>
<th>合計:</th>
<td id="mitsumori_goukei_02">399,080</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</div>
</div>
<div class="modal-footer justify-content-between">
{# PDF出力: mitsumori_json を POST して PDF ダウンロード #}
<form method="post" action="{{ url('mitsumori_pdf') }}" target="_blank" id="pdf_download_form">
<input type="hidden" name="_token" value="{{ csrf_token('mitsumori_pdf') }}">
<input type="hidden" name="mitsumori_json" id="pdf_mitsumori_json">
<button type="submit" class="btn btn-primary float-right" style="margin-right: 5px;" onclick="syncPdfJson();">
<i class="fas fa-download"></i>PDF出力
</button>
</form>
<button type="submit" id="cart_btn3" class="btn btn-info add-cart">施工検討リストに入れる</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
{% endblock %}