app/template/default/Block/lm_item_cart_area.twig line 1

Open in your IDE?
  1. {% if data.goods_status == 1 or data.goods_status == 11 or is_preview_mode or is_secret %}
  2.     <!-- カート -->
  3.     <div class="cart_title" style="position:relative;">
  4.         <div id="cart_title" style="position:absolute;top:-65px;"></div>
  5.     </div>
  6.     {% set viewConst = 'hoge' %}
  7.     {% if constant("_VIEW_ITEM_DETAIL_FLAG_#{data.goods_id}") is defined %}
  8.         {% set viewConst = constant("_VIEW_ITEM_DETAIL_FLAG_#{data.goods_id}") %}
  9.     {% endif %}
  10.     <script type="text/javascript">
  11.         (function() {
  12.             // // var DISPLAY_LINES = 6;
  13.             var DISPLAY_LINES = {{ DISPLAY_LINES }};
  14.             $(function() {
  15.                 $('.categories').each(function(index, element) {
  16.                     var ps = $(this).find('p.category').each(function(index, element) {
  17.                         if (index >= DISPLAY_LINES) {
  18.                             $(this).hide();
  19.                         }
  20.                     });
  21.                     // 「もっと見る」機能を抑制
  22.                     // // if (ps.length > DISPLAY_LINES) {
  23.                     // //     $('<p style="background-color: #FAFAFA; margin: 10px 0 0 -10px; border: 1px solid #E0E0E0; width: 80px; padding: 5px; border-radius: 5px; text-align: center;"/>').append(
  24.                     // //         $('<div class="fadeout"></div><a href="#" style="text-decoration: none; color: #212121;">もっと見る...</a>')
  25.                     // //           .on('mouseleave', function() {
  26.                     // //             $(this).css({'text-decoration':'none','color':'#212121'});
  27.                     // //         }).on('mouseenter', function() {
  28.                     // //             $(this).css({'text-decoration':'none','color':'#36C'});
  29.                     // //         }).on('click', function(event) {
  30.                     // //             $(this).closest('p').hide();
  31.                     // //             $(this).closest(".fadeout").hide();
  32.                     // //             $(ps).slideDown();
  33.                     // //             return false;
  34.                     // //         })
  35.                     // //     ).appendTo($(ps).closest('div'));
  36.                     // // }
  37.                 });
  38.             });
  39.         }())
  40.     </script>
  41.     {% if eccube_config.GoodsSetPurchase.NewUI.Enabled and goods.isGoodsSetPurchase %}
  42.         {# include 'Item/GoodsSetPurchase/new_cart_area.twig' with { item: item } only #}
  43.     {% else %}
  44.     <div class="cart_area">
  45.         {% if isYoyakuAvailable %}
  46.         <div class="vim_flag" style="{% if viewConst != "on" %} display: none;{% endif %}">
  47.             <img src="https://img0.land-mark.biz/ut_img/public_images/itempage/yoyaku/yoyaku.jpg" alt="在庫が無くても、予約注文なら今すぐご注文いただけます!" />
  48.         </div>
  49.         {% endif %}
  50.         <div class="supplement">
  51.             {{ lm_displayHosokuSetsumei2 | raw }}
  52.         </div>
  53.         <div id="shopping-cart-wrapper">
  54.             {{ goods | InventoryMatrix | raw }}
  55.         </div>
  56.         <script>
  57.             function linkinfo{{ goods.goodsId }}(msg, id) {
  58.                 if(!document.all && !document.getElementById) { return; }
  59.                 id = (!id)  ? "linkinfolay{{ goods.goodsId }}" : id;
  60.                 msg= (!msg) ? "" : msg;
  61.                 var el = (document.getElementById) ? document.getElementById(id) : document.all(id);
  62.                 el.innerHTML = msg;
  63.             }
  64.             function checkOrderLot{{ goods.goodsId }}() {
  65.                 const now = new Date();
  66.                 const from = new Date(now.getFullYear(), now.getMonth(), now.getDate());
  67.                 const to = new Date(from.getFullYear(), from.getMonth(), from.getDate() + 90);
  68.                 var buyAmount = 0;
  69.                 if ( document.cart_fm{{ goods.goodsId }}.sample.value != "on" && document.cart_fm{{ goods.goodsId }}.sample.value != "off" ) {
  70.                     return false;
  71.                 }
  72.                 for ( i=1; i<=document.cart_fm{{ goods.goodsId }}.elements.length; i++ ) {
  73.                     if ( document.cart_fm{{ goods.goodsId }}.elements[i-1].name.substring( 0, 4 ) == "cart" && document.cart_fm{{ goods.goodsId }}.elements[i-1].type == "text" ) {
  74.                         if ( document.cart_fm{{ goods.goodsId }}.elements[i-1].value != "" && document.cart_fm{{ goods.goodsId }}.elements[i-1].value.match(/[0-9]+/g) == document.cart_fm{{ goods.goodsId }}.elements[i-1].value ) {
  75.                             buyAmount += Number( document.cart_fm{{ goods.goodsId }}.elements[i-1].value );
  76.                         } else {
  77.                             document.cart_fm{{ goods.goodsId }}.elements[i-1].value = "";
  78.                         }
  79.                         const $input = $(document.cart_fm{{ goods.goodsId }}.elements[i-1]);
  80.                         if ($input.val().trim() !== '') {
  81.                             const nyuukaYoteibi = $input.data('nyuuka_yoteibi');
  82.                             if (nyuukaYoteibi) {
  83.                                 const tempDate = new Date(nyuukaYoteibi);
  84.                                 const date = new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate());
  85.                                 const daysDiff = getDiff(date, to);
  86.                                 if (daysDiff < 0) {
  87.                                     alert( "予約注文できるのは入荷予定日が90日以内のものだけです。" );
  88.                                     document.cart_fm{{ goods.goodsId }}.sample.value = "";
  89.                                     document.cart_fm{{ goods.goodsId }}.elements[i-1].focus();
  90.                                     return false;
  91.                                 }
  92.                             }
  93.                         }
  94.                     }
  95.                 }
  96.                 if ( buyAmount == 0 ) {
  97.                     alert( "半角数字で数量を入力してください。" );
  98.                     document.cart_fm{{ goods.goodsId }}.sample.value = "";
  99.                     document.cart_fm{{ goods.goodsId }}.cart_1_1.focus();
  100.                     return false;
  101.                 }
  102.                 if ( document.cart_fm{{ goods.goodsId }}.sample.value == "on" ) {
  103.                     err = false;
  104.                     err2 = 0;
  105.                     for ( i=1; i<=document.cart_fm{{ goods.goodsId }}.elements.length; i++ ) {
  106.                         if ( document.cart_fm{{ goods.goodsId }}.elements[i-1].name.substring( 0, 4 ) == "cart" && document.cart_fm{{ goods.goodsId }}.elements[i-1].type == "text" ) {
  107.                             if ( document.cart_fm{{ goods.goodsId }}.elements[i-1].value != "" && document.cart_fm{{ goods.goodsId }}.elements[i-1].value.match(/[0-9]+/g) == document.cart_fm{{ goods.goodsId }}.elements[i-1].value ) {
  108.                                 if ( Number( document.cart_fm{{ goods.goodsId }}.elements[i-1].value ) > 1 ) {
  109.                                     err = true;
  110.                                     //err2++;
  111.                                 } else if ( Number( document.cart_fm{{ goods.goodsId }}.elements[i-1].value ) == 1 ) {
  112.                                     //err2++;
  113.                                 }
  114.                                 err2+=Number( document.cart_fm{{ goods.goodsId }}.elements[i-1].value );
  115.                             }
  116.                         }
  117.                     }
  118.                     if ( err ) {
  119.                         for ( i=1; i<=document.cart_fm{{ goods.goodsId }}.elements.length; i++ ) {
  120.                             if ( document.cart_fm{{ goods.goodsId }}.elements[i-1].name.substring( 0, 4 ) == "cart" && document.cart_fm{{ goods.goodsId }}.elements[i-1].type == "text" ) {
  121.                                 if ( document.cart_fm{{ goods.goodsId }}.elements[i-1].value != "" && document.cart_fm{{ goods.goodsId }}.elements[i-1].value.match(/[0-9]+/g) == document.cart_fm{{ goods.goodsId }}.elements[i-1].value ) {
  122.                                     if ( Number( document.cart_fm{{ goods.goodsId }}.elements[i-1].value ) > 1 ) {
  123.                                         alert( '貸出サンプルは同色、同サイズ、1点でお願いします。');
  124.                                         document.cart_fm{{ goods.goodsId }}.elements[i-1].value = "1";
  125.                                         document.cart_fm{{ goods.goodsId }}.elements[i-1].focus();
  126.                                         return false;
  127.                                     }
  128.                                 }
  129.                             }
  130.                         }
  131.                     }
  132.                     if ( err2 > 10 ) {
  133.                         alert( '貸出サンプルは、色々な商品を合計して、10点以内でお願いします。');
  134.                         document.cart_fm{{ goods.goodsId }}.sample.value = "";
  135.                         document.cart_fm{{ goods.goodsId }}.cart_1_1.focus();
  136.                         return false;
  137.                     }
  138.                 }
  139.                 return true;
  140.             }
  141.             function send{{ goods.goodsId }}(){
  142.                 var win = window.open('','win{{ goods.goodsId }}','width=400,height=400,scrollbars=1');
  143.                 document.cart_fm{{ goods.goodsId }}.target = "win{{ goods.goodsId }}";
  144.                 document.cart_fm{{ goods.goodsId }}.submit();
  145.                 document.cart_fm{{ goods.goodsId }}.reset();
  146.             }
  147.         </script>
  148.     </div>
  149.     {% endif %}
  150. {% else %}
  151.     <div class="end-sale-msg">
  152.         <img alt="お問い合わせイラスト" src="https://img0.land-mark.biz/ut_img/public_images/detail/bow.png" width="150" /><br />
  153.         <br />
  154.         この商品は販売終了しました。<br />
  155.         商品に関するお問い合わせは<span>0120-115-116</span>までお電話ください。
  156.     </div>
  157. {% endif %}