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: 30px;
  14.         }
  15.         .slick-dots {
  16.             position: absolute;
  17.             bottom: -45px;
  18.             display: block;
  19.             width: 100%;
  20.             padding: 0;
  21.             list-style: none;
  22.             text-align: center;
  23.         }
  24.         .slick-dots li {
  25.             position: relative;
  26.             display: inline-block;
  27.             width: 20px;
  28.             height: 20px;
  29.             margin: 0 5px;
  30.             padding: 0;
  31.             cursor: pointer;
  32.         }
  33.         .slick-dots li button {
  34.             font-size: 0;
  35.             line-height: 0;
  36.             display: block;
  37.             width: 20px;
  38.             height: 20px;
  39.             padding: 5px;
  40.             cursor: pointer;
  41.             color: transparent;
  42.             border: 0;
  43.             outline: none;
  44.             background: transparent;
  45.         }
  46.         .slick-dots li button:hover,
  47.         .slick-dots li button:focus {
  48.             outline: none;
  49.         }
  50.         .slick-dots li button:hover:before,
  51.         .slick-dots li button:focus:before {
  52.             opacity: 1;
  53.         }
  54.         .slick-dots li button:before {
  55.             content: " ";
  56.             line-height: 20px;
  57.             position: absolute;
  58.             top: 0;
  59.             left: 0;
  60.             width: 12px;
  61.             height: 12px;
  62.             text-align: center;
  63.             opacity: .25;
  64.             background-color: black;
  65.             border-radius: 50%;
  66.         }
  67.         .slick-dots li.slick-active button:before {
  68.             opacity: .75;
  69.             background-color: black;
  70.         }
  71.         .slick-dots li button.thumbnail img {
  72.             width: 0;
  73.             height: 0;
  74.         }
  75.         #form1 > .mb-3 {
  76.             visibility: hidden;
  77.             height:0;
  78.         }
  79.         form#form1 > div.mb-3:nth-child(4) {
  80.             visibility: visible;
  81.             height: auto;
  82.         }
  83.         /*#form1 > div:nth-child(14) {*/
  84.         /*    visibility: hidden;*/
  85.         /*}*/
  86.         #downloadSpinners {
  87.             display: block;
  88.             position: absolute;
  89.             left: 256px;
  90.             top: 256px;
  91.         }
  92.         #uchiwaCanvas {
  93.             background-color: #cccccc;
  94.             width: 90vW;
  95.             max-width: 512px;
  96.             margin-left: -20px;
  97.         }
  98.         .text-announce {
  99.             color: #ff0000;
  100.             font-weight: bold;
  101.         }
  102.         button#add-cart-button {
  103.             /*background-color:#ffffff;*/
  104.             color:#ffffff;
  105.         }
  106.         button#favorite {
  107.             background-color:#ffff00;
  108.             color:#666666;
  109.             border: 1px solid #aaaaaa;
  110.         }
  111.         button#favorite:hover {
  112.             background-color:#e6e600;
  113.             /*color:#000000;*/
  114.         }
  115.         @media (min-width: 768px) and (max-width: 1070px) {
  116.             #uchiwaCanvas {
  117.                 width: 45vW;
  118.             }
  119.         }
  120.     </style>
  121. {#    <link href="https://cdn.jsdelivr.net/npm/@mdi/font@5.x/css/materialdesignicons.min.css" rel="stylesheet">#}
  122. {#    <link href="https://cdn.jsdelivr.net/npm/vuetify@3.0/dist/vuetify.min.css" rel="stylesheet">#}
  123.     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vuetify@3.7.16/dist/vuetify.min.css" />
  124.     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css" />
  125.     <link rel="stylesheet" href="https://fonts.bunny.net/css?family=roboto:400,500,700" />
  126. {% endblock %}
  127. {% block javascript %}
  128. <script>
  129.     eccube.classCategories = {{ class_categories_as_json(Product)|raw }};
  130.         // 規格2に選択肢を割り当てる。
  131.         function fnSetClassCategories(form, classcat_id2_selected) {
  132.             var $form = $(form);
  133.             var product_id = $form.find('input[name=product_id]').val();
  134.             var $sele1 = $form.find('select[name=classcategory_id1]');
  135.             var $sele2 = $form.find('select[name=classcategory_id2]');
  136.             eccube.setClassCategories($form, product_id, $sele1, $sele2, classcat_id2_selected);
  137.         }
  138.         {% if form.classcategory_id2 is defined %}
  139.         fnSetClassCategories(
  140.             $('#form1'), {{ form.classcategory_id2.vars.value|json_encode|raw }}
  141.         );
  142.         {% elseif form.classcategory_id1 is defined %}
  143.         eccube.checkStock($('#form1'), {{ Product.id }}, {{ form.classcategory_id1.vars.value|json_encode|raw }}, null);
  144.         {% endif %}
  145.     </script>
  146.     <script>
  147.         $(function() {
  148.             // bfcache無効化
  149.             $(window).bind('pageshow', function(event) {
  150.                 if (event.originalEvent.persisted) {
  151.                     location.reload(true);
  152.                 }
  153.             });
  154.             // Core Web Vital の Cumulative Layout Shift(CLS)対策のため
  155.             // img タグに width, height が付与されている.
  156.             // 630px 未満の画面サイズでは縦横比が壊れるための対策
  157.             // see https://github.com/EC-CUBE/ec-cube/pull/5023
  158.             // $('.ec-grid2__cell').hide();
  159.             var removeSize = function () {
  160.                 $('.slide-item').height('');
  161.                 $('.slide-item img')
  162.                     .removeAttr('width')
  163.                     .removeAttr('height')
  164.                     .removeAttr('style');
  165.             };
  166.             var slickInitial = function(slick) {
  167.                 $('.ec-grid2__cell').fadeIn(1500);
  168.                 var baseHeight = $(slick.target).height();
  169.                 var baseWidth = $(slick.target).width();
  170.                 var rate = baseWidth / baseHeight;
  171.                 $('.slide-item').height(baseHeight * rate); // 余白を削除する
  172.                 // transform を使用することでCLSの影響を受けないようにする
  173.                 $('.slide-item img')
  174.                     .css(
  175.                         {
  176.                             'transform-origin': 'top left',
  177.                             'transform': 'scaleY(' + rate + ')',
  178.                             'transition': 'transform .1s'
  179.                         }
  180.                     );
  181.                 // 正しいサイズに近くなったら属性を解除する
  182.                 setTimeout(removeSize, 500);
  183.             };
  184.             $('.item_visual').on('init', slickInitial);
  185.             // リサイズ時は CLS の影響を受けないため属性を解除する
  186.             $(window).resize(removeSize);
  187.             $('.item_visual').slick({
  188.                 dots: false,
  189.                 arrows: false,
  190.                 responsive: [{
  191.                     breakpoint: 768,
  192.                     settings: {
  193.                         dots: true
  194.                     }
  195.                 }]
  196.             });
  197.             $('.slideThumb').on('click', function() {
  198.                 var index = $(this).attr('data-index');
  199.                 $('.item_visual').slick('slickGoTo', index, false);
  200.             })
  201.         });
  202.     </script>
  203.     <script>
  204.         $(function() {
  205.             $('.add-cart').on('click', function(event) {
  206.                     // console.log('set canvas image');
  207. //
  208. //     const c = document.getElementById('uchiwaCanvas');
  209. //
  210. //     c.toBlob(function(blob) {
  211. //     const imgFile = new File([blob], 'trimedfileupload.png', {type: "image/png"});
  212. //     const dt = new DataTransfer();
  213. //     dt.items.add(imgFile);
  214. //     const fileInput = document.getElementById("file");
  215. //     fileInput.files = dt.files;
  216. // });
  217.     // console.log('data is : ', c);
  218.     // const imgUrl = c.toDataURL();
  219.     // console.log('image is : ', imgUrl);
  220.     //
  221.     // let fd = new FormData($('#form1').get(0))
  222.     // fd.delete("file")
  223.     // fd.append("file", imgUrl )
  224.     // document.getElementById('file').value = imgUrl;
  225.                 {% if form.classcategory_id1 is defined %}
  226.                 // 規格1フォームの必須チェック
  227.                 if ($('#classcategory_id1').val() == '__unselected' || $('#classcategory_id1').val() == '') {
  228.                     $('#classcategory_id1')[0].setCustomValidity('{{ '項目が選択されていません'|trans }}');
  229.                     return true;
  230.                 } else {
  231.                     $('#classcategory_id1')[0].setCustomValidity('');
  232.                 }
  233.                 {% endif %}
  234.                 {% if form.classcategory_id2 is defined %}
  235.                 // 規格2フォームの必須チェック
  236.                 if ($('#classcategory_id2').val() == '__unselected' || $('#classcategory_id2').val() == '') {
  237.                     $('#classcategory_id2')[0].setCustomValidity('{{ '項目が選択されていません'|trans }}');
  238.                     return true;
  239.                 } else {
  240.                     $('#classcategory_id2')[0].setCustomValidity('');
  241.                 }
  242.                 {% endif %}
  243.                 // 個数フォームのチェック
  244.                 if ($('#quantity').val() < 1) {
  245.                     $('#quantity')[0].setCustomValidity('{{ '1以上で入力してください。'|trans }}');
  246.                     return true;
  247.                 } else {
  248.                     $('#quantity')[0].setCustomValidity('');
  249.                 }
  250.                 event.preventDefault();
  251.                 const $form = $('#form1');
  252.     const formData = new FormData($form.get(0));
  253.                 $.ajax({
  254.                     url: $form.attr('action'),
  255.                     type: $form.attr('method'),
  256.                     // data: $form.serialize(),
  257.                     data: formData,
  258.                     processData: false,
  259.                     // contentType: 'multipart/form-data',
  260.                     contentType: false,
  261.                     dataType: 'json',
  262.                     // async: false,
  263.                     beforeSend: function(xhr, settings) {
  264.                         // Buttonを無効にする
  265.                         $('.add-cart').prop('disabled', true);
  266.                     }
  267.                 }).done(function(data) {
  268.                     // レスポンス内のメッセージをalertで表示
  269.                     $.each(data.messages, function() {
  270.                         $('#ec-modal-header').text(this);
  271.                     });
  272.                     $('.ec-modal').show()
  273.                     // カートブロックを更新する
  274.                     $.ajax({
  275.                         url: "{{ url('block_cart') }}",
  276.                         type: 'GET',
  277.                         dataType: 'html'
  278.                     }).done(function(html) {
  279.                         $('.ec-headerRole__cart').html(html);
  280.                     });
  281.                 }).fail(function(data) {
  282.                     alert('{{ 'カートへの追加に失敗しました。'|trans }}');
  283.                 }).always(function(data) {
  284.                     // Buttonを有効にする
  285.                     $('.add-cart').prop('disabled', false);
  286.                 });
  287.             });
  288.         });
  289.         $('.ec-modal-wrap').on('click', function(e) {
  290.             // モーダル内の処理は外側にバブリングさせない
  291.             e.stopPropagation();
  292.         });
  293.         $('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function() {
  294.             $('.ec-modal').hide()
  295.         });
  296.         const sheet_size = '{{ Product.sheet_size }}';
  297.         const decoration_type = '{{ Product.product_decoration_type }}'
  298.     </script>
  299.     <script type="application/ld+json">
  300.     {
  301.         "@context": "https://schema.org/",
  302.         "@type": "Product",
  303.         "name": "{{ Product.name }}",
  304.         "image": [
  305.             {% for img in Product.ProductImage %}
  306.                 "{{ app.request.schemeAndHttpHost }}{{ asset(img, 'save_image') }}"{% if not loop.last %},{% endif %}
  307.             {% else %}
  308.                 "{{ app.request.schemeAndHttpHost }}{{ asset(''|no_image_product, 'save_image') }}"
  309.             {% endfor %}
  310.         ],
  311.         "description": "{{ Product.description_list | default(Product.description_detail) | replace({'\n': '', '\r': ''}) | slice(0,300) }}",
  312.         {% if Product.code_min %}
  313.         "sku": "{{ Product.code_min }}",
  314.         {% endif %}
  315.         "offers": {
  316.             "@type": "Offer",
  317.             "url": "{{ url('product_detail', {'id': Product.id}) }}",
  318.             "priceCurrency": "{{ eccube_config.currency }}",
  319.             "price": {{ Product.getPrice02IncTaxMin ? Product.getPrice02IncTaxMin : 0}},
  320.             "availability": "{{ Product.stock_find ? "InStock" : "OutOfStock" }}"
  321.         }
  322.     }
  323.     </script>
  324.     <script async src="https://ga.jspm.io/npm:es-module-shims@1.6.2/dist/es-module-shims.js"></script>
  325. {#<script type="importmap">#}
  326. {#  {#}
  327. {#    "imports": {#}
  328. {#      "vue": "https://cdn.jsdelivr.net/npm/vue@3.5.13/dist/vue.esm-browser.js",#}
  329. {#      "vuetify": "https://cdn.jsdelivr.net/npm/vuetify@3.7.12/dist/vuetify.esm.js"#}
  330. {#    }#}
  331. {#  }#}
  332. {#</script>#}
  333. {#<script src="https://unpkg.com/http-vue-loader"></script>#}
  334. {#<script src="https://cdn.jsdelivr.net/npm/vue3-sfc-loader@0.9.5/dist/vue3-sfc-loader.min.js"></script>#}
  335.     <script src="https://cdn.jsdelivr.net/npm/vue@3.5.13/dist/vue.global.min.js"></script>
  336.     <script src="https://cdn.jsdelivr.net/npm/vue3-sfc-loader/dist/vue3-sfc-loader.js"></script>
  337. <script src="https://cdn.jsdelivr.net/npm/vuetify@3.7.16/dist/vuetify.min.js"></script>
  338. {% endblock %}
  339. {% block main %}
  340.     {% set hasCategory = false %}
  341.     {% set hasFile = false %}
  342.     {% for ProductCategory in Product.ProductCategories %}
  343.         {% if ProductCategory.Category.id == 8 or ProductCategory.Category.id == 20 %}
  344.             {% if Product.product_input_type == 'on' %}
  345.                 {% set hasCategory = true %}
  346.             {% endif %}
  347.         {% endif %}
  348.         {%  if ProductCategory.Category.id == 23 %}
  349.         {% set hasFile = true %}
  350.         {% endif %}
  351.     {% endfor %}
  352.     <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,300..400,0..1,0&display=swap" media="print" onload="this.media='all'">
  353.     <div class="ec-productRole">
  354.         <div class="ec-grid2">
  355.             <div class="ec-grid2__cell">
  356.                 <div class="product-image">
  357.                     {% if hasCategory == true %}
  358.                         <div id="app"></div>
  359.                         <div class="uchiwa_img_wrapper" style="width:50%;margin: 20px">
  360.                             <canvas id="uchiwaCanvas" class="img_canvas" height="512" width="512"></canvas>
  361.                         </div>
  362.                         <div id="downloadSpinners">
  363.                             <svg class="q-spinner text-primary" width="4em" height="4em" viewBox="0 0 38 38"
  364.                                  xmlns="http://www.w3.org/2000/svg">
  365.                                 <defs>
  366.                                     <linearGradient x1="8.042%" y1="0%" x2="65.682%" y2="23.865%" id="a">
  367.                                         <stop stop-color="currentColor" stop-opacity="0" offset="0%"></stop>
  368.                                         <stop stop-color="currentColor" stop-opacity=".631" offset="63.146%"></stop>
  369.                                         <stop stop-color="currentColor" offset="100%"></stop>
  370.                                     </linearGradient>
  371.                                 </defs>
  372.                                 <g transform="translate(1 1)" fill="none" fill-rule="evenodd">
  373.                                     <path d="M36 18c0-9.94-8.06-18-18-18" stroke="url(#a)" stroke-width="2">
  374.                                         <animateTransform attributeName="transform" type="rotate" from="0 18 18"
  375.                                                           to="360 18 18" dur="0.9s"
  376.                                                           repeatCount="indefinite"></animateTransform>
  377.                                     </path>
  378.                                     <circle fill="currentColor" cx="36" cy="18" r="1">
  379.                                         <animateTransform attributeName="transform" type="rotate" from="0 18 18"
  380.                                                           to="360 18 18" dur="0.9s"
  381.                                                           repeatCount="indefinite"></animateTransform>
  382.                                     </circle>
  383.                                 </g>
  384.                             </svg><!----></div>
  385.                     {% endif %}
  386.                     {#                    {{ dump(Product) }} #}
  387.                     {#                    {{ dump(form) }} #}
  388.                     {#                    {% for choice in form.order_color1.choices %} #}
  389.                     {#                    {{ dump(choice) }} #}
  390.                     {#                    {% endfor %} #}
  391.                 </div>
  392.                 <div class="ec-sliderItemRole">
  393.                     {% if hasCategory == false %}
  394.                         <div class="item_visual">
  395.                             {% for ProductImage in Product.ProductImage %}
  396.                                 <div class="slide-item"><img src="{{ asset(ProductImage, 'save_image') }}"
  397.                                                              alt="{{ loop.first ? Product.name : '' }}" width="550"
  398.                                                              height="550"{% if loop.index > 1 %} loading="lazy"{% endif %}>
  399.                                 </div>
  400.                             {% else %}
  401.                                 <div class="slide-item"><img src="{{ asset(''|no_image_product, 'save_image') }}"
  402.                                                              alt="{{ loop.first ? Product.name : '' }}" width="550"
  403.                                                              height="550"></div>
  404.                             {% endfor %}
  405.                         </div>
  406.                         <div class="item_nav">
  407.                             {% for ProductImage in Product.ProductImage %}
  408.                                 <div class="slideThumb" data-index="{{ loop.index0 }}"><img
  409.                                             src="{{ asset(ProductImage, 'save_image') }}" alt="" width="133"
  410.                                             height="133"
  411.                                             loading="lazy"></div>
  412.                             {% endfor %}
  413.                         </div>
  414.                     {% endif %}
  415.                 </div>
  416.                 {% if hasCategory == true or hasFile == true %}
  417.                     <div style="margin-top: 120px;">
  418. {#                        <p class="text-announce">右側の項目でうちわのシミュレーションが確認できます。</p>#}
  419.                         {#                        <p>上の文字と下の文字は空白で左右の位置を調整できます<br>(スペースで左右の位置を調整できます)</p> #}
  420.                         <h4>ご注意</h4>
  421.                         <p class="text-announce">実際の商品は、仕上がりイメージと若干異なる場合があります</p>
  422.                     {% if hasCategory == true  %}
  423.                         <p class="text-announce">ひらがななどで全体が一枚でつながらない場合には、背景でつながるげることがあります</p>
  424.                     {% endif %}
  425.                     </div>
  426.                     <div>
  427.                         <img class="material__img" src="/ecshop/html/user_data/assets/img/material/color_basic1.jpg"
  428.                              alt="カラー一覧"><br>
  429.                         <img class="material__img" src="/ecshop/html/user_data/assets/img/material/color_basic2.jpg"
  430.                              alt="カラー一覧"><br>
  431.                         <img class="material__img" src="/ecshop/html/user_data/assets/img/material/color_basic3.jpg"
  432.                              alt="カラー一覧">
  433.                         <img class="material__img" src="/ecshop/html/user_data/assets/img/material/color_glitter1.jpg"
  434.                              alt="グリッターカラー一覧"><br>
  435.                         <img class="material__img" src="/ecshop/html/user_data/assets/img/material/use_font.jpg"
  436.                              alt="書体見本">
  437.                     </div>
  438.                 {% endif %}
  439.             </div>
  440.             <div class="ec-grid2__cell">
  441.                 <div class="ec-productRole__profile">
  442.                     {# 商品名 #}
  443.                     <div class="ec-productRole__title">
  444.                         <h2 class="ec-headingTitle">{{ Product.name }}</h2>
  445.                     </div>
  446.                     {#                    <div style="width: 50%;margin: 20px;display:none;"> #}
  447.                     {#                        <input type="text" id="uchiwa_up_text" name="uchiwa_up_text" value="未来"/><br/> #}
  448.                     {#                        <input type="text" id="uchiwa_main_text" name="uchiwa_main_text" value="看" #}
  449.                     {#                               style="width:100%;"/><br> #}
  450.                     {#                        <input type="text" id="uchiwa_low_text" name="uchiwa_lo_text" value="板"/><br/> #}
  451.                     {#                        <button id="uchiwa_set" type="button">再作画</button> #}
  452.                     {#                        <br/> #}
  453.                     {#                        一番外側の色: #}
  454.                     {#                        <select id="uchiwa_back_color1" name="back_color1"> #}
  455.                     {#                        </select> #}
  456.                     {#                        <br/> #}
  457.                     {#                        フチの外枠: #}
  458.                     {#                        <select id="uchiwa_back_color2" name="back_color2"> #}
  459.                     {#                        </select> #}
  460.                     {#                        <br/> #}
  461.                     {#                        フチの中: #}
  462.                     {#                        <select id="uchiwa_back_color3" name="back_color3"> #}
  463.                     {#                        </select> #}
  464.                     {#                        <br/> #}
  465.                     {#                        文字の色: #}
  466.                     {#                        <select id="uchiwa_back_color4" name="back_color4"> #}
  467.                     {#                        </select> #}
  468.                     {#                        <br/> #}
  469.                     {#                    </div> #}
  470.                     {# タグ #}
  471.                     <ul class="ec-productRole__tags">
  472.                         {% for Tag in Product.Tags %}
  473.                             <li class="ec-productRole__tag tag_{{ Tag.id }}">{{ Tag }}</li>
  474.                         {% endfor %}
  475.                     </ul>
  476.                     {# 通常価格 #}
  477.                     {% if Product.hasProductClass -%}
  478.                         <div class="ec-productRole__priceRegular">
  479.                             {% if Product.getPrice01Min is not null and Product.getPrice01IncTaxMin == Product.getPrice01IncTaxMax %}
  480.                                 <span class="ec-productRole__priceRegularPrice">{{ '通常価格'|trans }}:<span
  481.                                             class="price01-default">{{ Product.getPrice01IncTaxMin|price }}</span></span>
  482.                                 <span class="ec-productRole__priceRegularTax">{{ '税込'|trans }}</span>
  483.                             {% elseif Product.getPrice01Min is not null and Product.getPrice01Max is not null %}
  484.                                 <span class="ec-productRole__priceRegularPrice">{{ '通常価格'|trans }}:<span
  485.                                             class="price01-default">{{ Product.getPrice01IncTaxMin|price }}~ {{ Product.getPrice01IncTaxMax|price }}</span></span>
  486.                                 <span class="ec-productRole__priceRegularTax">{{ '税込'|trans }}</span>
  487.                             {% endif %}
  488.                         </div>
  489.                     {% else %}
  490.                         {% if Product.getPrice01Max is not null %}
  491.                             <span class="ec-productRole__priceRegularPrice">{{ '通常価格'|trans }}:{{ Product.getPrice01IncTaxMin|price }}</span>
  492.                             <span class="ec-productRole__priceRegularTax">{{ '税込'|trans }}</span>
  493.                         {% endif %}
  494.                     {% endif %}
  495.                     {# 販売価格 #}
  496.                     <div class="ec-productRole__price">
  497.                         {% if Product.hasProductClass -%}
  498.                             {% if Product.getPrice02IncTaxMin == Product.getPrice02IncTaxMax %}
  499.                                 <div class="ec-price">
  500.                                     <span class="ec-price__price price02-default">{{ Product.getPrice02IncTaxMin|price }}</span>
  501.                                     <span class="ec-price__tax">{{ '税込'|trans }}</span>
  502.                                 </div>
  503.                             {% else %}
  504.                                 <div class="ec-price">
  505.                                     <span class="ec-price__price price02-default">{{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}</span>
  506.                                     <span class="ec-price__tax">{{ '税込'|trans }}</span>
  507.                                 </div>
  508.                             {% endif %}
  509.                         {% else %}
  510.                             <div class="ec-price">
  511.                                 <span class="ec-price__price">{{ Product.getPrice02IncTaxMin|price }}</span>
  512.                                 <span class="ec-price__tax">{{ '税込'|trans }}</span>
  513.                             </div>
  514.                         {% endif %}
  515.                     </div>
  516.                     {# 商品コード #}
  517.                     {% if Product.code_min is not empty %}
  518.                         <div class="ec-productRole__code">
  519.                             {{ '商品コード'|trans }}: <span
  520.                                     class="product-code-default">{{ Product.code_min }}{% if Product.code_min != Product.code_max %} ~ {{ Product.code_max }}{% endif %}</span>
  521.                         </div>
  522.                     {% endif %}
  523.                     {# 関連カテゴリ #}
  524.                     {% if Product.ProductCategories is not empty %}
  525.                         <div class="ec-productRole__category">
  526.                             <div>{{ '関連カテゴリ'|trans }}</div>
  527.                             {% for ProductCategory in Product.ProductCategories %}
  528.                                 <ul>
  529.                                     <li>
  530.                                         {% for Category in ProductCategory.Category.path %}
  531.                                             <a href="{{ url('product_list') }}?category_id={{ Category.id }}">{{ Category.name }}</a> {%- if loop.last == false %}
  532.                                             <span>></span>{% endif -%}
  533.                                         {% endfor %}
  534.                                     </li>
  535.                                 </ul>
  536.                             {% endfor %}
  537.                         </div>
  538.                     {% endif %}
  539.                     <form action="{{ url('product_add_cart', {id:Product.id}) }}" method="post" id="form1" name="form1"
  540.                           enctype="multipart/form-data">
  541.                         {% if Product.stock_find %}
  542.                             <div class="ec-productRole__actions">
  543.                                 {% if form.classcategory_id1 is defined %}
  544.                                     <div class="ec-select">
  545.                                         {{ form_row(form.classcategory_id1) }}
  546.                                         {{ form_errors(form.classcategory_id1) }}
  547.                                     </div>
  548.                                     {% if form.classcategory_id2 is defined %}
  549.                                         <div class="ec-select">
  550.                                             {{ form_row(form.classcategory_id2) }}
  551.                                             {{ form_errors(form.classcategory_id2) }}
  552.                                         </div>
  553.                                     {% endif %}
  554.                                 {% endif %}
  555.                             </div>
  556. {#                            {% if hasFile %}#}
  557. {#                                <input type="file" id="file" name="file" class="form-control">#}
  558. {#                                {% endif %}#}
  559.                             {{ form_rest(form) }}
  560.                             <div class="ec-productRole__btn">
  561.                                 <button id="add-cart-button" type="submit" class="ec-blockBtn--action add-cart"
  562.                                         disabled>
  563.                                     {{ 'カートに入れる'|trans }}
  564.                                 </button>
  565.                             </div>
  566.                         {% else %}
  567.                             <div class="ec-productRole__btn">
  568.                                 <button type="button" class="ec-blockBtn--action" disabled="disabled">
  569.                                     {{ 'ただいま品切れ中です。'|trans }}
  570.                                 </button>
  571.                             </div>
  572.                         {% endif %}
  573.                         {#                        <div style="display: none"><input type="text" name="file" id="image_file"></div> #}
  574.                     </form>
  575.                     <div class="ec-modal">
  576.                         <div class="ec-modal-overlay">
  577.                             <div class="ec-modal-wrap">
  578.                                 <span class="ec-modal-close"><span class="ec-icon"><img
  579.                                                 src="{{ asset('assets/icon/cross-dark.svg') }}" alt=""/></span></span>
  580.                                 <div id="ec-modal-header" class="text-center">{{ 'カートに追加しました。'|trans }}</div>
  581.                                 <div class="ec-modal-box">
  582.                                     <div class="ec-role">
  583.                                         <span class="ec-inlineBtn--cancel">{{ 'お買い物を続ける'|trans }}</span>
  584.                                         <a href="{{ url('cart') }}"
  585.                                            class="ec-inlineBtn--action">{{ 'カートへ進む'|trans }}</a>
  586.                                     </div>
  587.                                 </div>
  588.                             </div>
  589.                         </div>
  590.                     </div>
  591.                     {% if BaseInfo.option_favorite_product %}
  592.                         <form action="{{ url('product_add_favorite', {id:Product.id}) }}" method="post">
  593.                             <div class="ec-productRole__btn">
  594.                                 {% if is_favorite == false %}
  595.                                     <button type="submit" id="favorite" class="ec-blockBtn--action">
  596.                                         {{ 'お気に入りに追加'|trans }}
  597.                                     </button>
  598.                                 {% else %}
  599.                                     <button type="submit" id="favorite" class="ec-blockBtn--action"
  600.                                             disabled="disabled">{{ 'お気に入りに追加済です。'|trans }}
  601.                                     </button>
  602.                                 {% endif %}
  603.                             </div>
  604.                         </form>
  605.                     {% endif %}
  606.                     <div class="ec-productRole__description">{{ Product.description_detail|raw|nl2br }}
  607.                     </div>
  608.                 </div>
  609.             </div>
  610.         </div>
  611.         {% if Product.freearea %}
  612.             <div class="ec-productRole__description">
  613.                 {{ include(template_from_string(Product.freearea)) }}
  614.             </div>
  615.         {% endif %}
  616.     </div>
  617.     {% if hasCategory == true %}
  618.         <script>
  619.                 const sheetSize = "{{ Product.sheet_size }}";
  620.             {#console.log('product test', "{{ Product.sheet_size }}" )#}
  621.             // https://mirai-kanban.com/ecshop/html/user_data/assets/js/test2.html
  622.             const product_color_type1 = '{{ Product.product_color_type1 }}'
  623.             const product_color_type2 = '{{ Product.product_color_type2 }}'
  624.             if ($('select#classcategory_id2').length > 0) {
  625.                 console.log('cat 2', $('select#classcategory_id2'))
  626.                 $('select#classcategory_id1 option:nth-child(2)').prop('selected', true);
  627.             }
  628.             // $('select#classcategory_id1').trigger('change');
  629.             // subChange();
  630.             // function subChange() {
  631.             //     const myData = $('select#classcategory_id1');
  632.             //     const $form = $('form#form1');
  633.             //     // var $form = myData.parents('form');
  634.             //     var product_id = $form.find('input[name=product_id]').val();
  635.             //     var $sele1 = myData;
  636.             //     var $sele2 = $form.find('select[name=classcategory_id2]');
  637.             //
  638.             //     // 規格1のみの場合
  639.             //     if (!$sele2.length) {
  640.             //         eccube.checkStock($form, product_id, $sele1.val(), null);
  641.             //         // 規格2ありの場合
  642.             //     } else {
  643.             //         eccube.setClassCategories($form, product_id, $sele1, $sele2);
  644.             //     }
  645.             // }
  646.         </script>
  647.         <script src="{{ asset('assets/js/mirai.js') }}"></script>
  648.         <script type="module">
  649.             // import { createApp, defineAsyncComponent } from 'vue';
  650.             // import { createVuetify } from 'vuetify';
  651.             // import {loadModule} from 'vue3-sfc-loader';
  652.             // const { loadModule } = window['vue3-sfc-loader'];
  653. // console.log('load modules');
  654.             // import {createVuetify} from 'vuetify'
  655.             // import { md2 } from 'vuetify/blueprints'
  656.             const vue3_sfc_loader_options = {
  657.                 moduleCache: { vue: Vue, vuetify: Vuetify.vuetify },
  658.                 getFile(url) {
  659.                     url = /.*?.js|.mjs|.css|.less|.vue$/.test(url)
  660.                         ? url
  661.                         : `${url}.vue`;
  662.                     const type = /.*?.js|.mjs$/.test(url)
  663.                         ? ".mjs"
  664.                         : /.*?.vue$/.test(url)
  665.                             ? ".vue"
  666.                             : /.*?.css$/.test(url)
  667.                                 ? ".css"
  668.                                 : ".vue";
  669.                     const getContentData = (asBinary) =>
  670.                         fetch(url).then((res) =>
  671.                             !res.ok
  672.                                 ? Promise.reject(url)
  673.                                 : asBinary
  674.                                     ? res.arrayBuffer()
  675.                                     : res.text()
  676.                         );
  677.                     return { getContentData: getContentData, type: type };
  678.                 },
  679.                 addStyle(textContent) {
  680.                     let styleElement = document.createElement("style");
  681.                     document.head.insertBefore(
  682.                         Object.assign(styleElement, { textContent }),
  683.                         document.head.getElementsByTagName("style")[0] || null
  684.                     );
  685.                 },
  686.                 handleModule(type, getContentData, path, options) {
  687.                     switch (type) {
  688.                         case ".css":
  689.                             return options.addStyle(getContentData(false));
  690.                         case ".less":
  691.                             console.error(".......");
  692.                     }
  693.                 },
  694.                 log(type, ...args) {
  695.                     console.log(type, ...args);
  696.                 },
  697.             };
  698.             const { loadModule } = window["vue3-sfc-loader"];
  699.             const app = Vue.createApp(
  700.                 Vue.defineAsyncComponent(
  701.                     () => loadModule("{{ asset('assets/vue/main.vue') }}", vue3_sfc_loader_options)
  702.                 ),
  703.             )
  704. // {{ asset('assets/vue/main.vue') }}
  705.             console.log('start vue');
  706.             // const vuetify = createVuetify();
  707.             // const app = createApp({
  708.             //     components: {
  709.             //         'my-component': defineAsyncComponent(() =>
  710.             //             loadModule(
  711.             //                 "assets/vue/main.vue",
  712.             //                 vue3_sfc_loader_options
  713.             //             )
  714.             //         ),
  715.             //     },
  716.             //     template: `<my-component />`,
  717.             // });
  718.             const { createVuetify } = Vuetify;
  719.             const vuetify = createVuetify({
  720.                 theme: {
  721.                     defaultTheme: 'light'
  722.                 },
  723.                 // blueprint: md2,
  724.             });
  725.             app.use(vuetify);
  726.             app.mount('#app');
  727.         </script>
  728.         <script type="module">
  729.             {#import { createApp, ref } from 'vue';#}
  730.             {#import { createVuetify } from 'vuetify';#}
  731.             {#import App from "{{ asset('assets/vue/app.js') }}";#}
  732.             {#const vuetify = createVuetify();#}
  733.             {#const app = createApp({App});#}
  734.             {#app.use(vuetify);#}
  735.             {#app.mount('#app');#}
  736.             // var vue = new Vue({
  737.             //     el: '#app',
  738.             //     components: {
  739.             //         'vc-main-1': httpVueLoader('assets/vue/main.vue')
  740.             //     }
  741.             // });
  742.         </script>
  743.     {% else %}
  744.         <script>
  745.             $('#add-cart-button').prop('disabled', false)
  746.         </script>
  747.     {% endif %}
  748.     <script>
  749.         $('label[for=quantity]').text('数量')
  750.     </script>
  751. {% endblock %}