{% if data.goods_status == 1 or data.goods_status == 11 or is_preview_mode or is_secret %}
<!-- カート -->
<div class="cart_title" style="position:relative;">
<div id="cart_title" style="position:absolute;top:-65px;"></div>
</div>
{% set viewConst = 'hoge' %}
{% if constant("_VIEW_ITEM_DETAIL_FLAG_#{data.goods_id}") is defined %}
{% set viewConst = constant("_VIEW_ITEM_DETAIL_FLAG_#{data.goods_id}") %}
{% endif %}
<script type="text/javascript">
(function() {
// // var DISPLAY_LINES = 6;
var DISPLAY_LINES = {{ DISPLAY_LINES }};
$(function() {
$('.categories').each(function(index, element) {
var ps = $(this).find('p.category').each(function(index, element) {
if (index >= DISPLAY_LINES) {
$(this).hide();
}
});
// 「もっと見る」機能を抑制
// // if (ps.length > DISPLAY_LINES) {
// // $('<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(
// // $('<div class="fadeout"></div><a href="#" style="text-decoration: none; color: #212121;">もっと見る...</a>')
// // .on('mouseleave', function() {
// // $(this).css({'text-decoration':'none','color':'#212121'});
// // }).on('mouseenter', function() {
// // $(this).css({'text-decoration':'none','color':'#36C'});
// // }).on('click', function(event) {
// // $(this).closest('p').hide();
// // $(this).closest(".fadeout").hide();
// // $(ps).slideDown();
// // return false;
// // })
// // ).appendTo($(ps).closest('div'));
// // }
});
});
}())
</script>
{% if eccube_config.GoodsSetPurchase.NewUI.Enabled and goods.isGoodsSetPurchase %}
{# include 'Item/GoodsSetPurchase/new_cart_area.twig' with { item: item } only #}
{% else %}
<div class="cart_area">
{% if isYoyakuAvailable %}
<div class="vim_flag" style="{% if viewConst != "on" %} display: none;{% endif %}">
<img src="https://img0.land-mark.biz/ut_img/public_images/itempage/yoyaku/yoyaku.jpg" alt="在庫が無くても、予約注文なら今すぐご注文いただけます!" />
</div>
{% endif %}
<div class="supplement">
{{ lm_displayHosokuSetsumei2 | raw }}
</div>
<div id="shopping-cart-wrapper">
{{ goods | InventoryMatrix | raw }}
</div>
<script>
function linkinfo{{ goods.goodsId }}(msg, id) {
if(!document.all && !document.getElementById) { return; }
id = (!id) ? "linkinfolay{{ goods.goodsId }}" : id;
msg= (!msg) ? "" : msg;
var el = (document.getElementById) ? document.getElementById(id) : document.all(id);
el.innerHTML = msg;
}
function checkOrderLot{{ goods.goodsId }}() {
const now = new Date();
const from = new Date(now.getFullYear(), now.getMonth(), now.getDate());
const to = new Date(from.getFullYear(), from.getMonth(), from.getDate() + 90);
var buyAmount = 0;
if ( document.cart_fm{{ goods.goodsId }}.sample.value != "on" && document.cart_fm{{ goods.goodsId }}.sample.value != "off" ) {
return false;
}
for ( i=1; i<=document.cart_fm{{ goods.goodsId }}.elements.length; i++ ) {
if ( document.cart_fm{{ goods.goodsId }}.elements[i-1].name.substring( 0, 4 ) == "cart" && document.cart_fm{{ goods.goodsId }}.elements[i-1].type == "text" ) {
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 ) {
buyAmount += Number( document.cart_fm{{ goods.goodsId }}.elements[i-1].value );
} else {
document.cart_fm{{ goods.goodsId }}.elements[i-1].value = "";
}
const $input = $(document.cart_fm{{ goods.goodsId }}.elements[i-1]);
if ($input.val().trim() !== '') {
const nyuukaYoteibi = $input.data('nyuuka_yoteibi');
if (nyuukaYoteibi) {
const tempDate = new Date(nyuukaYoteibi);
const date = new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate());
const daysDiff = getDiff(date, to);
if (daysDiff < 0) {
alert( "予約注文できるのは入荷予定日が90日以内のものだけです。" );
document.cart_fm{{ goods.goodsId }}.sample.value = "";
document.cart_fm{{ goods.goodsId }}.elements[i-1].focus();
return false;
}
}
}
}
}
if ( buyAmount == 0 ) {
alert( "半角数字で数量を入力してください。" );
document.cart_fm{{ goods.goodsId }}.sample.value = "";
document.cart_fm{{ goods.goodsId }}.cart_1_1.focus();
return false;
}
if ( document.cart_fm{{ goods.goodsId }}.sample.value == "on" ) {
err = false;
err2 = 0;
for ( i=1; i<=document.cart_fm{{ goods.goodsId }}.elements.length; i++ ) {
if ( document.cart_fm{{ goods.goodsId }}.elements[i-1].name.substring( 0, 4 ) == "cart" && document.cart_fm{{ goods.goodsId }}.elements[i-1].type == "text" ) {
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 ) {
if ( Number( document.cart_fm{{ goods.goodsId }}.elements[i-1].value ) > 1 ) {
err = true;
//err2++;
} else if ( Number( document.cart_fm{{ goods.goodsId }}.elements[i-1].value ) == 1 ) {
//err2++;
}
err2+=Number( document.cart_fm{{ goods.goodsId }}.elements[i-1].value );
}
}
}
if ( err ) {
for ( i=1; i<=document.cart_fm{{ goods.goodsId }}.elements.length; i++ ) {
if ( document.cart_fm{{ goods.goodsId }}.elements[i-1].name.substring( 0, 4 ) == "cart" && document.cart_fm{{ goods.goodsId }}.elements[i-1].type == "text" ) {
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 ) {
if ( Number( document.cart_fm{{ goods.goodsId }}.elements[i-1].value ) > 1 ) {
alert( '貸出サンプルは同色、同サイズ、1点でお願いします。');
document.cart_fm{{ goods.goodsId }}.elements[i-1].value = "1";
document.cart_fm{{ goods.goodsId }}.elements[i-1].focus();
return false;
}
}
}
}
}
if ( err2 > 10 ) {
alert( '貸出サンプルは、色々な商品を合計して、10点以内でお願いします。');
document.cart_fm{{ goods.goodsId }}.sample.value = "";
document.cart_fm{{ goods.goodsId }}.cart_1_1.focus();
return false;
}
}
return true;
}
function send{{ goods.goodsId }}(){
var win = window.open('','win{{ goods.goodsId }}','width=400,height=400,scrollbars=1');
document.cart_fm{{ goods.goodsId }}.target = "win{{ goods.goodsId }}";
document.cart_fm{{ goods.goodsId }}.submit();
document.cart_fm{{ goods.goodsId }}.reset();
}
</script>
</div>
{% endif %}
{% else %}
<div class="end-sale-msg">
<img alt="お問い合わせイラスト" src="https://img0.land-mark.biz/ut_img/public_images/detail/bow.png" width="150" /><br />
<br />
この商品は販売終了しました。<br />
商品に関するお問い合わせは<span>0120-115-116</span>までお電話ください。
</div>
{% endif %}