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. {% if Product.id in eccube_config.noindex %}
  9.     {% do Page.setMetaRobots('noindex') %}
  10. {% endif %}
  11. {% set sidbar_out = false %}
  12. {% set sidebar_type = 0 %}
  13.     {# 商品詳細からの場合 #}
  14.     {% if Product.ProductCategories is not empty %}
  15.         {% for ProductCategory in Product.ProductCategories %}
  16.             {% for Path in ProductCategory.Category.path %}
  17.                 {% if Path.hierarchy == 1 %}
  18.                     {% if Path.name == '部品' %}
  19.                         {% set sidebar_type = 1 %}
  20.                         {% set sidbar_out = true %}
  21.                     {% endif %}
  22.                     {% if Path.name == 'カートリッジ' %}
  23.                         {% set sidebar_type = 2 %}
  24.                         {% set sidbar_out = true %}
  25.                     {% endif %}
  26.                 {% endif %}
  27.             {% endfor %}
  28.         {% endfor %}
  29.     {% endif %}
  30. {% extends 'default_frame.twig' %}
  31. {% set body_class = 'product_page' %}
  32. {% block stylesheet %}
  33.     <style>
  34.         .slick-slider {
  35.             margin-bottom: 30px;
  36.         }
  37.         .slick-dots {
  38.             position: absolute;
  39.             bottom: -45px;
  40.             display: block;
  41.             width: 100%;
  42.             padding: 0;
  43.             list-style: none;
  44.             text-align: center;
  45.         }
  46.         .slick-dots li {
  47.             position: relative;
  48.             display: inline-block;
  49.             width: 20px;
  50.             height: 20px;
  51.             margin: 0 5px;
  52.             padding: 0;
  53.             cursor: pointer;
  54.         }
  55.         .slick-dots li button {
  56.             font-size: 0;
  57.             line-height: 0;
  58.             display: block;
  59.             width: 20px;
  60.             height: 20px;
  61.             padding: 5px;
  62.             cursor: pointer;
  63.             color: transparent;
  64.             border: 0;
  65.             outline: none;
  66.             background: transparent;
  67.         }
  68.         .slick-dots li button:hover,
  69.         .slick-dots li button:focus {
  70.             outline: none;
  71.         }
  72.         .slick-dots li button:hover:before,
  73.         .slick-dots li button:focus:before {
  74.             opacity: 1;
  75.         }
  76.         .slick-dots li button:before {
  77.             content: " ";
  78.             line-height: 20px;
  79.             position: absolute;
  80.             top: 0;
  81.             left: 0;
  82.             width: 12px;
  83.             height: 12px;
  84.             text-align: center;
  85.             opacity: .25;
  86.             background-color: black;
  87.             border-radius: 50%;
  88.         }
  89.         .slick-dots li.slick-active button:before {
  90.             opacity: .75;
  91.             background-color: black;
  92.         }
  93.         .slick-dots li button.thumbnail img {
  94.             width: 0;
  95.             height: 0;
  96.         }
  97.         .ec-price{
  98.             margin-bottom: 20px !important;
  99.         }
  100.         .ec-price__price{
  101.             padding: 0 0 5px 0 !important;
  102.             border-bottom: 1px solid !important;
  103.             font-size: 22px !important;
  104.             font-weight: bold !important;
  105.         }
  106.         .ec-price__tax{
  107.             font-size: 16px !important;
  108.         }
  109.         .ec-blockBtn--action{
  110.             margin-bottom: 0;
  111.             font-weight: bold;
  112.             text-align: center;
  113.             vertical-align: middle;
  114.             touch-action: manipulation;
  115.             cursor: pointer;
  116.             background-image: none;
  117.             border: 1px solid transparent;
  118.             white-space: nowrap;
  119.             font-size: 13px !important;
  120.             border-radius: 0px;
  121.             user-select: none;
  122.             padding: 10px 16px;
  123.             text-decoration: none;
  124.             color: #fff;
  125.             display: block;
  126.             width: 100%;
  127.             height: 40px !important;
  128.             line-height: 40px !important;
  129.             padding-top: 0;
  130.             padding-bottom: 0;
  131.         }
  132.         .ec-layoutRole__mainBottom{
  133.             padding: 0 2.5% !important;
  134.         }
  135.         
  136.         .rental-disclaimer{
  137.             margin-bottom: 10px;
  138.         }
  139.         
  140.     </style>
  141. {% endblock %}
  142. {% block javascript %}
  143.     <script>
  144.         eccube.classCategories = {{ class_categories_as_json(Product)|raw }};
  145.         // 規格2に選択肢を割り当てる。
  146.         function fnSetClassCategories(form, classcat_id2_selected) {
  147.             var $form = $(form);
  148.             var product_id = $form.find('input[name=product_id]').val();
  149.             var $sele1 = $form.find('select[name=classcategory_id1]');
  150.             var $sele2 = $form.find('select[name=classcategory_id2]');
  151.             eccube.setClassCategories($form, product_id, $sele1, $sele2, classcat_id2_selected);
  152.         }
  153.         {% if form.classcategory_id2 is defined %}
  154.         fnSetClassCategories(
  155.             $('#form1'), {{ form.classcategory_id2.vars.value|json_encode|raw }}
  156.         );
  157.         {% elseif form.classcategory_id1 is defined %}
  158.         eccube.checkStock($('#form1'), {{ Product.id }}, {{ form.classcategory_id1.vars.value|json_encode|raw }}, null);
  159.         {% endif %}
  160.     </script>
  161.     <script>
  162.         $(function() {
  163.             // bfcache無効化
  164.             $(window).bind('pageshow', function(event) {
  165.                 if (event.originalEvent.persisted) {
  166.                     location.reload(true);
  167.                 }
  168.             });
  169.             $('.item_visual').slick({
  170.                 autoplay: true,         //自動再生
  171.                 speed: 300,             //スライドするスピード
  172.                 dots: true,             //ドット
  173.                 arrows: false,          //矢印
  174.                 infinite: true,         //スライドのループ
  175.                 pauseOnHover: false,    //ホバーしたときにスライドを一時停止しない
  176.                 responsive: [{
  177.                     breakpoint: 768,
  178.                     settings: {
  179.                         dots: true
  180.                     }
  181.                 }]
  182.             });
  183.             $('.slideThumb').on('click', function() {
  184.                 var index = $(this).attr('data-index');
  185.                 $('.item_visual').slick('slickGoTo', index, false);
  186.             })
  187.         });
  188.     </script>
  189.     <script>
  190.         if ($('[name="classcategory_id1"] option').length == 2) {
  191.             {# 選択肢は実質1つであるため、不要な操作をさせない #}
  192.             $('[name="classcategory_id1"] option[value="__unselected"]').remove();
  193.         } else {
  194.             {# 規格設定の選択項目を「選択してください」→「購入方法」へ変更 #}
  195.             $('[name="classcategory_id1"] option[value="__unselected"]').text("購入方法");
  196.         }
  197.         
  198.         $(function() {
  199.             $('#Product_contact').on('click', function() {
  200.                 window.location.href = '{{ eccube_config.multipure_contact }}';
  201.             });
  202.             $('#Product_rental').on('click', function() {
  203.                 let href = '{{ eccube_config.multipure_lp_rental }}';
  204.                 window.open(href, "_blank");
  205.             });
  206.             $('#Product_rental_contact').on('click', function() {
  207.                 window.location.href = '{{ eccube_config.multipure_contact_lp_rental }}';
  208.             });
  209.             $('#Product_rental_entry').on('click', function() {
  210.                 window.location.href = '{{ url('rental_entry', {id: Product.id}) }}';
  211.             });
  212.         {% for RelatedProduct in Product.RelatedProducts %}
  213.             {% set ChildProduct = RelatedProduct.ChildProduct %}
  214.             {% if ChildProduct.Status.id == constant("Eccube\\Entity\\Master\\ProductStatus::DISPLAY_SHOW") %}
  215.                 $('#Product_cartridge').on('click', function() {
  216.                     window.location.href = '{{ url('product_detail', {id : ChildProduct.id}) }}';
  217.                 });
  218.             {% endif %}
  219.         {% endfor %}
  220.             $('.add-cart').on('click', function(event) {
  221.                 {% if form.classcategory_id1 is defined %}
  222.                 // 規格1フォームの必須チェック
  223.                 if ($('#classcategory_id1').val() == '__unselected' || $('#classcategory_id1').val() == '') {
  224.                     $('#classcategory_id1')[0].setCustomValidity('{{ '項目が選択されていません'|trans }}');
  225.                     return true;
  226.                 } else {
  227.                     $('#classcategory_id1')[0].setCustomValidity('');
  228.                 }
  229.                 {% endif %}
  230.                 {% if form.classcategory_id2 is defined %}
  231.                 // 規格2フォームの必須チェック
  232.                 if ($('#classcategory_id2').val() == '__unselected' || $('#classcategory_id2').val() == '') {
  233.                     $('#classcategory_id2')[0].setCustomValidity('{{ '項目が選択されていません'|trans }}');
  234.                     return true;
  235.                 } else {
  236.                     $('#classcategory_id2')[0].setCustomValidity('');
  237.                 }
  238.                 {% endif %}
  239.                 // 個数フォームのチェック
  240.                 if ($('#quantity').val() < 1) {
  241.                     $('#quantity')[0].setCustomValidity('{{ '1以上で入力してください。'|trans }}');
  242.                     return true;
  243.                 } else {
  244.                     $('#quantity')[0].setCustomValidity('');
  245.                 }
  246.                 event.preventDefault();
  247.                 $form = $('#form1');
  248.                 $.ajax({
  249.                     url: $form.attr('action'),
  250.                     type: $form.attr('method'),
  251.                     data: $form.serialize(),
  252.                     dataType: 'json',
  253.                     beforeSend: function(xhr, settings) {
  254.                         // Buttonを無効にする
  255.                         $('.add-cart').prop('disabled', true);
  256.                     }
  257.                 }).done(function(data) {
  258.                     // レスポンス内のメッセージをalertで表示
  259.                     $.each(data.messages, function() {
  260.                         $('#ec-modal-header').html(this);
  261.                     });
  262.                     $('.ec-modal').show()
  263.                     // カートブロックを更新する
  264.                     $.ajax({
  265.                         url: "{{ url('block_cart') }}",
  266.                         type: 'GET',
  267.                         dataType: 'html'
  268.                     }).done(function(html) {
  269.                         $('.ec-headerRole__cart').html(html);
  270.                         
  271.                         // カートブロックが更新された場合、イベントが無効になるため再設定
  272.                         $('.ec-cartNavi').click(function() {
  273.                             window.location.href = '{{ url('cart') }}';
  274.                         });
  275.                     });
  276.                 }).fail(function(data) {
  277.                     alert('{{ 'カートへの追加に失敗しました。'|trans }}');
  278.                 }).always(function(data) {
  279.                     // Buttonを有効にする
  280.                     $('.add-cart').prop('disabled', false);
  281.                 });
  282.             });
  283.         });
  284.         $('.ec-modal-wrap').on('click', function(e) {
  285.             // モーダル内の処理は外側にバブリングさせない
  286.             e.stopPropagation();
  287.         });
  288.         $('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function() {
  289.             $('.ec-modal').hide()
  290.         });
  291.     </script>
  292.     <script type="application/ld+json">
  293.     {
  294.         "@context": "https://schema.org/",
  295.         "@type": "Product",
  296.         "name": "{{ Product.name }}",
  297.         "image": [
  298.             {% for img in Product.ProductImage %}
  299.                 "{{ app.request.schemeAndHttpHost }}{{ asset(img, 'save_image') }}"{% if not loop.last %},{% endif %}
  300.             {% else %}
  301.                 "{{ app.request.schemeAndHttpHost }}{{ asset(''|no_image_product, 'save_image') }}"
  302.             {% endfor %}
  303.         ],
  304.         "description": "{{ Product.description_list | default(Product.description_detail) | replace({'\n': '', '\r': ''}) | slice(0,300) }}",
  305.         {% if Product.code_min %}
  306.         "sku": "{{ Product.code_min }}",
  307.         {% endif %}
  308.         "offers": {
  309.             "@type": "Offer",
  310.             "url": "{{ url('product_detail', {'id': Product.id}) }}",
  311.             "priceCurrency": "{{ eccube_config.currency }}",
  312.             "price": {{ Product.getPrice02IncTaxMin }},
  313.             "availability": "{{ Product.stock_find ? "InStock" : "OutOfStock" }}"
  314.         }
  315.     }
  316.     </script>
  317. {# ここからは、カスタマイズ部分 #}
  318. <script>
  319. {# 規格選択イベントの上書き #}
  320. (function(window, undefined) {
  321.     // 名前空間の重複を防ぐ
  322.     if (window.eccube === undefined) {
  323.         window.eccube = {};
  324.     }
  325.     var eccube = window.eccube;
  326.     // グローバルに使用できるようにする
  327.     window.eccube = eccube;
  328.     /**
  329.      * 規格2のプルダウンを設定する.
  330.      */
  331.     eccube.setClassCategories = function($form, product_id, $sele1, $sele2, selected_id2) {
  332.         if ($sele1 && $sele1.length) {
  333.             var classcat_id1 = $sele1.val() ? $sele1.val() : '';
  334.             if ($sele2 && $sele2.length) {
  335.                 // 規格2の選択肢をクリア
  336.                 $sele2.children().remove();
  337.                 var classcat2;
  338.                 if (eccube.hasOwnProperty('productsClassCategories')) {
  339.                     // 商品一覧時
  340.                     classcat2 = eccube.productsClassCategories[product_id][classcat_id1];
  341.                 } else {
  342.                     // 詳細表示時
  343.                     classcat2 = eccube.classCategories[classcat_id1];
  344.                 }
  345.                 // 規格2の要素を設定
  346.                 for (var key in classcat2) {
  347.                     if (classcat2.hasOwnProperty(key)) {
  348.                         var id = classcat2[key].classcategory_id2;
  349.                         var name = classcat2[key].name;
  350.                         var option = $('<option />').val(id ? id : '').text(name);
  351.                         if (id === selected_id2) {
  352.                             option.attr('selected', true);
  353.                         }
  354.                         $sele2.append(option);
  355.                     }
  356.                 }
  357.                 eccube.checkStock($form, product_id, $sele1.val() ? $sele1.val() : '__unselected2',
  358.                     $sele2.val() ? $sele2.val() : '');
  359.             }
  360.         }
  361.     };
  362.     /**
  363.      * 規格の選択状態に応じて, フィールドを設定する.
  364.      */
  365.     // 税抜価格を格納
  366.     var price02_origin = [];
  367.     // 税込価格を格納
  368.     var price02Tax_origin = [];
  369.     eccube.checkStock = function($form, product_id, classcat_id1, classcat_id2) {
  370.         classcat_id2 = classcat_id2 ? classcat_id2 : '';
  371.         var classcat2;
  372.         if (eccube.hasOwnProperty('productsClassCategories')) {
  373.             // 商品一覧時
  374.             classcat2 = eccube.productsClassCategories[product_id][classcat_id1]['#' + classcat_id2];
  375.         } else {
  376.             // 詳細表示時
  377.             if (typeof eccube.classCategories[classcat_id1] !== 'undefined') {
  378.                 classcat2 = eccube.classCategories[classcat_id1]['#' + classcat_id2];
  379.             }
  380.         }
  381.         if (typeof classcat2 === 'undefined') {
  382.             // 商品コード
  383.             var $product_code = $('.product-code-default');
  384.             if (typeof this.product_code_origin === 'undefined') {
  385.                 // 初期値を保持しておく
  386.                 this.product_code_origin = $product_code.text();
  387.             }
  388.             $product_code.text(this.product_code_origin);
  389.             // 在庫(品切れ)
  390.             var $cartbtn = $form.parent().find('.add-cart').first();
  391.             if (typeof this.product_cart_origin === 'undefined') {
  392.                 // 初期値を保持しておく
  393.                 this.product_cart_origin = $cartbtn.text();
  394.             }
  395.             $cartbtn.prop('disabled', false);
  396.             $cartbtn.text(this.product_cart_origin);
  397.             // 通常価格
  398.             var $price01 = $form.parent().find('.price01-default-Custom').first();
  399.             if (typeof this.price01_origin === 'undefined') {
  400.                 // 初期値を保持しておく
  401.                 this.price01_origin = $price01.text();
  402.             }
  403.             $price01.text(this.price01_origin);
  404.             // 販売価格
  405.             var $price02 = $form.parent().find('.price02-default-Custom').first();
  406.             if (typeof price02_origin[product_id] === 'undefined') {
  407.                 // 初期値を保持しておく
  408.                 price02_origin[product_id] = $price02.text();
  409.             }
  410.             $price02.text(price02_origin[product_id]);
  411.             {# オートシップメント価格項目の表示 #}
  412.             var $price02_sub = $form.parent().find('.price02-default-Custom-sub').first();
  413.             $price02_sub.show();
  414.             // 通常価格(税込)
  415.             var $price01 = $form.parent().find('.price01Tax-default-Custom').first();
  416.             if (typeof this.price01Tax_origin === 'undefined') {
  417.                 // 初期値を保持しておく
  418.                 this.price01Tax_origin = $price01.text();
  419.             }
  420.             $price01.text(this.price01Tax_origin);
  421.             // 販売価格(税込)
  422.             var $price02 = $form.parent().find('.price02Tax-default-Custom').first();
  423.             if (typeof price02Tax_origin[product_id] === 'undefined') {
  424.                 // 初期値を保持しておく
  425.                 price02Tax_origin[product_id] = $price02.text();
  426.             }
  427.             $price02.text(price02Tax_origin[product_id]);
  428.             // 商品規格
  429.             var $product_class_id_dynamic = $form.find('[id^=ProductClass]');
  430.             $product_class_id_dynamic.val('');
  431.         } else {
  432.             // 商品コード
  433.             var $product_code = $('.product-code-default');
  434.             if (classcat2 && typeof classcat2.product_code !== 'undefined') {
  435.                 $product_code.text(classcat2.product_code);
  436.             } else {
  437.                 $product_code.text(this.product_code_origin);
  438.             }
  439.             // 在庫(品切れ)
  440.             var $cartbtn = $form.parent().find('.add-cart').first();
  441.             if (typeof this.product_cart_origin === 'undefined') {
  442.                 // 初期値を保持しておく
  443.                 this.product_cart_origin = $cartbtn.text();
  444.             }
  445.             if (classcat2 && classcat2.stock_find === false) {
  446.                 $cartbtn.prop('disabled', true);
  447.                 $cartbtn.text('ただいま品切れ中です');
  448.             } else {
  449.                 $cartbtn.prop('disabled', false);
  450.                 $cartbtn.text(this.product_cart_origin);
  451.             }
  452.             // 通常価格
  453.             var $price01 = $form.parent().find('.price01-default-Custom').first();
  454.             if (typeof this.price01_origin === 'undefined') {
  455.                 // 初期値を保持しておく
  456.                 this.price01_origin = $price01.text();
  457.             }
  458.             if (classcat2 && typeof classcat2.price01 !== 'undefined' && String(classcat2.price01).length >= 1) {
  459.                 $price01.text('¥' + classcat2.price01);
  460.             } else {
  461.                 $price01.text(this.price01_origin);
  462.             }
  463.             // 販売価格
  464.             var $price02 = $form.parent().find('.price02-default-Custom').first();
  465.             if (typeof price02_origin[product_id] === 'undefined') {
  466.                 // 初期値を保持しておく
  467.                 price02_origin[product_id] = $price02.text();
  468.             }
  469.             if (classcat2 && typeof classcat2.price02 !== 'undefined' && String(classcat2.price02).length >= 1) {
  470.                 {# $price02.text('¥' + classcat2.price02); #}
  471.                 $price02.text(classcat2.price02);
  472.                 {# オートシップメント価格項目の非表示 #}
  473.                 var $price02_sub = $form.parent().find('.price02-default-Custom-sub').first();
  474.                 $price02_sub.hide();
  475.             } else {
  476.                 $price02.text(price02_origin[product_id]);
  477.             }
  478.             // 通常価格(税込)
  479.             var $price01 = $form.parent().find('.price01Tax-default-Custom').first();
  480.             if (typeof this.price01Tax_origin === 'undefined') {
  481.                 // 初期値を保持しておく
  482.                 this.price01Tax_origin = $price01.text();
  483.             }
  484.             if (classcat2 && typeof classcat2.price01 !== 'undefined' && String(classcat2.price01).length >= 1) {
  485.                 $price01.text('¥' + classcat2.price01_inc_tax);
  486.             } else {
  487.                 $price01.text(this.price01Tax_origin);
  488.             }
  489.             // 販売価格(税込)
  490.             var $price02 = $form.parent().find('.price02Tax-default-Custom').first();
  491.             if (typeof price02Tax_origin[product_id] === 'undefined') {
  492.                 // 初期値を保持しておく
  493.                 price02Tax_origin[product_id] = $price02.text();
  494.             }
  495.             if (classcat2 && typeof classcat2.price02 !== 'undefined' && String(classcat2.price02).length >= 1) {
  496.                 {# $price02.text('¥' + classcat2.price02_inc_tax); #}
  497.                 $price02.text(classcat2.price02_inc_tax);
  498.             } else {
  499.                 $price02.text(price02Tax_origin[product_id]);
  500.             }
  501.             // ポイント
  502.             var $point_default = $form.find('[id^=point_default]');
  503.             var $point_dynamic = $form.find('[id^=point_dynamic]');
  504.             if (classcat2 && typeof classcat2.point !== 'undefined' && String(classcat2.point).length >= 1) {
  505.                 $point_dynamic.text(classcat2.point).show();
  506.                 $point_default.hide();
  507.             } else {
  508.                 $point_dynamic.hide();
  509.                 $point_default.show();
  510.             }
  511.             // 商品規格
  512.             var $product_class_id_dynamic = $form.find('[id^=ProductClass]');
  513.             if (classcat2 && typeof classcat2.product_class_id !== 'undefined' && String(classcat2.product_class_id).length >= 1) {
  514.                 $product_class_id_dynamic.val(classcat2.product_class_id);
  515.             } else {
  516.                 $product_class_id_dynamic.val('');
  517.             }
  518.         }
  519.     };
  520.     /**
  521.      * Initialize.
  522.      */
  523.     $(function() {
  524.         // 規格1選択時
  525.         $('select[name=classcategory_id1]')
  526.             .change(function() {
  527.                 var $form = $(this).parents('form');
  528.                 var product_id = $form.find('input[name=product_id]').val();
  529.                 var $sele1 = $(this);
  530.                 var $sele2 = $form.find('select[name=classcategory_id2]');
  531.                 // 規格1のみの場合
  532.                 if (!$sele2.length) {
  533.                     eccube.checkStock($form, product_id, $sele1.val(), null);
  534.                     // 規格2ありの場合
  535.                 } else {
  536.                     eccube.setClassCategories($form, product_id, $sele1, $sele2);
  537.                 }
  538.             });
  539.         // 規格2選択時
  540.         $('select[name=classcategory_id2]')
  541.             .change(function() {
  542.                 var $form = $(this).parents('form');
  543.                 var product_id = $form.find('input[name=product_id]').val();
  544.                 var $sele1 = $form.find('select[name=classcategory_id1]');
  545.                 var $sele2 = $(this);
  546.                 eccube.checkStock($form, product_id, $sele1.val(), $sele2.val());
  547.             });
  548.     });
  549. })(window);
  550. </script>
  551. {% endblock %}
  552. {% block main %}
  553.     <div class="ec-productRole">
  554.         <div class="ec-grid2" style="margin-bottom: 50px;">
  555.             <div class="ec-grid2__cell">
  556.                 <div class="ec-sliderItemRole">
  557.                     <div class="item_visual">
  558.                         {% for ProductImage in Product.ProductImage %}
  559.                             <div class="slide-item"><img src="{{ asset(ProductImage, 'save_image') }}" alt="{{ loop.first ? Product.name : '' }}"></div>
  560.                         {% else %}
  561.                             <div class="slide-item"><img src="{{ asset(''|no_image_product, 'save_image') }}" alt="{{ loop.first ? Product.name : '' }}" /></div>
  562.                         {% endfor %}
  563.                     </div>
  564.                     {# <div class="item_nav">#}
  565.                         {#{% for ProductImage in Product.ProductImage %}#}
  566.                             {#<div class="slideThumb" data-index="{{ loop.index0 }}"><img src="{{ asset(ProductImage, 'save_image') }}" alt=""></div>#}
  567.                         {#{% endfor %}#}
  568.                     {#</div>#}
  569.                 </div>
  570.             </div>
  571.             <div class="ec-grid2__cell">
  572.                 <div class="ec-productRole__profile">
  573. {# 部品の場合 #}
  574. {% if sidebar_type == 1 %}
  575.                     {% if Product.code_min is not empty %}
  576.                         <p style="font-size: 12px;">型番<br /></p>
  577.                         <span class="product-code-default">{{ Product.code_min }}{% if Product.code_min != Product.code_max %} ~ {{ Product.code_max }}{% endif %}</span>
  578.                     {% endif %}
  579. {% endif %}    
  580.                     {# 商品説明 #}
  581.                     <div class="ec-productRole__description">{{ Product.description_detail|raw|nl2br }}
  582.                     </div>
  583.                     {# 通常価格 #}
  584.                     {% if Product.hasProductClass -%}
  585.                         <div class="ec-productRole__priceRegular">
  586.                             {% if Product.getPrice01Min is not null and Product.getPrice01IncTaxMin == Product.getPrice01IncTaxMax %}
  587.                                 <span class="ec-productRole__priceRegularPrice">{{ '通常価格'|trans }}:<span class="price01-default">{{ Product.getPrice01IncTaxMin|price }}</span></span>
  588.                                 <span class="ec-productRole__priceRegularTax">{{ '税込'|trans }}</span>
  589.                             {% elseif Product.getPrice01Min is not null and Product.getPrice01Max is not null %}
  590.                                 <span class="ec-productRole__priceRegularPrice">{{ '通常価格'|trans }}:<span class="price01-default">{{ Product.getPrice01IncTaxMin|price }}~ {{ Product.getPrice01IncTaxMax|price }}</span></span>
  591.                                 <span class="ec-productRole__priceRegularTax">{{ '税込'|trans }}</span>
  592.                             {% endif %}
  593.                         </div>
  594.                     {% else %}
  595.                         {% if Product.getPrice01Max is not null %}
  596.                             <span class="ec-productRole__priceRegularPrice">{{ '通常価格'|trans }}:{{ Product.getPrice01IncTaxMin|price }}</span>
  597.                             <span class="ec-productRole__priceRegularTax">{{ '税込'|trans }}</span>
  598.                         {% endif %}
  599.                     {% endif %}
  600.                     {% if customSaleTypeRental %}
  601.                     レンタル月額
  602.                     {% endif %}
  603.                     
  604.                     {# 販売価格 #}
  605.                     <div class="ec-productRole__price">
  606.                         {% if Product.hasProductClass -%}
  607.                             {% if Product.getPrice02IncTaxMin == Product.getPrice02IncTaxMax %}
  608.                                 <div class="ec-price">
  609.                                     <span class="ec-price__price price02-default">{{ Product.getPrice02IncTaxMin|price }}</span>
  610.                                     <span class="ec-price__tax">{{ '税込'|trans }}</span>
  611.                                 </div>
  612.                             {% else %}
  613.                                 <div class="ec-price">
  614.                                     <span class="ec-price__price price02-default">{{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}</span>
  615.                                     <span class="ec-price__tax">{{ '税込'|trans }}</span>
  616.                                     {# オートシップメント価格項目の非表示 #}
  617.                                     <span class="price02-default-Custom-sub" style="font-size: 12px;"><br />(オートシップメント契約価格{{ Product.getPrice02IncTaxMin|number_format }}円税込)</span>
  618.                                 </div>
  619.                             {% endif %}
  620.                         {% else %}
  621.                             <div class="ec-price">
  622.                                 <span class="ec-price__price">{{ Product.getPrice02IncTaxMin|price }}</span>
  623.                                 <span class="ec-price__tax">{{ '税込'|trans }}</span>
  624.                             </div>
  625.                         {% endif %}
  626.                         {% if not customSaleTypeRental %}
  627.                         <p style="font-size: 12px;">※ 分割払いに対応しております(金利手数料無料)<br /></p>
  628.                         {% endif %}
  629.                     </div>
  630.                     
  631. {# カートリッジ/部品の場合 #}
  632. {% if sidebar_type == 2 or sidebar_type == 1 %}
  633.                         <br /><p style="font-size: 12px;">対応機種<br /></p>
  634. {% endif %}                    
  635.                     {# タグ #}
  636.                     <ul class="ec-productRole__tags">
  637.                         {% for Tag in Product.Tags %}
  638.                             <li class="ec-productRole__tag tag_{{ Tag.id }}">{{ Tag }}</li>
  639.                         {% endfor %}
  640.                     </ul>
  641.                     {# タグ #}
  642.                     {#<div>#}
  643.                     {#    <p>対応機種</p>#}
  644.      {#                   {% for Tag in Product.Tags %}#}
  645.      {#                       <p class="btn_txt tag_{{ Tag.id }}">{{ Tag }}</p>#}
  646.      {#                   {% endfor %}#}
  647.                     {#</div>#}
  648.                     
  649.                     {# カート #}
  650.                     <form action="{{ url('product_add_cart', {id:Product.id}) }}" method="post" id="form1" name="form1">
  651.                         {% if Product.stock_find %}
  652.                             <div class="ec-productRole__actions">
  653.                                 {% if form.classcategory_id1 is defined %}
  654.                                     <div class="ec-select">
  655.                                         {{ form_widget(form.classcategory_id1) }}
  656.                                         {{ form_errors(form.classcategory_id1) }}
  657.                                     </div>
  658.                                     {% if form.classcategory_id2 is defined %}
  659.                                         <div class="ec-select">
  660.                                             {{ form_widget(form.classcategory_id2) }}
  661.                                             {{ form_errors(form.classcategory_id2) }}
  662.                                         </div>
  663.                                     {% endif %}
  664.                                 {% endif %}
  665.                                 <div class="ec-numberInput"><span>{{ '数量'|trans }}</span>
  666.                                 {% if customSaleTypeRental %}
  667.                                     {{ form_widget(form.quantity, {attr: { disabled: 'disabled'}}) }}
  668.                                 {% else %}
  669.                                     {{ form_widget(form.quantity) }}
  670.                                     {{ form_errors(form.quantity) }}
  671.                                 {% endif %}
  672.                                 </div>
  673.                             </div>
  674.                             {% if customSaleTypeRental %}
  675.                             <div class="ec-productRole__btn">
  676.                                 <div class="ec-blockBtn--action" id="Product_rental">
  677.                                     {{ 'レンタルについて詳細・お申込み'|trans }}
  678.                                 </div>
  679.                             </div>
  680.                             <div class="rental-disclaimer">
  681.                                 <p>お申込み時は会員登録が必要です</p>
  682.                             </div>
  683.                             {% else %}
  684.                             <div class="ec-productRole__btn">
  685.                                 <button type="submit" class="ec-blockBtn--action add-cart">
  686.                                     {{ 'カートに入れる'|trans }}
  687.                                 </button>
  688.                             </div>
  689.                             {% endif %}
  690.                         {% else %}
  691.                             {#<div class="ec-productRole__btn">#}
  692.                             {#    <button type="button" class="ec-blockBtn--action" disabled="disabled">#}
  693.                             {#        {{ 'ただいま品切れ中です。'|trans }}#}
  694.                             {#    </button>#}
  695.                             {#</div>#}
  696.                         {% endif %}
  697.                         {{ form_rest(form) }}
  698.                     </form>
  699.                     <div class="ec-modal">
  700.                         <div class="ec-modal-overlay">
  701.                             <div class="ec-modal-wrap">
  702.                                 <span class="ec-modal-close"><span class="ec-icon"><img src="{{ asset('assets/icon/cross-dark.svg') }}" alt=""/></span></span>
  703.                                 <div id="ec-modal-header" class="text-center">{{ 'カートに追加しました。'|trans }}</div>
  704.                                 <div class="ec-modal-box">
  705.                                     <div class="ec-role">
  706.                                         <span class="ec-inlineBtn--cancel">{{ 'お買い物を続ける'|trans }}</span>
  707.                                         <a href="{{ url('cart') }}" class="ec-inlineBtn--action" style="color:#fff;">{{ 'カートへ進む'|trans }}</a>
  708.                                     </div>
  709.                                 </div>
  710.                             </div>
  711.                         </div>
  712.                     </div>
  713.                     {% if BaseInfo.option_favorite_product %}
  714.                         <form action="{{ url('product_add_favorite', {id:Product.id}) }}" method="post">
  715.                             <div class="ec-productRole__btn">
  716.                                 {% if is_favorite == false %}
  717.                                     <button type="submit" id="favorite" class="ec-blockBtn--cancel">
  718.                                         {{ 'お気に入りに追加'|trans }}
  719.                                     </button>
  720.                                 {% else %}
  721.                                     <button type="submit" id="favorite" class="ec-blockBtn--cancel"
  722.                                             disabled="disabled">{{ 'お気に入りに追加済です。'|trans }}
  723.                                     </button>
  724.                                 {% endif %}
  725.                             </div>
  726.                         </form>
  727.                     {% endif %}
  728.                         <div class="ec-productRole__btn">
  729.                             {% if customSaleTypeRental %}
  730.                             <div class="ec-blockBtn--action" id="Product_rental_contact">
  731.                                 {{ '資料請求・お問い合わせ'|trans }}
  732.                             </div>
  733.                             {% else %}
  734.                             <div class="ec-blockBtn--action" id="Product_contact">
  735.                                 {{ '資料請求・お問い合わせ'|trans }}
  736.                             </div>
  737.                             {% endif %}
  738.                         </div>
  739.                         
  740.         {# 関連商品プラグインの設定情報を確認し、設定されていれば、「対応カートリッジを見る」ボタンを表示する #}
  741.         {# ※ただし、「関連商品設定」プラグインが無効の場合はエラーが発生します。 #}
  742.         {% for RelatedProduct in Product.RelatedProducts %}
  743.             {% set ChildProduct = RelatedProduct.ChildProduct %}
  744.             {% if ChildProduct.Status.id == constant("Eccube\\Entity\\Master\\ProductStatus::DISPLAY_SHOW") %}
  745.                         <div class="ec-productRole__btn">
  746.                             <div class="ec-blockBtn--action" id="Product_cartridge">
  747.                                 {{ '対応カートリッジを見る'|trans }}
  748.                             </div>
  749.                         </div>
  750.             {% endif %}
  751.         {% endfor %}
  752.                 </div>
  753.             </div>
  754.         </div>
  755.         {% if Product.freearea %}
  756.              <div class="ec-productRole__description">
  757.                  {{ include(template_from_string(Product.freearea)) }}
  758.             </div>
  759.         {% endif %}
  760.     </div>
  761. {% endblock %}