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