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 > div:nth-child(14) {
  76.             visibility: hidden;
  77.         }
  78.         #downloadSpinners {
  79.             display: block;
  80.             position: absolute;
  81.             left: 256px;
  82.             top: 256px;
  83.         }
  84.         #uchiwaCanvas {
  85.             background-color: #cccccc;
  86.             width: 90vW;
  87.             max-width: 512px;
  88.             margin-left: -20px;
  89.         }
  90.         .text-announce {
  91.             color: #ff0000;
  92.             font-weight: bold;
  93.         }
  94.         @media (min-width: 768px) and (max-width: 1070px) {
  95.             #uchiwaCanvas {
  96.                 width: 45vW;
  97.             }
  98.         }
  99.     </style>
  100. {% endblock %}
  101. {% block javascript %}
  102. <script>
  103.     eccube.classCategories = {{ class_categories_as_json(Product)|raw }};
  104.         // 規格2に選択肢を割り当てる。
  105.         function fnSetClassCategories(form, classcat_id2_selected) {
  106.             var $form = $(form);
  107.             var product_id = $form.find('input[name=product_id]').val();
  108.             var $sele1 = $form.find('select[name=classcategory_id1]');
  109.             var $sele2 = $form.find('select[name=classcategory_id2]');
  110.             eccube.setClassCategories($form, product_id, $sele1, $sele2, classcat_id2_selected);
  111.         }
  112.         {% if form.classcategory_id2 is defined %}
  113.         fnSetClassCategories(
  114.             $('#form1'), {{ form.classcategory_id2.vars.value|json_encode|raw }}
  115.         );
  116.         {% elseif form.classcategory_id1 is defined %}
  117.         eccube.checkStock($('#form1'), {{ Product.id }}, {{ form.classcategory_id1.vars.value|json_encode|raw }}, null);
  118.         {% endif %}
  119.     </script>
  120.     <script>
  121.         $(function() {
  122.             // bfcache無効化
  123.             $(window).bind('pageshow', function(event) {
  124.                 if (event.originalEvent.persisted) {
  125.                     location.reload(true);
  126.                 }
  127.             });
  128.             // Core Web Vital の Cumulative Layout Shift(CLS)対策のため
  129.             // img タグに width, height が付与されている.
  130.             // 630px 未満の画面サイズでは縦横比が壊れるための対策
  131.             // see https://github.com/EC-CUBE/ec-cube/pull/5023
  132.             // $('.ec-grid2__cell').hide();
  133.             var removeSize = function () {
  134.                 $('.slide-item').height('');
  135.                 $('.slide-item img')
  136.                     .removeAttr('width')
  137.                     .removeAttr('height')
  138.                     .removeAttr('style');
  139.             };
  140.             var slickInitial = function(slick) {
  141.                 $('.ec-grid2__cell').fadeIn(1500);
  142.                 var baseHeight = $(slick.target).height();
  143.                 var baseWidth = $(slick.target).width();
  144.                 var rate = baseWidth / baseHeight;
  145.                 $('.slide-item').height(baseHeight * rate); // 余白を削除する
  146.                 // transform を使用することでCLSの影響を受けないようにする
  147.                 $('.slide-item img')
  148.                     .css(
  149.                         {
  150.                             'transform-origin': 'top left',
  151.                             'transform': 'scaleY(' + rate + ')',
  152.                             'transition': 'transform .1s'
  153.                         }
  154.                     );
  155.                 // 正しいサイズに近くなったら属性を解除する
  156.                 setTimeout(removeSize, 500);
  157.             };
  158.             $('.item_visual').on('init', slickInitial);
  159.             // リサイズ時は CLS の影響を受けないため属性を解除する
  160.             $(window).resize(removeSize);
  161.             $('.item_visual').slick({
  162.                 dots: false,
  163.                 arrows: false,
  164.                 responsive: [{
  165.                     breakpoint: 768,
  166.                     settings: {
  167.                         dots: true
  168.                     }
  169.                 }]
  170.             });
  171.             $('.slideThumb').on('click', function() {
  172.                 var index = $(this).attr('data-index');
  173.                 $('.item_visual').slick('slickGoTo', index, false);
  174.             })
  175.         });
  176.     </script>
  177.     <script>
  178.         $(function() {
  179.             $('.add-cart').on('click', function(event) {
  180.                     // console.log('set canvas image');
  181. //
  182. //     const c = document.getElementById('uchiwaCanvas');
  183. //
  184. //     c.toBlob(function(blob) {
  185. //     const imgFile = new File([blob], 'trimedfileupload.png', {type: "image/png"});
  186. //     const dt = new DataTransfer();
  187. //     dt.items.add(imgFile);
  188. //     const fileInput = document.getElementById("file");
  189. //     fileInput.files = dt.files;
  190. // });
  191.     // console.log('data is : ', c);
  192.     // const imgUrl = c.toDataURL();
  193.     // console.log('image is : ', imgUrl);
  194.     //
  195.     // let fd = new FormData($('#form1').get(0))
  196.     // fd.delete("file")
  197.     // fd.append("file", imgUrl )
  198.     // document.getElementById('file').value = imgUrl;
  199.                 {% if form.classcategory_id1 is defined %}
  200.                 // 規格1フォームの必須チェック
  201.                 if ($('#classcategory_id1').val() == '__unselected' || $('#classcategory_id1').val() == '') {
  202.                     $('#classcategory_id1')[0].setCustomValidity('{{ '項目が選択されていません'|trans }}');
  203.                     return true;
  204.                 } else {
  205.                     $('#classcategory_id1')[0].setCustomValidity('');
  206.                 }
  207.                 {% endif %}
  208.                 {% if form.classcategory_id2 is defined %}
  209.                 // 規格2フォームの必須チェック
  210.                 if ($('#classcategory_id2').val() == '__unselected' || $('#classcategory_id2').val() == '') {
  211.                     $('#classcategory_id2')[0].setCustomValidity('{{ '項目が選択されていません'|trans }}');
  212.                     return true;
  213.                 } else {
  214.                     $('#classcategory_id2')[0].setCustomValidity('');
  215.                 }
  216.                 {% endif %}
  217.                 // 個数フォームのチェック
  218.                 if ($('#quantity').val() < 1) {
  219.                     $('#quantity')[0].setCustomValidity('{{ '1以上で入力してください。'|trans }}');
  220.                     return true;
  221.                 } else {
  222.                     $('#quantity')[0].setCustomValidity('');
  223.                 }
  224.                 event.preventDefault();
  225.                 const $form = $('#form1');
  226.     const formData = new FormData($form.get(0));
  227.                 $.ajax({
  228.                     url: $form.attr('action'),
  229.                     type: $form.attr('method'),
  230.                     // data: $form.serialize(),
  231.                     data: formData,
  232.                     processData: false,
  233.                     // contentType: 'multipart/form-data',
  234.                     contentType: false,
  235.                     dataType: 'json',
  236.                     // async: false,
  237.                     beforeSend: function(xhr, settings) {
  238.                         // Buttonを無効にする
  239.                         $('.add-cart').prop('disabled', true);
  240.                     }
  241.                 }).done(function(data) {
  242.                     // レスポンス内のメッセージをalertで表示
  243.                     $.each(data.messages, function() {
  244.                         $('#ec-modal-header').text(this);
  245.                     });
  246.                     $('.ec-modal').show()
  247.                     // カートブロックを更新する
  248.                     $.ajax({
  249.                         url: "{{ url('block_cart') }}",
  250.                         type: 'GET',
  251.                         dataType: 'html'
  252.                     }).done(function(html) {
  253.                         $('.ec-headerRole__cart').html(html);
  254.                     });
  255.                 }).fail(function(data) {
  256.                     alert('{{ 'カートへの追加に失敗しました。'|trans }}');
  257.                 }).always(function(data) {
  258.                     // Buttonを有効にする
  259.                     $('.add-cart').prop('disabled', false);
  260.                 });
  261.             });
  262.         });
  263.         $('.ec-modal-wrap').on('click', function(e) {
  264.             // モーダル内の処理は外側にバブリングさせない
  265.             e.stopPropagation();
  266.         });
  267.         $('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function() {
  268.             $('.ec-modal').hide()
  269.         });
  270.         const sheet_size = '{{ Product.sheet_size }}';
  271.     </script>
  272.     <script type="application/ld+json">
  273.     {
  274.         "@context": "https://schema.org/",
  275.         "@type": "Product",
  276.         "name": "{{ Product.name }}",
  277.         "image": [
  278.             {% for img in Product.ProductImage %}
  279.                 "{{ app.request.schemeAndHttpHost }}{{ asset(img, 'save_image') }}"{% if not loop.last %},{% endif %}
  280.             {% else %}
  281.                 "{{ app.request.schemeAndHttpHost }}{{ asset(''|no_image_product, 'save_image') }}"
  282.             {% endfor %}
  283.         ],
  284.         "description": "{{ Product.description_list | default(Product.description_detail) | replace({'\n': '', '\r': ''}) | slice(0,300) }}",
  285.         {% if Product.code_min %}
  286.         "sku": "{{ Product.code_min }}",
  287.         {% endif %}
  288.         "offers": {
  289.             "@type": "Offer",
  290.             "url": "{{ url('product_detail', {'id': Product.id}) }}",
  291.             "priceCurrency": "{{ eccube_config.currency }}",
  292.             "price": {{ Product.getPrice02IncTaxMin ? Product.getPrice02IncTaxMin : 0}},
  293.             "availability": "{{ Product.stock_find ? "InStock" : "OutOfStock" }}"
  294.         }
  295.     }
  296.     </script>
  297. {% endblock %}
  298. {% block main %}
  299.     {% set hasCategory = false %}
  300.     {% for ProductCategory in Product.ProductCategories %}
  301.         {% if ProductCategory.Category.id == 8 or ProductCategory.Category.id == 20 %}
  302.             {% if Product.product_input_type == 'on' %}
  303.                 {% set hasCategory = true %}
  304.             {% endif %}
  305.         {% endif %}
  306.     {% endfor %}
  307.     <div class="ec-productRole">
  308.         <div class="ec-grid2">
  309.             <div class="ec-grid2__cell">
  310.                 <div class="product-image">
  311.                     {% if hasCategory == true %}
  312.                         <div class="uchiwa_img_wrapper" style="width:50%;margin: 20px">
  313.                             <canvas id="uchiwaCanvas" class="img_canvas" height="512" width="512"></canvas>
  314.                         </div>
  315.                         <div id="downloadSpinners">
  316.                             <svg class="q-spinner text-primary" width="4em" height="4em" viewBox="0 0 38 38"
  317.                                  xmlns="http://www.w3.org/2000/svg">
  318.                                 <defs>
  319.                                     <linearGradient x1="8.042%" y1="0%" x2="65.682%" y2="23.865%" id="a">
  320.                                         <stop stop-color="currentColor" stop-opacity="0" offset="0%"></stop>
  321.                                         <stop stop-color="currentColor" stop-opacity=".631" offset="63.146%"></stop>
  322.                                         <stop stop-color="currentColor" offset="100%"></stop>
  323.                                     </linearGradient>
  324.                                 </defs>
  325.                                 <g transform="translate(1 1)" fill="none" fill-rule="evenodd">
  326.                                     <path d="M36 18c0-9.94-8.06-18-18-18" stroke="url(#a)" stroke-width="2">
  327.                                         <animateTransform attributeName="transform" type="rotate" from="0 18 18"
  328.                                                           to="360 18 18" dur="0.9s"
  329.                                                           repeatCount="indefinite"></animateTransform>
  330.                                     </path>
  331.                                     <circle fill="currentColor" cx="36" cy="18" r="1">
  332.                                         <animateTransform attributeName="transform" type="rotate" from="0 18 18"
  333.                                                           to="360 18 18" dur="0.9s"
  334.                                                           repeatCount="indefinite"></animateTransform>
  335.                                     </circle>
  336.                                 </g>
  337.                             </svg><!----></div>
  338.                     {% endif %}
  339.                     {#                    {{ dump(Product) }} #}
  340.                     {#                    {{ dump(form) }} #}
  341.                     {#                    {% for choice in form.order_color1.choices %} #}
  342.                     {#                    {{ dump(choice) }} #}
  343.                     {#                    {% endfor %} #}
  344.                 </div>
  345.                 <div class="ec-sliderItemRole">
  346.                     {% if hasCategory == false %}
  347.                         <div class="item_visual">
  348.                             {% for ProductImage in Product.ProductImage %}
  349.                                 <div class="slide-item"><img src="{{ asset(ProductImage, 'save_image') }}"
  350.                                                              alt="{{ loop.first ? Product.name : '' }}" width="550"
  351.                                                              height="550"{% if loop.index > 1 %} loading="lazy"{% endif %}>
  352.                                 </div>
  353.                             {% else %}
  354.                                 <div class="slide-item"><img src="{{ asset(''|no_image_product, 'save_image') }}"
  355.                                                              alt="{{ loop.first ? Product.name : '' }}" width="550"
  356.                                                              height="550"></div>
  357.                             {% endfor %}
  358.                         </div>
  359.                         <div class="item_nav">
  360.                             {% for ProductImage in Product.ProductImage %}
  361.                                 <div class="slideThumb" data-index="{{ loop.index0 }}"><img
  362.                                             src="{{ asset(ProductImage, 'save_image') }}" alt="" width="133"
  363.                                             height="133"
  364.                                             loading="lazy"></div>
  365.                             {% endfor %}
  366.                         </div>
  367.                     {% endif %}
  368.                 </div>
  369.                 {% if hasCategory == true %}
  370.                     <div style="margin-top: 120px;">
  371.                         <p class="text-announce">右側の項目でうちわのシミュレーションが確認できます。</p>
  372.                         {#                        <p>上の文字と下の文字は空白で左右の位置を調整できます<br>(スペースで左右の位置を調整できます)</p> #}
  373.                         <h4>ご注意</h4>
  374.                         <p>実際の商品は、仕上がりイメージと若干異なる場合があります</p>
  375.                         <p>ひらがななどで全体が一枚でつながらない場合には、背景でつながるげることがあります</p>
  376.                     </div>
  377.                     <div>
  378.                         <img class="material__img" src="/ecshop/html/user_data/assets/img/material/color_basic1.jpg"
  379.                              alt="カラー一覧"><br>
  380.                         <img class="material__img" src="/ecshop/html/user_data/assets/img/material/color_basic2.jpg"
  381.                              alt="カラー一覧"><br>
  382.                         <img class="material__img" src="/ecshop/html/user_data/assets/img/material/color_basic3.jpg"
  383.                              alt="カラー一覧">
  384.                         <img class="material__img" src="/ecshop/html/user_data/assets/img/material/color_glitter1.jpg"
  385.                              alt="グリッターカラー一覧"><br>
  386.                         <img class="material__img" src="/ecshop/html/user_data/assets/img/material/use_font.jpg"
  387.                              alt="書体見本">
  388.                     </div>
  389.                 {% endif %}
  390.             </div>
  391.             <div class="ec-grid2__cell">
  392.                 <div class="ec-productRole__profile">
  393.                     {# 商品名 #}
  394.                     <div class="ec-productRole__title">
  395.                         <h2 class="ec-headingTitle">{{ Product.name }}</h2>
  396.                     </div>
  397.                     {#                    <div style="width: 50%;margin: 20px;display:none;"> #}
  398.                     {#                        <input type="text" id="uchiwa_up_text" name="uchiwa_up_text" value="未来"/><br/> #}
  399.                     {#                        <input type="text" id="uchiwa_main_text" name="uchiwa_main_text" value="看" #}
  400.                     {#                               style="width:100%;"/><br> #}
  401.                     {#                        <input type="text" id="uchiwa_low_text" name="uchiwa_lo_text" value="板"/><br/> #}
  402.                     {#                        <button id="uchiwa_set" type="button">再作画</button> #}
  403.                     {#                        <br/> #}
  404.                     {#                        一番外側の色: #}
  405.                     {#                        <select id="uchiwa_back_color1" name="back_color1"> #}
  406.                     {#                        </select> #}
  407.                     {#                        <br/> #}
  408.                     {#                        フチの外枠: #}
  409.                     {#                        <select id="uchiwa_back_color2" name="back_color2"> #}
  410.                     {#                        </select> #}
  411.                     {#                        <br/> #}
  412.                     {#                        フチの中: #}
  413.                     {#                        <select id="uchiwa_back_color3" name="back_color3"> #}
  414.                     {#                        </select> #}
  415.                     {#                        <br/> #}
  416.                     {#                        文字の色: #}
  417.                     {#                        <select id="uchiwa_back_color4" name="back_color4"> #}
  418.                     {#                        </select> #}
  419.                     {#                        <br/> #}
  420.                     {#                    </div> #}
  421.                     {# タグ #}
  422.                     <ul class="ec-productRole__tags">
  423.                         {% for Tag in Product.Tags %}
  424.                             <li class="ec-productRole__tag tag_{{ Tag.id }}">{{ Tag }}</li>
  425.                         {% endfor %}
  426.                     </ul>
  427.                     {# 通常価格 #}
  428.                     {% if Product.hasProductClass -%}
  429.                         <div class="ec-productRole__priceRegular">
  430.                             {% if Product.getPrice01Min is not null and Product.getPrice01IncTaxMin == Product.getPrice01IncTaxMax %}
  431.                                 <span class="ec-productRole__priceRegularPrice">{{ '通常価格'|trans }}:<span
  432.                                             class="price01-default">{{ Product.getPrice01IncTaxMin|price }}</span></span>
  433.                                 <span class="ec-productRole__priceRegularTax">{{ '税込'|trans }}</span>
  434.                             {% elseif Product.getPrice01Min is not null and Product.getPrice01Max is not null %}
  435.                                 <span class="ec-productRole__priceRegularPrice">{{ '通常価格'|trans }}:<span
  436.                                             class="price01-default">{{ Product.getPrice01IncTaxMin|price }}~ {{ Product.getPrice01IncTaxMax|price }}</span></span>
  437.                                 <span class="ec-productRole__priceRegularTax">{{ '税込'|trans }}</span>
  438.                             {% endif %}
  439.                         </div>
  440.                     {% else %}
  441.                         {% if Product.getPrice01Max is not null %}
  442.                             <span class="ec-productRole__priceRegularPrice">{{ '通常価格'|trans }}:{{ Product.getPrice01IncTaxMin|price }}</span>
  443.                             <span class="ec-productRole__priceRegularTax">{{ '税込'|trans }}</span>
  444.                         {% endif %}
  445.                     {% endif %}
  446.                     {# 販売価格 #}
  447.                     <div class="ec-productRole__price">
  448.                         {% if Product.hasProductClass -%}
  449.                             {% if Product.getPrice02IncTaxMin == Product.getPrice02IncTaxMax %}
  450.                                 <div class="ec-price">
  451.                                     <span class="ec-price__price price02-default">{{ Product.getPrice02IncTaxMin|price }}</span>
  452.                                     <span class="ec-price__tax">{{ '税込'|trans }}</span>
  453.                                 </div>
  454.                             {% else %}
  455.                                 <div class="ec-price">
  456.                                     <span class="ec-price__price price02-default">{{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}</span>
  457.                                     <span class="ec-price__tax">{{ '税込'|trans }}</span>
  458.                                 </div>
  459.                             {% endif %}
  460.                         {% else %}
  461.                             <div class="ec-price">
  462.                                 <span class="ec-price__price">{{ Product.getPrice02IncTaxMin|price }}</span>
  463.                                 <span class="ec-price__tax">{{ '税込'|trans }}</span>
  464.                             </div>
  465.                         {% endif %}
  466.                     </div>
  467.                     {# 商品コード #}
  468.                     {% if Product.code_min is not empty %}
  469.                         <div class="ec-productRole__code">
  470.                             {{ '商品コード'|trans }}: <span
  471.                                     class="product-code-default">{{ Product.code_min }}{% if Product.code_min != Product.code_max %} ~ {{ Product.code_max }}{% endif %}</span>
  472.                         </div>
  473.                     {% endif %}
  474.                     {# 関連カテゴリ #}
  475.                     {% if Product.ProductCategories is not empty %}
  476.                         <div class="ec-productRole__category">
  477.                             <div>{{ '関連カテゴリ'|trans }}</div>
  478.                             {% for ProductCategory in Product.ProductCategories %}
  479.                                 <ul>
  480.                                     <li>
  481.                                         {% for Category in ProductCategory.Category.path %}
  482.                                             <a href="{{ url('product_list') }}?category_id={{ Category.id }}">{{ Category.name }}</a> {%- if loop.last == false %}
  483.                                             <span>></span>{% endif -%}
  484.                                         {% endfor %}
  485.                                     </li>
  486.                                 </ul>
  487.                             {% endfor %}
  488.                         </div>
  489.                     {% endif %}
  490.                     <form action="{{ url('product_add_cart', {id:Product.id}) }}" method="post" id="form1" name="form1"
  491.                           enctype="multipart/form-data">
  492.                         {% if Product.stock_find %}
  493.                             <div class="ec-productRole__actions">
  494.                                 {% if form.classcategory_id1 is defined %}
  495.                                     <div class="ec-select">
  496.                                         {{ form_row(form.classcategory_id1) }}
  497.                                         {{ form_errors(form.classcategory_id1) }}
  498.                                     </div>
  499.                                     {% if form.classcategory_id2 is defined %}
  500.                                         <div class="ec-select">
  501.                                             {{ form_row(form.classcategory_id2) }}
  502.                                             {{ form_errors(form.classcategory_id2) }}
  503.                                         </div>
  504.                                     {% endif %}
  505.                                 {% endif %}
  506.                             </div>
  507.                             {{ form_rest(form) }}
  508.                             <div class="ec-productRole__btn">
  509.                                 <button id="add-cart-button" type="submit" class="ec-blockBtn--action add-cart"
  510.                                         disabled>
  511.                                     {{ 'カートに入れる'|trans }}
  512.                                 </button>
  513.                             </div>
  514.                         {% else %}
  515.                             <div class="ec-productRole__btn">
  516.                                 <button type="button" class="ec-blockBtn--action" disabled="disabled">
  517.                                     {{ 'ただいま品切れ中です。'|trans }}
  518.                                 </button>
  519.                             </div>
  520.                         {% endif %}
  521.                         {#                        <div style="display: none"><input type="text" name="file" id="image_file"></div> #}
  522.                     </form>
  523.                     <div class="ec-modal">
  524.                         <div class="ec-modal-overlay">
  525.                             <div class="ec-modal-wrap">
  526.                                 <span class="ec-modal-close"><span class="ec-icon"><img
  527.                                                 src="{{ asset('assets/icon/cross-dark.svg') }}" alt=""/></span></span>
  528.                                 <div id="ec-modal-header" class="text-center">{{ 'カートに追加しました。'|trans }}</div>
  529.                                 <div class="ec-modal-box">
  530.                                     <div class="ec-role">
  531.                                         <span class="ec-inlineBtn--cancel">{{ 'お買い物を続ける'|trans }}</span>
  532.                                         <a href="{{ url('cart') }}"
  533.                                            class="ec-inlineBtn--action">{{ 'カートへ進む'|trans }}</a>
  534.                                     </div>
  535.                                 </div>
  536.                             </div>
  537.                         </div>
  538.                     </div>
  539.                     {% if BaseInfo.option_favorite_product %}
  540.                         <form action="{{ url('product_add_favorite', {id:Product.id}) }}" method="post">
  541.                             <div class="ec-productRole__btn">
  542.                                 {% if is_favorite == false %}
  543.                                     <button type="submit" id="favorite" class="ec-blockBtn--cancel">
  544.                                         {{ 'お気に入りに追加'|trans }}
  545.                                     </button>
  546.                                 {% else %}
  547.                                     <button type="submit" id="favorite" class="ec-blockBtn--cancel"
  548.                                             disabled="disabled">{{ 'お気に入りに追加済です。'|trans }}
  549.                                     </button>
  550.                                 {% endif %}
  551.                             </div>
  552.                         </form>
  553.                     {% endif %}
  554.                     <div class="ec-productRole__description">{{ Product.description_detail|raw|nl2br }}
  555.                     </div>
  556.                 </div>
  557.             </div>
  558.         </div>
  559.         {% if Product.freearea %}
  560.             <div class="ec-productRole__description">
  561.                 {{ include(template_from_string(Product.freearea)) }}
  562.             </div>
  563.         {% endif %}
  564.     </div>
  565.     {% if hasCategory == true %}
  566.         <script>
  567.             // https://mirai-kanban.com/ecshop/html/user_data/assets/js/test2.html
  568.             const product_color_type1 = '{{ Product.product_color_type1 }}'
  569.             const product_color_type2 = '{{ Product.product_color_type2 }}'
  570.             if( $('select#classcategory_id2').length > 0 ) {
  571.                 console.log('cat 2',  $('select#classcategory_id2'))
  572.                 $('select#classcategory_id1 option:nth-child(2)').prop('selected', true);
  573.             }
  574.             // $('select#classcategory_id1').trigger('change');
  575.             // subChange();
  576.             // function subChange() {
  577.             //     const myData = $('select#classcategory_id1');
  578.             //     const $form = $('form#form1');
  579.             //     // var $form = myData.parents('form');
  580.             //     var product_id = $form.find('input[name=product_id]').val();
  581.             //     var $sele1 = myData;
  582.             //     var $sele2 = $form.find('select[name=classcategory_id2]');
  583.             //
  584.             //     // 規格1のみの場合
  585.             //     if (!$sele2.length) {
  586.             //         eccube.checkStock($form, product_id, $sele1.val(), null);
  587.             //         // 規格2ありの場合
  588.             //     } else {
  589.             //         eccube.setClassCategories($form, product_id, $sele1, $sele2);
  590.             //     }
  591.             // }
  592.         </script>
  593.         <script src="{{ asset('assets/js/mirai.js') }}"></script>
  594.     {% else %}
  595.         <script>
  596.             $('#add-cart-button').prop('disabled', false)
  597.         </script>
  598.     {% endif %}
  599.     <script>
  600.         $('label[for=quantity]').text('数量')
  601.     </script>
  602. {% endblock %}