{#
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">
{% 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(); }
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();
pp.forEach((el) => {
if((pw == el.w || pw == "指定なし") && (pd == el.d || pd == "指定なし") && (ph == el.h || ph == "指定なし") && (pm == el.m || pm == "指定なし") && (pc == el.c || pc == "指定なし")){
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)) + "円");
}
}
});
// タイプ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);
}
})();
mitsumori_simulation("","");
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);
}
</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">
{# 商品名 #}
<div class="ec-productRole__title">
<h2 class="ec-headingTitle">{{ Product.name }}</h2>
</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>
<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 class="ec-price__price price02-default">{{ Product.getPrice02IncTaxMin|price }}</span>
<span class="ec-price__tax">({{ '税込'|trans }})~</span>
</div>
{% else %}
<div class="ec-price">
<span 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 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 type1 = getProduct_field(Product.id,"related_name1") %}
{% set type2 = getProduct_field(Product.id,"related_name2") %}
{% set type3 = getProduct_field(Product.id,"related_name3") %}
{% 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) %}
{% 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 %}
{% if type1 and related_product1 and related_product1|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 mt-2">{{ type1 }}</label>
<div class="col-8 mt-2">
<div class="form-group clearfix">
{% for rp_id, rp_name in related_product1 %}
<div class="icheck-danger d-inline">
<input type="radio" name="rp1" id="rp1_{{ rp_id }}" value="{{ rp_name }}" {% if base_select1 == rp_name %}checked{% endif %} onclick="location.href='/products/detail/{{ rp_id }}';"><label for="rp1_{{ rp_id }}">{{ rp_name }}</label>
</div>
{% endfor %}
</div>
</div>
</div>
{% endif %}
{% if type2 and related_product2 and related_product2|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 mt-2">{{ type2 }}</label>
<div class="col-8 mt-2">
<div class="form-group clearfix">
{% for rp_id, rp_name in related_product2 %}
<div class="icheck-danger d-inline">
<input type="radio" name="rp2" id="rp2_{{ rp_id }}" value="{{ rp_name }}" {% if base_select2 == rp_name %}checked{% endif %} onclick="location.href='/products/detail/{{ rp_id }}';"><label for="rp2_{{ rp_id }}">{{ rp_name }}</label>
</div>
{% endfor %}
</div>
</div>
</div>
{% endif %}
{% if type3 and related_product3 and related_product3|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 mt-2">{{ type3 }}</label>
<div class="col-8 mt-2">
<div class="form-group clearfix">
{% for rp_id, rp_name in related_product3 %}
<div class="icheck-danger d-inline">
<input type="radio" name="rp3" id="rp3_{{ rp_id }}" value="{{ rp_name }}" {% if base_select3 == rp_name %}checked{% endif %} onclick="location.href='/products/detail/{{ rp_id }}';"><label for="rp3_{{ rp_id }}">{{ rp_name }}</label>
</div>
{% endfor %}
</div>
</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>
{% if color and color|length and ProductClass.SaleType.id != 3 %}
<div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label mt-2">カラー</label>
<div class="col-8 mt-2">
<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="color" id="cc_{{ idx }}" value="{{ cc['name'] }}" {% if mitsumori_json and mitsumori_json.pc == cc['name'] or color|length == 1 %}checked{% endif %} onclick="mitsumori_simulation('pc','cc_{{ idx }}');"><label for="cc_{{ idx }}">{{ cc['name'] }}</label>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>
{% endif %}
{% 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 in p_w %}
{% if pw %}
{% set idx = idx + 1 %}
<div class="icheck-danger d-inline">
<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 %} onclick="mitsumori_simulation('pw','pw_{{ idx }}');"><label for="pw_{{ idx }}">{{ pw }}</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 in p_d %}
{% if pd %}
{% set idx = idx + 1 %}
<div class="icheck-danger d-inline">
<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 %} onclick="mitsumori_simulation('pd','pd_{{ idx }}');"><label for="pd_{{ idx }}">{{ pd }}</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 in p_h %}
{% if ph %}
{% set idx = idx + 1 %}
<div class="icheck-danger d-inline">
<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 %} onclick="mitsumori_simulation('ph','ph_{{ idx }}');"><label for="ph_{{ idx }}">{{ ph }}</label>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>
{% endif %}
{% 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 in p_m %}
{% if pm %}
{% set idx = idx + 1 %}
<div class="icheck-danger d-inline">
<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 %} onclick="mitsumori_simulation('pm','pm_{{ idx }}');"><label for="pm_{{ idx }}">{{ pm }}</label>
</div>
{% endif %}
{% endfor %}
</div>
</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 row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
<label class="col-4 col-form-label">{{ op[i]['name'] }}</label>
<div class="col-8">
{{ op[i]['comment'] }}
<div class="form-group clearfix">
<div class="icheck-danger d-inline">
<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 %} onclick="mitsumori_simulation('op{{ i }}','op{{ i }}_1');"><label for="op{{ i }}_1">{{ op[i]['on'] }}</label>
</div>
</div>
<div class="form-group clearfix">
<div class="icheck-danger d-inline">
<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 %} onclick="mitsumori_simulation('op{{ i }}','op{{ i }}_2');"><label for="op{{ i }}_2">{{ op[i]['off'] }}</label>
</div>
</div>
</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>
</div>
<div class="card col-12 collapsed-card sticky-top float-right">
<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" data-card-widget="collapse">
<i class="fas fa-plus"></i>
</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 %}