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

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.                               <div class="icheck-danger d-inline">
  510.                                 <input type="radio" name="rp3" id="rp3_{{ Product.id }}" value="{{ Product.name }}" checked ><label for="rp3_{{ Product.id  }}">{{ base_select3 }}</label>
  511.                               </div>
  512.                               {% for rp_id, rp_name in related_product3 %}
  513.                               <div class="icheck-danger d-inline">
  514.                                 <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>
  515.                               </div>
  516.                               {% endfor %}
  517.                             </div>
  518.                           </div>
  519.                         </div>
  520.                         {% endif %}
  521.                         <div class="row" style="border-bottom:1px solid rgba(0,0,0,.125)"><label class="col-12 col-form-label">この商品のカラー、サイズ、素材を選択してください。</label></div>
  522.                         {% if color and color|length %}
  523.                         <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  524.                           <label class="col-4 col-form-label mt-2">カラー</label>
  525.                           <div class="col-8 mt-2">
  526.                             <div class="form-group clearfix">
  527.                             {% set idx = 0 %}
  528.                             {% for cc in color %}
  529.                               {% if cc and cc['name'] %}
  530.                               {% set idx = idx + 1 %}
  531.                               <div class="icheck-danger d-inline">
  532.                                 <input type="radio" name="color" id="cc_{{ idx }}" value="{{ cc['name'] }}" onclick="mitsumori_simulation('pc','cc_{{ idx }}');"><label for="cc_{{ idx }}">{{ cc['name'] }}</label>
  533.                               </div>
  534.                               {% endif %}
  535.                             {% endfor %}
  536.                             </div>
  537.                           </div>
  538.                         </div>
  539.                         {% endif %}
  540.                         {% if p_w and p_w|length %}
  541.                         <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  542.                           <label class="col-4 col-form-label">幅</label>
  543.                           <div class="col-8">
  544.                             <div class="form-group clearfix">
  545.                             {% set idx = 0 %}
  546.                             {% for pw in p_w %}
  547.                               {% if pw %}
  548.                               {% set idx = idx + 1 %}
  549.                               <div class="icheck-danger d-inline">
  550.                                 <input type="radio" name="pw" id="pw_{{ idx }}" value="{{ pw }}" onclick="mitsumori_simulation('pw','pw_{{ idx }}');"><label for="pw_{{ idx }}">{{ pw }}</label>
  551.                               </div>
  552.                               {% endif %}
  553.                             {% endfor %}
  554.                             </div>
  555.                           </div>
  556.                         </div>
  557.                         {% endif %}
  558.                         {% if p_d and p_d|length %}
  559.                         <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  560.                           <label class="col-4 col-form-label">奥行き</label>
  561.                           <div class="col-8">
  562.                             <div class="form-group clearfix">
  563.                             {% set idx = 0 %}
  564.                             {% for pd in p_d %}
  565.                               {% if pd %}
  566.                               {% set idx = idx + 1 %}
  567.                               <div class="icheck-danger d-inline">
  568.                                 <input type="radio" name="pd" id="pd_{{ idx }}" value="{{ pd }}" onclick="mitsumori_simulation('pd','pd_{{ idx }}');"><label for="pd_{{ idx }}">{{ pd }}</label>
  569.                               </div>
  570.                               {% endif %}
  571.                             {% endfor %}
  572.                             </div>
  573.                           </div>
  574.                         </div>
  575.                         {% endif %}
  576.                         {% if p_h and p_h|length %}
  577.                         <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  578.                           <label class="col-4 col-form-label">高さ</label>
  579.                           <div class="col-8">
  580.                             <div class="form-group clearfix">
  581.                             {% set idx = 0 %}
  582.                             {% for ph in p_h %}
  583.                               {% if ph %}
  584.                               {% set idx = idx + 1 %}
  585.                               <div class="icheck-danger d-inline">
  586.                                 <input type="radio" name="ph" id="ph_{{ idx }}" value="{{ ph }}" onclick="mitsumori_simulation('ph','ph_{{ idx }}');"><label for="ph_{{ idx }}">{{ ph }}</label>
  587.                               </div>
  588.                               {% endif %}
  589.                             {% endfor %}
  590.                             </div>
  591.                           </div>
  592.                         </div>
  593.                         {% endif %}
  594.                         {% if p_w and p_w|length %}
  595.                         <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  596.                           <label class="col-4 col-form-label">素材</label>
  597.                           <div class="col-8">
  598.                             <div class="form-group clearfix">
  599.                             {% set idx = 0 %}
  600.                             {% for pm in p_m %}
  601.                               {% if pm %}
  602.                               {% set idx = idx + 1 %}
  603.                               <div class="icheck-danger d-inline">
  604.                                 <input type="radio" name="pm" id="pm_{{ idx }}" value="{{ pm }}" onclick="mitsumori_simulation('pm','pm_{{ idx }}');"><label for="pm_{{ idx }}">{{ pm }}</label>
  605.                               </div>
  606.                               {% endif %}
  607.                             {% endfor %}
  608.                             </div>
  609.                           </div>
  610.                         </div>
  611.                         {% endif %}
  612.                         <div class="row" style="border-bottom:1px solid rgba(0,0,0,.125)"><label class="col-12 col-form-label">取り付け工事のご希望に関してお答えください。</label></div>
  613.                         {% for i in 0..10 %}
  614.                             {% if op and op|length >= i+1 %}
  615.                             {% if op[i]['name'] %}
  616.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  617.                               <label class="col-4 col-form-label">{{ op[i]['name'] }}</label>
  618.                               <div class="col-8">
  619.                                 {{ op[i]['comment'] }}
  620.                                 <div class="form-group clearfix">
  621.                                   <div class="icheck-danger d-inline">
  622.                                     <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>
  623.                                   </div>
  624.                                 </div>
  625.                                 <div class="form-group clearfix">
  626.                                   <div class="icheck-danger d-inline">
  627.                                     <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>
  628.                                   </div>
  629.                                 </div>
  630.                               </div>
  631.                             </div>
  632.                             {% endif %}
  633.                             {% endif %}
  634.                         {% endfor %}
  635.                       </div>
  636.                       <!-- /.card-body -->
  637.                     </div>
  638.                     <form action="{{ url('product_add_cart', {id:Product.id}) }}" method="post" id="form1" name="form1">
  639.                         {% if Product.stock_find %}
  640.                             <div class="ec-productRole__actions">
  641.                                 {% if form.classcategory_id1 is defined %}
  642.                                     <div class="ec-select">
  643.                                         {{ form_row(form.classcategory_id1) }}
  644.                                         {{ form_errors(form.classcategory_id1) }}
  645.                                     </div>
  646.                                     {% if form.classcategory_id2 is defined %}
  647.                                         <div class="ec-select">
  648.                                             {{ form_row(form.classcategory_id2) }}
  649.                                             {{ form_errors(form.classcategory_id2) }}
  650.                                         </div>
  651.                                     {% endif %}
  652.                                 {% endif %}
  653.                                 <div class="ec-numberInput">
  654.                                     {{ form_widget(form.quantity, { type: 'hidden' }) }}
  655.                                     {{ form_errors(form.quantity) }}
  656.                                 </div>
  657.                             </div>
  658.                             {% if ProductClass.SaleType.id != 9 %}
  659.                             <div class="ec-productRole__btn">
  660.                             </div>
  661.                             {% else %}
  662.                             <div class="ec-productRole__btn">
  663.                                 <button type="submit" class="ec-blockBtn--action add-cart">
  664.                                     {{ 'カートに入れる'|trans }}
  665.                                 </button>
  666.                             </div>
  667.                             {% endif %}
  668.                         {% else %}
  669.                             <div class="ec-productRole__btn">
  670.                                 <button type="button" class="ec-blockBtn--action" disabled="disabled">
  671.                                     {{ 'ただいま品切れ中です。'|trans }}
  672.                                 </button>
  673.                             </div>
  674.                         {% endif %}
  675.                         {{ form_rest(form) }}
  676.                     </form>
  677.                     <div class="ec-modal">
  678.                         <div class="ec-modal-overlay">
  679.                             <div class="ec-modal-wrap">
  680.                                 <span class="ec-modal-close"><span class="ec-icon"><img src="{{ asset('assets/icon/cross-dark.svg') }}" alt=""/></span></span>
  681.                                 <div id="ec-modal-header" class="text-center">{{ 'カートに追加しました。'|trans }}</div>
  682.                                 <div class="ec-modal-box">
  683.                                     <div class="ec-role">
  684.                                         <span class="ec-inlineBtn--cancel">{{ 'お買い物を続ける'|trans }}</span>
  685.                                         <a href="{{ url('cart') }}" class="ec-inlineBtn--action">{{ 'カートへ進む'|trans }}</a>
  686.                                     </div>
  687.                                 </div>
  688.                             </div>
  689.                         </div>
  690.                     </div>
  691.                     <div class="ec-productRole__description">{{ Product.description_detail|raw|nl2br }}
  692.                     </div>
  693.                 </div>
  694.                 <div class="card col-12 collapsed-card sticky-top float-right">
  695.                     <div class="card-header">
  696.                       <h3 class="card-title">現在のお見積り額</h3>
  697.                       <div class="card-tools">
  698.                         <span class="float-left" id="mitsumori_message">395000円</span>
  699.                         <button type="button" class="btn btn-tool" data-card-widget="collapse">
  700.                           <i class="fas fa-plus"></i>
  701.                         </button>
  702.                       </div>
  703.                     </div>
  704.                     <div class="card-body p-0">
  705.                       <ul class="nav nav-pills flex-column">
  706.                         <li class="nav-item active">
  707.                           <a class="nav-link">
  708.                             <i class="far fa-file-alt"></i> 合計(工事費・税込)
  709.                             <span class="float-right" id="mitsumori_goukei">395,000円</span>
  710.                           </a>
  711.                         </li>
  712.                         <li class="nav-item active">
  713.                           <a class="nav-link">
  714.                             <i class="far fa-file-alt"></i> 商品価格
  715.                             <span class="float-right" id="mitsumori_price">307,008円</span>
  716.                           </a>
  717.                         </li>
  718.                         <li class="nav-item">
  719.                           <a class="nav-link">
  720.                             &nbsp;&nbsp;<i class="far fa-file-alt"></i> カタログ価格
  721.                             <span class="float-right" id="maker_price">479,700円</span>
  722.                           </a>
  723.                         </li>
  724.                         <li class="nav-item">
  725.                           <a class="nav-link">
  726.                             &nbsp;&nbsp;<i class="far fa-file-alt"></i> お値引き
  727.                             <span class="float-right" id="mitsumori_off">-172,692円</span>
  728.                           </a>
  729.                         </li>
  730.                         <li class="nav-item">
  731.                           <a class="nav-link">
  732.                             <i class="far fa-file-alt"></i> 基本工事費
  733.                             <span class="float-right" id="mitsumori_ct">53,250円</span>
  734.                           </a>
  735.                         </li>
  736.                         <li class="nav-item">
  737.                           <a class="nav-link">
  738.                             <i class="far fa-file-alt"></i> 施工オプション
  739.                             <span class="float-right"id="mitsumori_option">6,297円</span>
  740.                           </a>
  741.                         </li>
  742.                       </ul>
  743.                     </div>
  744.                     <div class="card-footer">
  745.                         <button type="button" id="mitsumori_btn" class="btn btn-info" data-toggle="modal" data-target="#modal-mitsumori">
  746.                           見積書表示
  747.                         </button>
  748.                         <button id="contact" class="btn btn-info" onclick="location.href='/contact?product={{ Product.id }}';">無料現地調査へ進む</button>
  749.                     </div>
  750.                 </div>
  751.             </div>
  752.         </div>
  753.     </div>
  754.   <div class="modal" id="modal-mitsumori">
  755.     <div class="modal-dialog modal-mitsumori" style="max-width:1000px">
  756.       <div class="modal-content">
  757.         <div class="modal-header">
  758.           <h4 class="modal-title">お見積書</h4>
  759.           <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  760.             <span aria-hidden="true">&times;</span>
  761.           </button>
  762.         </div>
  763.         <div class="modal-body">
  764.             <div class="invoice p-3 mb-5" style="max-width:1000px; margin:auto;">
  765.               <!-- title row -->
  766.               <div class="row">
  767.                 <div class="col-12">
  768.                   <h2>概算お見積書 
  769.                     <small class="float-right" style="font-size:14px;">発行日: 2025/03/14</small>
  770.                   </h2>
  771.                 </div>
  772.                 <!-- /.col -->
  773.               </div>
  774.               <!-- info row -->
  775.               <div class="row invoice-info">
  776.                 <div class="col-sm-8 invoice-col">
  777.                   <h3>お客様</h3>
  778.                   <span>下記の通り、お見積もり申し上げます。</span>
  779.                   <br />
  780.                   <br / >
  781.                   <br />
  782.                   <h2>お見積金額: <span id="mitsumori_kei">399,080円</span></h2>
  783.                   <span>
  784.                     <br/>
  785.                     <br/>
  786.                     <br/>
  787.                     <br/>
  788.                   </span>
  789.                 </div>
  790.                 <div class="col-sm-4 invoice-col">
  791.                   <p>
  792.                     <img alt="" src="/html/user_data/js/images/logo.png" style="width: 260px; max-width: 100%; max-height: 10mm;">
  793.                   </p>
  794.                   <p>有限会社プラス</p>
  795.                   <p>〒400-0334</p>
  796.                   <p>山梨県南アルプス市藤田1450番地2</p>
  797.                   <p>TEL: 055-284-6480</p>
  798.                   <img alt="" src="/html/user_data/js/images/seal.svg" style="z-index: 2; position: absolute; width: 21mm; left: 58mm; top: 36mm;">
  799.                 </div>
  800.                 <!-- /.col -->
  801.                 <!-- /.col -->
  802.               </div>
  803.               <!-- /.row -->
  804.               <!-- Table row -->
  805.               <div class="row">
  806.                 <div class="col-12 table-responsive">
  807.                   <table class="table table-striped">
  808.                     <thead>
  809.                       <tr>
  810.                         <th>項目</th>
  811.                         <th>数量</th>
  812.                         <th>単位</th>
  813.                         <th>単価</th>
  814.                         <th>小計</th>
  815.                       </tr>
  816.                     </thead>
  817.                     <tbody>
  818.                       <tr>
  819.                         <td>プレーンルーフ 600タイプ 1台用 単体セット</td>
  820.                         <td>1</td>
  821.                         <td>式</td>
  822.                         <td id="mitsumori_price_01">352,800</td>
  823.                         <td id="mitsumori_price_02">352,800</td>
  824.                       </tr>
  825.                       <tr>
  826.                         <td>基本工事費</td>
  827.                         <td>1</td>
  828.                         <td>式</td>
  829.                         <td id="mitsumori_ct_01">10,000</td>
  830.                         <td id="mitsumori_ct_02">10,000</td>
  831.                       </tr>
  832.                       <tr>
  833.                         <td>残土・ガラ処理</td>
  834.                         <td>1</td>
  835.                         <td>式</td>
  836.                         <td>0円</td>
  837.                         <td></td>
  838.                       </tr>
  839.                       <tr>
  840.                         <td> </td>
  841.                         <td></td>
  842.                         <td></td>
  843.                         <td></td>
  844.                         <td></td>
  845.                       </tr>
  846.                     </tbody>
  847.                   </table>
  848.                 </div>
  849.                 <!-- /.col -->
  850.               </div>
  851.               <!-- /.row -->
  852.               <div class="row">
  853.                 <!-- accepted payments column -->
  854.                 <div class="col-6">
  855.                   <p class="lead">お支払い方法</p>
  856.                   <p class="text-muted well well-sm shadow-none" style="margin-top: 10px;">銀行振込、クレジットカード決済、PAYPAY決済
  857.                     <br>銀行振込:山梨中央銀行 白根支店 普通口座 391402
  858.                     <br>※商品代金と工事代金の総額が金100万円(税込)を超える場合、着手金として代金の半額をご契約後お支払いいただきます。 
  859.                   </p>
  860.                 </div>
  861.                 <!-- /.col -->
  862.                 <div class="col-6">
  863.                   <div class="table-responsive">
  864.                     <table class="table">
  865.                       <tbody>
  866.                         <tr>
  867.                           <th style="width:50%">小計:</th>
  868.                           <td id="mitsumori_shoukei">362,800</td>
  869.                         </tr>
  870.                         <tr>
  871.                           <th>消費税 (10%)</th>
  872.                           <td id="mitsumori_tax">36,280</td>
  873.                         </tr>
  874.                         <tr>
  875.                           <th>合計:</th>
  876.                           <td id="mitsumori_goukei_02">399,080</td>
  877.                         </tr>
  878.                       </tbody>
  879.                     </table>
  880.                   </div>
  881.                 </div>
  882.                 <!-- /.col -->
  883.               </div>
  884.               <!-- /.row -->
  885.             </div>
  886.         </div>
  887.         <div class="modal-footer justify-content-between">
  888.                   <button type="button" class="btn btn-primary float-right" style="margin-right: 5px;">
  889.                     <i class="fas fa-download"></i>PDF出力
  890.                   </button>
  891.           <button type="button" class="btn btn-info" onclick="location.href='/contact?product={{ Product.id }}';">無料現地調査へ進む</button>
  892.         </div>
  893.       </div>
  894.       <!-- /.modal-content -->
  895.     </div>
  896.     <!-- /.modal-dialog -->
  897.   </div>
  898.   <!-- /.modal -->
  899. {% endblock %}