app/template/default/Product/detail.twig line 720

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4. http://www.ec-cube.co.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. {% extends 'default_frame.twig' %}
  9. {% set body_class = 'product_page' %}
  10. {% block stylesheet %}
  11.     <style>
  12.         .slick-slider {
  13.             margin-bottom: 10px;
  14.             margin-top: -20px;
  15.         }
  16.         .slick-dots {
  17.             position: absolute;
  18.             bottom: -45px;
  19.             display: block;
  20.             width: 100%;
  21.             padding: 0;
  22.             list-style: none;
  23.             text-align: center;
  24.         }
  25.         .slick-dots li {
  26.             position: relative;
  27.             display: inline-block;
  28.             width: 20px;
  29.             height: 20px;
  30.             margin: 0 5px;
  31.             padding: 0;
  32.             cursor: pointer;
  33.         }
  34.         .slick-dots li button {
  35.             font-size: 0;
  36.             line-height: 0;
  37.             display: block;
  38.             width: 20px;
  39.             height: 20px;
  40.             padding: 5px;
  41.             cursor: pointer;
  42.             color: transparent;
  43.             border: 0;
  44.             outline: none;
  45.             background: transparent;
  46.         }
  47.         .slick-dots li button:hover,
  48.         .slick-dots li button:focus {
  49.             outline: none;
  50.         }
  51.         .slick-dots li button:hover:before,
  52.         .slick-dots li button:focus:before {
  53.             opacity: 1;
  54.         }
  55.         .slick-dots li button:before {
  56.             content: " ";
  57.             line-height: 20px;
  58.             position: absolute;
  59.             top: 0;
  60.             left: 0;
  61.             width: 12px;
  62.             height: 12px;
  63.             text-align: center;
  64.             opacity: .25;
  65.             background-color: black;
  66.             border-radius: 50%;
  67.         }
  68.         .slick-dots li.slick-active button:before {
  69.             opacity: .75;
  70.             background-color: black;
  71.         }
  72.         .slick-dots li button.thumbnail img {
  73.             width: 0;
  74.             height: 0;
  75.         }
  76.     </style>
  77.     <link rel="stylesheet" href="/html/user_data/js/style.css">
  78.     <link rel="stylesheet" href="/html/plugins/icheck-bootstrap/icheck-bootstrap.min.css">
  79. {% endblock %}
  80. {% block javascript %}
  81.     <script>
  82.         eccube.classCategories = {{ class_categories_as_json(Product)|raw }};
  83.         // 規格2に選択肢を割り当てる。
  84.         function fnSetClassCategories(form, classcat_id2_selected) {
  85.             var $form = $(form);
  86.             var product_id = $form.find('input[name=product_id]').val();
  87.             var $sele1 = $form.find('select[name=classcategory_id1]');
  88.             var $sele2 = $form.find('select[name=classcategory_id2]');
  89.             eccube.setClassCategories($form, product_id, $sele1, $sele2, classcat_id2_selected);
  90.         }
  91.         {% if form.classcategory_id2 is defined %}
  92.         fnSetClassCategories(
  93.             $('#form1'), {{ form.classcategory_id2.vars.value|json_encode|raw }}
  94.         );
  95.         {% elseif form.classcategory_id1 is defined %}
  96.         eccube.checkStock($('#form1'), {{ Product.id }}, {{ form.classcategory_id1.vars.value|json_encode|raw }}, null);
  97.         {% endif %}
  98.     </script>
  99.     <script>
  100.         $(function() {
  101.             // bfcache無効化
  102.             $(window).bind('pageshow', function(event) {
  103.                 if (event.originalEvent.persisted) {
  104.                     location.reload(true);
  105.                 }
  106.             });
  107.             // Core Web Vital の Cumulative Layout Shift(CLS)対策のため
  108.             // img タグに width, height が付与されている.
  109.             // 630px 未満の画面サイズでは縦横比が壊れるための対策
  110.             // see https://github.com/EC-CUBE/ec-cube/pull/5023
  111.             $('.ec-grid2__cell').hide();
  112.             var removeSize = function () {
  113.                 $('.slide-item').height('');
  114.                 $('.slide-item img')
  115.                     .removeAttr('width')
  116.                     .removeAttr('height')
  117.                     .removeAttr('style');
  118.             };
  119.             var slickInitial = function(slick) {
  120.                 $('.ec-grid2__cell').fadeIn(1500);
  121.                 var baseHeight = $(slick.target).height();
  122.                 var baseWidth = $(slick.target).width();
  123.                 var rate = baseWidth / baseHeight;
  124.                 if(baseHeight * rate < 400){
  125.                     $('.slide-item').height(baseHeight * rate); // 余白を削除する
  126.                 }else{
  127.                     $('.slide-item').height(400); // 余白を削除する
  128.                 }
  129.                 // transform を使用することでCLSの影響を受けないようにする
  130.                 $('.slide-item img')
  131.                     .css(
  132.                         {
  133.                             'transform-origin': 'top left',
  134.                             'transform': 'scaleY(' + rate + ')',
  135.                             'transition': 'transform .1s'
  136.                         }
  137.                     );
  138.                 // 正しいサイズに近くなったら属性を解除する
  139.                 setTimeout(removeSize, 500);
  140.             };
  141.             $('.item_visual').on('init', slickInitial);
  142.             // リサイズ時は CLS の影響を受けないため属性を解除する
  143.             $(window).resize(removeSize);
  144.             $('.item_visual').slick({
  145.                 dots: false,
  146.                 arrows: true,
  147.                 responsive: [{
  148.                     breakpoint: 768,
  149.                     settings: {
  150.                         dots: true,
  151.                         arrows: false
  152.                     }
  153.                 }]
  154.             });
  155.             $('.slideThumb').on('click', function() {
  156.                 var index = $(this).attr('data-index');
  157.                 $('.item_visual').slick('slickGoTo', index, false);
  158.             })
  159.         });
  160.     </script>
  161.     <script>
  162.         $(function() {
  163.             $('.add-cart').on('click', function(event) {
  164.                 {% if form.classcategory_id1 is defined %}
  165.                 // 規格1フォームの必須チェック
  166.                 if ($('#classcategory_id1').val() == '__unselected' || $('#classcategory_id1').val() == '') {
  167.                     $('#classcategory_id1')[0].setCustomValidity('{{ '項目が選択されていません'|trans }}');
  168.                     return true;
  169.                 } else {
  170.                     $('#classcategory_id1')[0].setCustomValidity('');
  171.                 }
  172.                 {% endif %}
  173.                 {% if form.classcategory_id2 is defined %}
  174.                 // 規格2フォームの必須チェック
  175.                 if ($('#classcategory_id2').val() == '__unselected' || $('#classcategory_id2').val() == '') {
  176.                     $('#classcategory_id2')[0].setCustomValidity('{{ '項目が選択されていません'|trans }}');
  177.                     return true;
  178.                 } else {
  179.                     $('#classcategory_id2')[0].setCustomValidity('');
  180.                 }
  181.                 {% endif %}
  182.                 // 個数フォームのチェック
  183.                 if ($('#quantity').val() < 1) {
  184.                     $('#quantity')[0].setCustomValidity('{{ '1以上で入力してください。'|trans }}');
  185.                     return true;
  186.                 } else {
  187.                     $('#quantity')[0].setCustomValidity('');
  188.                 }
  189.                 event.preventDefault();
  190.                 $form = $('#form1');
  191.                 $.ajax({
  192.                     url: $form.attr('action'),
  193.                     type: $form.attr('method'),
  194.                     data: $form.serialize(),
  195.                     dataType: 'json',
  196.                     beforeSend: function(xhr, settings) {
  197.                         // Buttonを無効にする
  198.                         $('.add-cart').prop('disabled', true);
  199.                     }
  200.                 }).done(function(data) {
  201.                     // レスポンス内のメッセージをalertで表示
  202.                     $.each(data.messages, function() {
  203.                         $('#ec-modal-header').text(this);
  204.                     });
  205.                     $('.ec-modal').show()
  206.                     // カートブロックを更新する
  207.                     $.ajax({
  208.                         url: "{{ url('block_cart') }}",
  209.                         type: 'GET',
  210.                         dataType: 'html'
  211.                     }).done(function(html) {
  212.                         $('.ec-headerRole__cart').html(html);
  213.                     });
  214.                 }).fail(function(data) {
  215.                     alert('{{ 'カートへの追加に失敗しました。'|trans }}');
  216.                 }).always(function(data) {
  217.                     // Buttonを有効にする
  218.                     $('.add-cart').prop('disabled', false);
  219.                 });
  220.             });
  221.         });
  222.         $('.ec-modal-wrap').on('click', function(e) {
  223.             // モーダル内の処理は外側にバブリングさせない
  224.             e.stopPropagation();
  225.         });
  226.         $('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function() {
  227.             $('.ec-modal').hide()
  228.         });
  229.         var pw = "";
  230.         var pd = "";
  231.         var ph = "";
  232.         var pm = "";
  233.         var pc = "";
  234.         var op0 = "";
  235.         var op1 = "";
  236.         var op2 = "";
  237.         var op3 = "";
  238.         var op4 = "";
  239.         var op5 = "";
  240.         var op6 = "";
  241.         var op7 = "";
  242.         var op8 = "";
  243.         var op9 = "";
  244.         var op10 = "";
  245.         const formatter = new Intl.NumberFormat('ja-JP');
  246.         function mitsumori_simulation(type , value_id){
  247.             var pp = {{ pp|raw }};
  248.             if(type == "pw"){
  249.                 pw = $('#'+value_id).val();
  250.             }
  251.             if(type == "pd"){
  252.                 pd = $('#'+value_id).val();
  253.             }
  254.             if(type == "ph"){
  255.                 ph = $('#'+value_id).val();
  256.             }
  257.             if(type == "pm"){
  258.                 pm = $('#'+value_id).val();
  259.             }
  260.             if(type == "pc"){
  261.                 pc = $('#'+value_id).val();
  262.             }
  263.             if(type == "op0"){ op0 = $('#'+value_id).val(); }
  264.             if(type == "op1"){ op1 = $('#'+value_id).val(); }
  265.             if(type == "op2"){ op2 = $('#'+value_id).val(); }
  266.             if(type == "op3"){ op3 = $('#'+value_id).val(); }
  267.             if(type == "op4"){ op4 = $('#'+value_id).val(); }
  268.             if(type == "op5"){ op5 = $('#'+value_id).val(); }
  269.             if(type == "op6"){ op6 = $('#'+value_id).val(); }
  270.             if(type == "op7"){ op7 = $('#'+value_id).val(); }
  271.             if(type == "op8"){ op8 = $('#'+value_id).val(); }
  272.             if(type == "op9"){ op9 = $('#'+value_id).val(); }
  273.             if(type == "op10"){ op10 = $('#'+value_id).val(); }
  274.             if(pm == ""){
  275.                 $('#mitsumori_message').text("素材を選択してください");
  276.             }
  277.             if(ph == ""){
  278.                 $('#mitsumori_message').text("高さを選択してください");
  279.             }
  280.             if(pd == ""){
  281.                 $('#mitsumori_message').text("奥行きを選択してください");
  282.             }
  283.             if(pw == ""){
  284.                 $('#mitsumori_message').text("幅を選択してください");
  285.             }
  286.             if(pc == ""){
  287.                 $('#mitsumori_message').text("カラーを選択してください");
  288.                 $('#mitsumori_btn').hide();
  289.                 $('#mitsumori_goukei').text("---円");
  290.                 $('#mitsumori_off').text("---円");
  291.                 $('#mitsumori_price').text("---円");
  292.                 $('#maker_price').text("---円");
  293.                 $('#mitsumori_ct').text("---円");
  294.                 $('#mitsumori_option').text("---円");
  295.             }
  296.             if(pw != "" && pd != "" && ph != "" && pm != "" && pc != ""){
  297.                 $('#mitsumori_btn').show();
  298.                 
  299.                 pp.forEach((el) => {
  300.                   if(pw == el.w && pd == el.d && ph == el.h && pm == el.m && pc == el.c){
  301.                     if(op0 == "商品購入のみ" || op1 == "商品購入のみ" || op2 == "商品購入のみ" || op3 == "商品購入のみ" || op4 == "商品購入のみ" 
  302.                         || op5 == "商品購入のみ" || op6 == "商品購入のみ" || op7 == "商品購入のみ" || op8 == "商品購入のみ" || op9 == "商品購入のみ"){
  303.                           $('#mitsumori_message').text(formatter.format(parseInt(el.price)) + "円");
  304.                           $('#mitsumori_goukei').text(formatter.format(parseInt(el.price)) + "円");
  305.                           $('#mitsumori_off').text(formatter.format(parseInt(el.price) - parseInt(el.maker_price)) + "円");
  306.                           $('#mitsumori_price').text(formatter.format(parseInt(el.price)) + "円");
  307.                           $('#maker_price').text(formatter.format(parseInt(el.maker_price)) + "円");
  308.                           $('#mitsumori_ct').text("0円");
  309.                           $('#mitsumori_option').text("0円");
  310.                           $('#mitsumori_kei').text(formatter.format(parseInt(el.price)) + "円");
  311.                           $('#mitsumori_price_01').text(formatter.format(parseInt(el.price)) + "円");
  312.                           $('#mitsumori_price_02').text(formatter.format(parseInt(el.price)) + "円");
  313.                           $('#mitsumori_ct_01').text("0円");
  314.                           $('#mitsumori_ct_02').text("0円");
  315.                           $('#mitsumori_goukei_02').text(formatter.format(parseInt(el.price)) + "円");
  316.                         
  317.                         mitsumori_goukei = (parseInt(el.price));
  318.                         shoukei = mitsumori_goukei / 1.1;
  319.                         tax = parseInt(mitsumori_goukei - shoukei);
  320.                           $('#mitsumori_shoukei').text(formatter.format(parseInt(shoukei)) + "円");
  321.                           $('#mitsumori_tax').text(formatter.format(parseInt(tax)) + "円");
  322.                     }else{
  323.                           $('#mitsumori_message').text(formatter.format(parseInt(el.price) + parseInt(el.ct)) + "円");
  324.                           $('#mitsumori_goukei').text(formatter.format(parseInt(el.price) + parseInt(el.ct)) + "円");
  325.                           $('#mitsumori_off').text(formatter.format(parseInt(el.price) - parseInt(el.maker_price)) + "円");
  326.                           $('#mitsumori_price').text(formatter.format(parseInt(el.price)) + "円");
  327.                           $('#maker_price').text(formatter.format(parseInt(el.maker_price)) + "円");
  328.                           $('#mitsumori_ct').text(formatter.format(parseInt(el.ct)) + "円");
  329.                           $('#mitsumori_option').text("0円");
  330.                           $('#mitsumori_kei').text(formatter.format(parseInt(el.price) + parseInt(el.ct)) + "円");
  331.                           $('#mitsumori_price_01').text(formatter.format(parseInt(el.price)) + "円");
  332.                           $('#mitsumori_price_02').text(formatter.format(parseInt(el.price)) + "円");
  333.                           $('#mitsumori_ct_01').text(formatter.format(parseInt(el.ct)) + "円");
  334.                           $('#mitsumori_ct_02').text(formatter.format(parseInt(el.ct)) + "円");
  335.                           $('#mitsumori_goukei_02').text(formatter.format(parseInt(el.price) + parseInt(el.ct)) + "円");
  336.                         mitsumori_goukei = (parseInt(el.price) + parseInt(el.ct));
  337.                         shoukei = mitsumori_goukei / 1.1;
  338.                         tax = parseInt(mitsumori_goukei - shoukei);
  339.                           $('#mitsumori_shoukei').text(formatter.format(parseInt(shoukei)) + "円");
  340.                           $('#mitsumori_tax').text(formatter.format(parseInt(tax)) + "円");
  341.                     }
  342.                   }
  343.                 });
  344.             }
  345.         }
  346.         mitsumori_simulation("","");
  347.     </script>
  348.     <script type="application/ld+json">
  349.     {
  350.         "@context": "https://schema.org/",
  351.         "@type": "Product",
  352.         "name": "{{ Product.name }}",
  353.         "image": [
  354.             {% for img in Product.ProductImage %}
  355.                 "{{ app.request.schemeAndHttpHost }}{{ asset(img, 'save_image') }}"{% if not loop.last %},{% endif %}
  356.             {% else %}
  357.                 "{{ app.request.schemeAndHttpHost }}{{ asset(''|no_image_product, 'save_image') }}"
  358.             {% endfor %}
  359.         ],
  360.         "description": "{{ Product.description_list | default(Product.description_detail) | replace({'\n': '', '\r': ''}) | slice(0,300) }}",
  361.         {% if Product.code_min %}
  362.         "sku": "{{ Product.code_min }}",
  363.         {% endif %}
  364.         "offers": {
  365.             "@type": "Offer",
  366.             "url": "{{ url('product_detail', {'id': Product.id}) }}",
  367.             "priceCurrency": "{{ eccube_config.currency }}",
  368.             "price": {{ Product.getPrice02IncTaxMin ? Product.getPrice02IncTaxMin : 0}},
  369.             "availability": "{{ Product.stock_find ? "InStock" : "OutOfStock" }}"
  370.         }
  371.     }
  372.     </script>
  373. {% endblock %}
  374. {% block main %}
  375.     <div class="ec-productRole" style="margin-top:20px;">
  376.         <div class="ec-grid2">
  377.             <div class="ec-grid2__cell">
  378.                 <div class="ec-sliderItemRole">
  379.                     {# 商品名 #}
  380.                     <div class="ec-productRole__title">
  381.                         <h2 class="ec-headingTitle">{{ Product.name }}</h2>
  382.                     </div>
  383.                     {% if BaseInfo.option_favorite_product %}
  384.                      <div style="position:relative;top: 20px;left: 10px;z-index:100;">
  385.                         {% if is_favorite == false %}
  386.                         <form action="{{ url('product_add_favorite', {id:Product.id}) }}" method="post">
  387.                            <button type="submit" id="favorite" class="favorite">&#9825;</button>
  388.                         </form>
  389.                         {% else %}
  390.                         <form action="{{ url('product_add_favorite', {id:Product.id}) }}" method="post">
  391.                            <button type="submit" id="favorite" class="favorite" style="color:red;">&#9829;</button>
  392.                         </form>
  393.                         {% endif %}
  394.                      </div>
  395.                     {% endif %}
  396.                     <div class="item_visual">
  397.                         {% for ProductImage in Product.ProductImage %}
  398.                             <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>
  399.                         {% else %}
  400.                             <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>
  401.                         {% endfor %}
  402.                     </div>
  403.                     <div class="item_nav">
  404.                         {% for ProductImage in Product.ProductImage %}
  405.                             <div class="slideThumb" data-index="{{ loop.index0 }}"><img src="{{ asset(ProductImage, 'save_image') }}" alt="" width="80" height="80" loading="lazy"></div>
  406.                         {% endfor %}
  407.                     </div>
  408.                 </div>
  409.             </div>
  410.             <div class="ec-grid2__cell2">
  411.                 <div class="ec-productRole__profile" >
  412.                     {# 関連カテゴリ #}
  413.                     {% if Product.ProductCategories is not empty %}
  414.                         <div class="ec-productRole__category" style="padding:10px 0;">
  415.                             {% for ProductCategory in Product.ProductCategories %}
  416.                                 <ul>
  417.                                     <li>
  418.                                         {% for Category in ProductCategory.Category.path %}
  419.                                             <a href="{{ url('product_list') }}?category_id={{ Category.id }}">{{ Category.name }}</a> {%- if loop.last == false %}
  420.                                             <span>></span>{% endif -%}
  421.                                         {% endfor %}
  422.                                     </li>
  423.                                 </ul>
  424.                             {% endfor %}
  425.                         </div>
  426.                     {% endif %}
  427.                     {# 販売価格 #}
  428.                     <div class="ec-productRole__price">
  429.                         <span style="color:black;font-size:15px;">工事費込み価格</span>
  430.                         {% if Product.hasProductClass -%}
  431.                             {% if Product.getPrice02IncTaxMin == Product.getPrice02IncTaxMax %}
  432.                                 <div class="ec-price">
  433.                                     <span class="ec-price__price price02-default">{{ Product.getPrice02IncTaxMin|price }}</span>
  434.                                     <span class="ec-price__tax">({{ '税込'|trans }})~</span>
  435.                                 </div>
  436.                             {% else %}
  437.                                 <div class="ec-price">
  438.                                     <span class="ec-price__price price02-default">{{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}</span>
  439.                                     <span class="ec-price__tax">({{ '税込'|trans }})</span>
  440.                                 </div>
  441.                             {% endif %}
  442.                         {% else %}
  443.                             <div class="ec-price">
  444.                                 <span class="ec-price__price">{{ Product.getPrice02IncTaxMin|price }}</span>
  445.                                     <span class="ec-price__tax">({{ '税込'|trans }})~</span>
  446.                             </div>
  447.                         {% endif %}
  448.                     </div>
  449.                     {# タグ #}
  450.                     <ul class="ec-productRole__tags">
  451.                         {% for Tag in Product.Tags %}
  452.                             <li class="ec-productRole__tag tag_{{ Tag.id }}">{{ Tag }}</li>
  453.                         {% endfor %}
  454.                     </ul>
  455.                     {# 商品コード #}
  456.                     {% if Product.code_min is not empty %}
  457.                         <div class="ec-productRole__code">
  458.                             {{ '商品コード'|trans }}: <span class="product-code-default">{{ Product.code_min }}{% if Product.code_min != Product.code_max %} ~ {{ Product.code_max }}{% endif %}</span>
  459.                         </div>
  460.                     {% endif %}
  461.                     <div class="ec-productRole__description">
  462.                         <div class="ec-rectHeading">
  463.                             <h4>製品情報</h4>
  464.                         </div>
  465.                         {{ Product.sales_infomation|raw|nl2br }}
  466.                     </div>
  467.                     <div class="card card-danger" style="clear:both;margin:1px;">
  468.                       <div class="card-header">
  469.                         <h3 class="card-title">見積シミュレーション</h3>
  470.                       </div>
  471.                       <div class="card-body p-2">
  472.                         <div class="row" style="border-bottom:1px solid rgba(0,0,0,.125)"><label class="col-12 col-form-label">この商品のタイプを選択してください。</label></div>
  473.                         {% set type1 = getProduct_field(Product.id,"related_name1") %}
  474.                         {% if type1 and related_product1 and related_product1|length %}
  475.                         <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  476.                           <label class="col-4 col-form-label mt-2">{{ type1 }}</label>
  477.                           <div class="col-8 mt-2">
  478.                             <div class="form-group clearfix">
  479.                               {% for rp_id, rp_name in related_product1 %}
  480.                               <div class="icheck-danger d-inline">
  481.                                 <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>
  482.                               </div>
  483.                               {% endfor %}
  484.                             </div>
  485.                           </div>
  486.                         </div>
  487.                         {% endif %}
  488.                         {% set type2 = getProduct_field(Product.id,"related_name2") %}
  489.                         {% if type2 and related_product2 and related_product2|length %}
  490.                         <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  491.                           <label class="col-4 col-form-label mt-2">{{ type2 }}</label>
  492.                           <div class="col-8 mt-2">
  493.                             <div class="form-group clearfix">
  494.                               {% for rp_id, rp_name in related_product2 %}
  495.                               <div class="icheck-danger d-inline">
  496.                                 <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>
  497.                               </div>
  498.                               {% endfor %}
  499.                             </div>
  500.                           </div>
  501.                         </div>
  502.                         {% endif %}
  503.                         {% set type3 = getProduct_field(Product.id,"related_name3") %}
  504.                         {% if type3 and related_product3 and related_product3|length %}
  505.                         <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  506.                           <label class="col-4 col-form-label mt-2">{{ type3 }}</label>
  507.                           <div class="col-8 mt-2">
  508.                             <div class="form-group clearfix">
  509.                               {% for rp_id, rp_name in related_product3 %}
  510.                               <div class="icheck-danger d-inline">
  511.                                 <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>
  512.                               </div>
  513.                               {% endfor %}
  514.                             </div>
  515.                           </div>
  516.                         </div>
  517.                         {% endif %}
  518.                         <div class="row" style="border-bottom:1px solid rgba(0,0,0,.125)"><label class="col-12 col-form-label">この商品のカラー、サイズ、素材を選択してください。</label></div>
  519.                         {% if color and color|length %}
  520.                         <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  521.                           <label class="col-4 col-form-label mt-2">カラー</label>
  522.                           <div class="col-8 mt-2">
  523.                             <div class="form-group clearfix">
  524.                             {% set idx = 0 %}
  525.                             {% for cc in color %}
  526.                               {% if cc and cc['name'] %}
  527.                               {% set idx = idx + 1 %}
  528.                               <div class="icheck-danger d-inline">
  529.                                 <input type="radio" name="color" id="cc_{{ idx }}" value="{{ cc['name'] }}" onclick="mitsumori_simulation('pc','cc_{{ idx }}');"><label for="cc_{{ idx }}">{{ cc['name'] }}</label>
  530.                               </div>
  531.                               {% endif %}
  532.                             {% endfor %}
  533.                             </div>
  534.                           </div>
  535.                         </div>
  536.                         {% endif %}
  537.                         {% if p_w and p_w|length %}
  538.                         <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  539.                           <label class="col-4 col-form-label">幅</label>
  540.                           <div class="col-8">
  541.                             <div class="form-group clearfix">
  542.                             {% set idx = 0 %}
  543.                             {% for pw in p_w %}
  544.                               {% if pw %}
  545.                               {% set idx = idx + 1 %}
  546.                               <div class="icheck-danger d-inline">
  547.                                 <input type="radio" name="pw" id="pw_{{ idx }}" value="{{ pw }}" onclick="mitsumori_simulation('pw','pw_{{ idx }}');"><label for="pw_{{ idx }}">{{ pw }}</label>
  548.                               </div>
  549.                               {% endif %}
  550.                             {% endfor %}
  551.                             </div>
  552.                           </div>
  553.                         </div>
  554.                         {% endif %}
  555.                         {% if p_d and p_d|length %}
  556.                         <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  557.                           <label class="col-4 col-form-label">奥行き</label>
  558.                           <div class="col-8">
  559.                             <div class="form-group clearfix">
  560.                             {% set idx = 0 %}
  561.                             {% for pd in p_d %}
  562.                               {% if pd %}
  563.                               {% set idx = idx + 1 %}
  564.                               <div class="icheck-danger d-inline">
  565.                                 <input type="radio" name="pd" id="pd_{{ idx }}" value="{{ pd }}" onclick="mitsumori_simulation('pd','pd_{{ idx }}');"><label for="pd_{{ idx }}">{{ pd }}</label>
  566.                               </div>
  567.                               {% endif %}
  568.                             {% endfor %}
  569.                             </div>
  570.                           </div>
  571.                         </div>
  572.                         {% endif %}
  573.                         {% if p_h and p_h|length %}
  574.                         <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  575.                           <label class="col-4 col-form-label">高さ</label>
  576.                           <div class="col-8">
  577.                             <div class="form-group clearfix">
  578.                             {% set idx = 0 %}
  579.                             {% for ph in p_h %}
  580.                               {% if ph %}
  581.                               {% set idx = idx + 1 %}
  582.                               <div class="icheck-danger d-inline">
  583.                                 <input type="radio" name="ph" id="ph_{{ idx }}" value="{{ ph }}" onclick="mitsumori_simulation('ph','ph_{{ idx }}');"><label for="ph_{{ idx }}">{{ ph }}</label>
  584.                               </div>
  585.                               {% endif %}
  586.                             {% endfor %}
  587.                             </div>
  588.                           </div>
  589.                         </div>
  590.                         {% endif %}
  591.                         {% if p_w and p_w|length %}
  592.                         <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  593.                           <label class="col-4 col-form-label">素材</label>
  594.                           <div class="col-8">
  595.                             <div class="form-group clearfix">
  596.                             {% set idx = 0 %}
  597.                             {% for pm in p_m %}
  598.                               {% if pm %}
  599.                               {% set idx = idx + 1 %}
  600.                               <div class="icheck-danger d-inline">
  601.                                 <input type="radio" name="pm" id="pm_{{ idx }}" value="{{ pm }}" onclick="mitsumori_simulation('pm','pm_{{ idx }}');"><label for="pm_{{ idx }}">{{ pm }}</label>
  602.                               </div>
  603.                               {% endif %}
  604.                             {% endfor %}
  605.                             </div>
  606.                           </div>
  607.                         </div>
  608.                         {% endif %}
  609.                         <div class="row" style="border-bottom:1px solid rgba(0,0,0,.125)"><label class="col-12 col-form-label">取り付け工事のご希望に関してお答えください。</label></div>
  610.                         {% for i in 0..10 %}
  611.                             {% if op and op|length >= i+1 %}
  612.                             {% if op[i]['name'] %}
  613.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  614.                               <label class="col-4 col-form-label">{{ op[i]['name'] }}</label>
  615.                               <div class="col-8">
  616.                                 {{ op[i]['comment'] }}
  617.                                 <div class="form-group clearfix">
  618.                                   <div class="icheck-danger d-inline">
  619.                                     <input type="radio" name="op{{ i }}" id="op{{ i }}_1" value="{{ op[i]['on'] }}" onclick="mitsumori_simulation('op{{ i }}','op{{ i }}_1');"><label for="op{{ i }}_1">{{ op[i]['on'] }}</label>
  620.                                   </div>
  621.                                 </div>
  622.                                 <div class="form-group clearfix">
  623.                                   <div class="icheck-danger d-inline">
  624.                                     <input type="radio" name="op{{ i }}" id="op{{ i }}_2" value="{{ op[i]['off'] }}" onclick="mitsumori_simulation('op{{ i }}','op{{ i }}_2');"><label for="op{{ i }}_2">{{ op[i]['off'] }}</label>
  625.                                   </div>
  626.                                 </div>
  627.                               </div>
  628.                             </div>
  629.                             {% endif %}
  630.                             {% endif %}
  631.                         {% endfor %}
  632.                       </div>
  633.                       <!-- /.card-body -->
  634.                     </div>
  635.                     <form action="{{ url('product_add_cart', {id:Product.id}) }}" method="post" id="form1" name="form1">
  636.                         {% if Product.stock_find %}
  637.                             <div class="ec-productRole__actions">
  638.                                 {% if form.classcategory_id1 is defined %}
  639.                                     <div class="ec-select">
  640.                                         {{ form_row(form.classcategory_id1) }}
  641.                                         {{ form_errors(form.classcategory_id1) }}
  642.                                     </div>
  643.                                     {% if form.classcategory_id2 is defined %}
  644.                                         <div class="ec-select">
  645.                                             {{ form_row(form.classcategory_id2) }}
  646.                                             {{ form_errors(form.classcategory_id2) }}
  647.                                         </div>
  648.                                     {% endif %}
  649.                                 {% endif %}
  650.                                 <div class="ec-numberInput">
  651.                                     {{ form_widget(form.quantity, { type: 'hidden' }) }}
  652.                                     {{ form_errors(form.quantity) }}
  653.                                 </div>
  654.                             </div>
  655.                             {% if ProductClass.SaleType.id != 9 %}
  656.                             <div class="ec-productRole__btn">
  657.                             </div>
  658.                             {% else %}
  659.                             <div class="ec-productRole__btn">
  660.                                 <button type="submit" class="ec-blockBtn--action add-cart">
  661.                                     {{ 'カートに入れる'|trans }}
  662.                                 </button>
  663.                             </div>
  664.                             {% endif %}
  665.                         {% else %}
  666.                             <div class="ec-productRole__btn">
  667.                                 <button type="button" class="ec-blockBtn--action" disabled="disabled">
  668.                                     {{ 'ただいま品切れ中です。'|trans }}
  669.                                 </button>
  670.                             </div>
  671.                         {% endif %}
  672.                         {{ form_rest(form) }}
  673.                     </form>
  674.                     <div class="ec-modal">
  675.                         <div class="ec-modal-overlay">
  676.                             <div class="ec-modal-wrap">
  677.                                 <span class="ec-modal-close"><span class="ec-icon"><img src="{{ asset('assets/icon/cross-dark.svg') }}" alt=""/></span></span>
  678.                                 <div id="ec-modal-header" class="text-center">{{ 'カートに追加しました。'|trans }}</div>
  679.                                 <div class="ec-modal-box">
  680.                                     <div class="ec-role">
  681.                                         <span class="ec-inlineBtn--cancel">{{ 'お買い物を続ける'|trans }}</span>
  682.                                         <a href="{{ url('cart') }}" class="ec-inlineBtn--action">{{ 'カートへ進む'|trans }}</a>
  683.                                     </div>
  684.                                 </div>
  685.                             </div>
  686.                         </div>
  687.                     </div>
  688.                     <div class="ec-productRole__description">{{ Product.description_detail|raw|nl2br }}
  689.                     </div>
  690.                 </div>
  691.                 <div class="card col-12 collapsed-card sticky-top float-right">
  692.                     <div class="card-header">
  693.                       <h3 class="card-title">現在のお見積り額</h3>
  694.                       <div class="card-tools">
  695.                         <span class="float-left" id="mitsumori_message">395000円</span>
  696.                         <button type="button" class="btn btn-tool" data-card-widget="collapse">
  697.                           <i class="fas fa-plus"></i>
  698.                         </button>
  699.                       </div>
  700.                     </div>
  701.                     <div class="card-body p-0">
  702.                       <ul class="nav nav-pills flex-column">
  703.                         <li class="nav-item active">
  704.                           <a class="nav-link">
  705.                             <i class="far fa-file-alt"></i> 合計(工事費・税込)
  706.                             <span class="float-right" id="mitsumori_goukei">395,000円</span>
  707.                           </a>
  708.                         </li>
  709.                         <li class="nav-item active">
  710.                           <a class="nav-link">
  711.                             <i class="far fa-file-alt"></i> 商品価格
  712.                             <span class="float-right" id="mitsumori_price">307,008円</span>
  713.                           </a>
  714.                         </li>
  715.                         <li class="nav-item">
  716.                           <a class="nav-link">
  717.                             &nbsp;&nbsp;<i class="far fa-file-alt"></i> カタログ価格
  718.                             <span class="float-right" id="maker_price">479,700円</span>
  719.                           </a>
  720.                         </li>
  721.                         <li class="nav-item">
  722.                           <a class="nav-link">
  723.                             &nbsp;&nbsp;<i class="far fa-file-alt"></i> お値引き
  724.                             <span class="float-right" id="mitsumori_off">-172,692円</span>
  725.                           </a>
  726.                         </li>
  727.                         <li class="nav-item">
  728.                           <a class="nav-link">
  729.                             <i class="far fa-file-alt"></i> 基本工事費
  730.                             <span class="float-right" id="mitsumori_ct">53,250円</span>
  731.                           </a>
  732.                         </li>
  733.                         <li class="nav-item">
  734.                           <a class="nav-link">
  735.                             <i class="far fa-file-alt"></i> 施工オプション
  736.                             <span class="float-right"id="mitsumori_option">6,297円</span>
  737.                           </a>
  738.                         </li>
  739.                       </ul>
  740.                     </div>
  741.                     <div class="card-footer">
  742.                         <button type="button" id="mitsumori_btn" class="btn btn-info" data-toggle="modal" data-target="#modal-mitsumori">
  743.                           見積書表示
  744.                         </button>
  745.                         <button id="contact" class="btn btn-info" onclick="location.href='/contact?product={{ Product.id }}';">無料現地調査へ進む</button>
  746.                     </div>
  747.                 </div>
  748.             </div>
  749.         </div>
  750.     </div>
  751.   <div class="modal" id="modal-mitsumori">
  752.     <div class="modal-dialog modal-mitsumori" style="max-width:1000px">
  753.       <div class="modal-content">
  754.         <div class="modal-header">
  755.           <h4 class="modal-title">お見積書</h4>
  756.           <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  757.             <span aria-hidden="true">&times;</span>
  758.           </button>
  759.         </div>
  760.         <div class="modal-body">
  761.             <div class="invoice p-3 mb-5" style="max-width:1000px; margin:auto;">
  762.               <!-- title row -->
  763.               <div class="row">
  764.                 <div class="col-12">
  765.                   <h2>概算お見積書 
  766.                     <small class="float-right" style="font-size:14px;">発行日: 2025/03/14</small>
  767.                   </h2>
  768.                 </div>
  769.                 <!-- /.col -->
  770.               </div>
  771.               <!-- info row -->
  772.               <div class="row invoice-info">
  773.                 <div class="col-sm-8 invoice-col">
  774.                   <h3>お客様</h3>
  775.                   <span>下記の通り、お見積もり申し上げます。</span>
  776.                   <br />
  777.                   <br / >
  778.                   <br />
  779.                   <h2>お見積金額: <span id="mitsumori_kei">399,080円</span></h2>
  780.                   <span>
  781.                     <br/>
  782.                     <br/>
  783.                     <br/>
  784.                     <br/>
  785.                   </span>
  786.                 </div>
  787.                 <div class="col-sm-4 invoice-col">
  788.                   <p>
  789.                     <img alt="" src="/html/user_data/js/images/logo.png" style="width: 260px; max-width: 100%; max-height: 10mm;">
  790.                   </p>
  791.                   <p>有限会社プラス</p>
  792.                   <p>〒400-0334</p>
  793.                   <p>山梨県南アルプス市藤田1450番地2</p>
  794.                   <p>TEL: 055-284-6480</p>
  795.                   <img alt="" src="/html/user_data/js/images/seal.svg" style="z-index: 2; position: absolute; width: 21mm; left: 58mm; top: 36mm;">
  796.                 </div>
  797.                 <!-- /.col -->
  798.                 <!-- /.col -->
  799.               </div>
  800.               <!-- /.row -->
  801.               <!-- Table row -->
  802.               <div class="row">
  803.                 <div class="col-12 table-responsive">
  804.                   <table class="table table-striped">
  805.                     <thead>
  806.                       <tr>
  807.                         <th>項目</th>
  808.                         <th>数量</th>
  809.                         <th>単位</th>
  810.                         <th>単価</th>
  811.                         <th>小計</th>
  812.                       </tr>
  813.                     </thead>
  814.                     <tbody>
  815.                       <tr>
  816.                         <td>プレーンルーフ 600タイプ 1台用 単体セット</td>
  817.                         <td>1</td>
  818.                         <td>式</td>
  819.                         <td id="mitsumori_price_01">352,800</td>
  820.                         <td id="mitsumori_price_02">352,800</td>
  821.                       </tr>
  822.                       <tr>
  823.                         <td>基本工事費</td>
  824.                         <td>1</td>
  825.                         <td>式</td>
  826.                         <td id="mitsumori_ct_01">10,000</td>
  827.                         <td id="mitsumori_ct_02">10,000</td>
  828.                       </tr>
  829.                       <tr>
  830.                         <td>残土・ガラ処理</td>
  831.                         <td>1</td>
  832.                         <td>式</td>
  833.                         <td>0円</td>
  834.                         <td></td>
  835.                       </tr>
  836.                       <tr>
  837.                         <td> </td>
  838.                         <td></td>
  839.                         <td></td>
  840.                         <td></td>
  841.                         <td></td>
  842.                       </tr>
  843.                     </tbody>
  844.                   </table>
  845.                 </div>
  846.                 <!-- /.col -->
  847.               </div>
  848.               <!-- /.row -->
  849.               <div class="row">
  850.                 <!-- accepted payments column -->
  851.                 <div class="col-6">
  852.                   <p class="lead">お支払い方法</p>
  853.                   <p class="text-muted well well-sm shadow-none" style="margin-top: 10px;">銀行振込、クレジットカード決済、PAYPAY決済
  854.                     <br>銀行振込:山梨中央銀行 白根支店 普通口座 391402
  855.                     <br>※商品代金と工事代金の総額が金100万円(税込)を超える場合、着手金として代金の半額をご契約後お支払いいただきます。 
  856.                   </p>
  857.                 </div>
  858.                 <!-- /.col -->
  859.                 <div class="col-6">
  860.                   <div class="table-responsive">
  861.                     <table class="table">
  862.                       <tbody>
  863.                         <tr>
  864.                           <th style="width:50%">小計:</th>
  865.                           <td id="mitsumori_shoukei">362,800</td>
  866.                         </tr>
  867.                         <tr>
  868.                           <th>消費税 (10%)</th>
  869.                           <td id="mitsumori_tax">36,280</td>
  870.                         </tr>
  871.                         <tr>
  872.                           <th>合計:</th>
  873.                           <td id="mitsumori_goukei_02">399,080</td>
  874.                         </tr>
  875.                       </tbody>
  876.                     </table>
  877.                   </div>
  878.                 </div>
  879.                 <!-- /.col -->
  880.               </div>
  881.               <!-- /.row -->
  882.             </div>
  883.         </div>
  884.         <div class="modal-footer justify-content-between">
  885.                   <button type="button" class="btn btn-primary float-right" style="margin-right: 5px;">
  886.                     <i class="fas fa-download"></i>PDF出力
  887.                   </button>
  888.           <button type="button" class="btn btn-info" onclick="location.href='/contact?product={{ Product.id }}';">無料現地調査へ進む</button>
  889.         </div>
  890.       </div>
  891.       <!-- /.modal-content -->
  892.     </div>
  893.     <!-- /.modal-dialog -->
  894.   </div>
  895.   <!-- /.modal -->
  896. {% endblock %}