{% extends 'default_frame.twig' %}
{% set body_class = 'product_page' %}
{% block stylesheet %}
<link rel="stylesheet" href="/test/sm.css?v=9" media="screen and (max-width:640px)"/>
<link rel="stylesheet" href="/test/pc.css?v=9" media="screen and (min-width:641px)"/>
<link rel="stylesheet" href="/common4/css/product_detail.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css" />
<style>/* Fancybox全体を最前面に */
.fancybox__container { z-index: 2147483640 !important; }
#syousai_img .none{
display: none;
}
/* 再入荷通知ボタン */
.btns.restock a {
background-color: #ff6b6b !important;
border-color: #ff6b6b !important;
color: #fff !important;
}
.btns.restock a:hover {
background-color: #ee5a5a !important;
border-color: #ee5a5a !important;
}
.btns.restock-registered a {
background-color: #6c757d !important;
border-color: #6c757d !important;
color: #fff !important;
}
.btns.restock-registered a:hover {
background-color: #5a6268 !important;
border-color: #545b62 !important;
}
</style>
{% endblock %}
{% block javascript %}
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script>
<script>
eccube.classCategories = {{ class_categories_as_json(Product)|raw }};
// 規格2に選択肢を割り当てる。
function fnSetClassCategories(form, classcat_id2_selected) {
var $form = $(form);
var product_id = $form.find('input[name=product_id]').val();
var $sele1 = $form.find('select[name=classcategory_id1]');
var $sele2 = $form.find('select[name=classcategory_id2]');
eccube.setClassCategories($form, product_id, $sele1, $sele2, classcat_id2_selected);
}
{% if form.classcategory_id2 is defined %}
fnSetClassCategories(
$('#form1'),{{ form.classcategory_id2.vars.value|json_encode|raw }}
);
{% elseif form.classcategory_id1 is defined %}
eccube.checkStock($('#form1'), {{ Product.id }}, {{ form.classcategory_id1.vars.value|json_encode|raw }}, null);
{% endif %}
</script>
<script>
$(function () {
// bfcache無効化
$(window).bind('pageshow', function (event) {
if (event.originalEvent.persisted) {
location.reload(true);
}
});
// Core Web Vital の Cumulative Layout Shift(CLS)対策のため
// img タグに width, height が付与されている.
// 630px 未満の画面サイズでは縦横比が壊れるための対策
// see https://github.com/EC-CUBE/ec-cube/pull/5023
$('.ec-grid2__cell').hide();
var removeSize = function () {
$('.slide-item').height('');
$('.slide-item img')
.removeAttr('width')
.removeAttr('height')
.removeAttr('style');
};
var slickInitial = function (slick) {
$('.ec-grid2__cell').fadeIn(1500);
var baseHeight = $(slick.target).height();
var baseWidth = $(slick.target).width();
var rate = baseWidth / baseHeight;
$('.slide-item').height(baseHeight * rate); // 余白を削除する
// transform を使用することでCLSの影響を受けないようにする
$('.slide-item img')
.css(
{
'transform-origin': 'top left',
'transform': 'scaleY(' + rate + ')',
'transition': 'transform .1s'
}
);
// 正しいサイズに近くなったら属性を解除する
setTimeout(removeSize, 500);
};
$('.item_visual').on('init', slickInitial);
// リサイズ時は CLS の影響を受けないため属性を解除する
$(window).resize(removeSize);
$('.item_visual').slick({
dots: false,
arrows: false,
responsive: [{
breakpoint: 768,
settings: {
dots: true
}
}]
});
$('.slideThumb').on('click', function () {
var index = $(this).attr('data-index');
$('.item_visual').slick('slickGoTo', index, false);
})
});
</script>
<script>
$(function () {
$('.add-cart').on('click', function (event) {
{% if form.classcategory_id1 is defined %}
// 規格1フォームの必須チェック
if ($('#classcategory_id1').val() == '__unselected' || $('#classcategory_id1').val() == '') {
$('#classcategory_id1')[0].setCustomValidity('{{ '項目が選択されていません'|trans }}');
return true;
} else {
$('#classcategory_id1')[0].setCustomValidity('');
}
{% endif %}
{% if form.classcategory_id2 is defined %}
// 規格2フォームの必須チェック
if ($('#classcategory_id2').val() == '__unselected' || $('#classcategory_id2').val() == '') {
$('#classcategory_id2')[0].setCustomValidity('{{ '項目が選択されていません'|trans }}');
return true;
} else {
$('#classcategory_id2')[0].setCustomValidity('');
}
{% endif %}
// 個数フォームのチェック
if ($('#quantity').val() < 1) {
$('#quantity')[0].setCustomValidity('{{ '1以上で入力してください。'|trans }}');
return true;
} else {
$('#quantity')[0].setCustomValidity('');
}
event.preventDefault();
$form = $('#form1');
$.ajax({
url: $form.attr('action'),
type: $form.attr('method'),
data: $form.serialize(),
dataType: 'json',
beforeSend: function (xhr, settings) {
// Buttonを無効にする
$('.add-cart').prop('disabled', true);
}
}).done(function (data) {
// レスポンス内のメッセージをalertで表示
$.each(data.messages, function () {
$('#ec-modal-header').text(this);
});
$('.ec-modal').show()
// カートブロックを更新する
$.ajax({
url: "{{ url('block_cart') }}",
type: 'GET',
dataType: 'html'
}).done(function (html) {
$('.ec-headerRole__cart').html(html);
});
}).fail(function (data) {
alert('{{ 'カートへの追加に失敗しました。'|trans }}');
}).always(function (data) {
// Buttonを有効にする
$('.add-cart').prop('disabled', false);
});
});
});
$('.ec-modal-wrap').on('click', function (e) {
// モーダル内の処理は外側にバブリングさせない
e.stopPropagation();
});
$('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function () {
$('.ec-modal').hide()
});
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Product",
"name": "{{ Product.name }}",
"image": [
{% for img in Product.ProductImage %}
"{{ app.request.schemeAndHttpHost }}{{ asset(img, 'save_image') }}"{% if not loop.last %},{% endif %}
{% else %}
"{{ app.request.schemeAndHttpHost }}{{ asset(''|no_image_product, 'save_image') }}"
{% endfor %}
],
"description": "{{ Product.description_list | default(Product.description_detail) | replace({'\n': '', '\r': ''}) | slice(0,300) }}
",
{% if Product.code_min %}
"sku": "{{ Product.code_min }}",
{% endif %}
"offers": {
"@type": "Offer",
"url": "{{ url('product_detail', {'id': Product.id}) }}",
"priceCurrency": "{{ eccube_config.currency }}",
"price": "{{ Product.getPrice02IncTaxMin ? Product.getPrice02IncTaxMin : 0 }}",
"availability": "{{ Product.stock_find ? "InStock" : "OutOfStock" }}"
}
}
</script>
<script>
$(function () {
$("#syosuai_wrap dl dt#syousai_img p img").on("click", function () {
let src = $(this).attr("src");
$("#main_img").attr("src", src);
});
});
function doSubmit() {
$("#form1").submit();
}
function doFavorite() {
$("#form2").submit();
}
$(function () {
$('.ec-layoutRole__mainBottom').insertAfter('.syousai_txt');
});
function do_contact_product(){
$("#contact_product").submit();
}
function changeImage(src){
$("#main_img").attr("src", src);
}
// 再入荷通知の登録・解除
function handleRestockAction(productId, type) {
var action = type === 1 ? "登録" : "解除";
if (confirm("再入荷通知を" + action + "しますか?")) {
location.href = "{{ url('product_restock', {'id': 0}) }}".replace('/0', '/' + productId) + "?type=" + type;
}
}
// 数量変更時にリクエスト予約フォームに反映
$(function(){
$("#quantity").on("change", function(){
var val = $(this).val();
$("#reserve_num").val(val);
});
});
</script>
<script>
//カート固定
(function () {
const cart = document.getElementById('cartfix');
const cartbox = document.getElementById('cartbox');
const wrap = document.querySelector('.ec-layoutRole__contents');
function syncCartboxHeight() {
cartbox.style.height = wrap.offsetHeight + 'px';
}
function onScroll() {
const screenWidth = window.innerWidth;
const distanceFromBottom =
wrap.offsetHeight - window.scrollY - cart.offsetHeight;
syncCartboxHeight();
if (screenWidth > 640) {
if (window.scrollY < 60) {
cart.style.position = 'sticky';
cart.style.top = '214px';
cart.style.bottom = 'auto';
cart.style.padding = '20px';
}
else if (distanceFromBottom <= 60) {
cart.style.position = 'absolute';
cart.style.top = 'auto';
cart.style.bottom = '68px';
cart.style.padding = '20px';
}
else {
cart.style.position = 'sticky';
cart.style.top = '214px';
cart.style.bottom = 'auto';
cart.style.padding = '20px';
}
}
else {
cart.style.position = 'relative';
cart.style.top = 'auto';
cart.style.bottom = 'auto';
cartbox.style.height = 'auto';
}
}
syncCartboxHeight();
window.addEventListener('scroll', onScroll);
window.addEventListener('resize', syncCartboxHeight);
})();
</script>
<link rel="stylesheet" href="/common/css/slider-pro.min.css" media="screen"/>
<script src="/common/js/jquery.sliderPro.js"></script>
<script type="text/javascript">
$(function(){
doSlider();
});
function doSlider(){
$('#palace_img_area').sliderPro({
width:850,
height: 850,
thumbnailWidth :80,
thumbnailHeight:80,
thumbnailPointer :true,
fade: true,
arrows: true,
fadeArrows:false,
thumbnailArrows:true,
fadeThumbnailArrows:false,
buttons: false,
fullScreen: false,
thumbnailArrows: true,
autoHeight: true,
autoplay: false
});
}
</script>
{% endblock %}
{% block main %}
{% set id = Product.id %}
<div id="syosuai_wrap">
<dl>
<dt id="syousai_img">
<!--//商品画像-->
<div id="palace_img_area" class="slider-pro">
<div class="sp-slides">
{% for ProductImage in Product.ProductImage %}
<div class="sp-slide">
<a href="{{ asset(ProductImage, 'save_image') }}" data-fancybox="gallery">
<img src="{{ asset(ProductImage, 'save_image') }}" loading="lazy" alt="#"></a>
</div>
{% endfor %}
</div>
<div class="sp-thumbnails">
{% for ProductImage in Product.ProductImage %}
<img class="sp-thumbnail" src="{{ asset(ProductImage, 'save_image') }}" alt="#"/>
{% endfor %}
</div>
</div>
<!--//商品画像-->
</dt>
<dd id="syousai_txt">
<h1>{{ Product.name }}</h1>
{% if (htEx[1] is defined and htEx[1]) or
(htEx[50] is defined and htEx[50]) or
(htEx[3] is defined and htEx[3]) or
(htEx[28] is defined and htEx[28])
%}
<h2>
{% if htEx[1] is defined and htEx[1] %}
{% if htEx[1] == "未鑑定" %}
<span>未鑑定</span>
{% else %}
<span>{{ htEx[1] }}</span>
{% endif %}
{% endif %}
{% if htEx[50] is defined and htEx[50] %}<span>{{ htEx[50] }}</span>{% endif %}
{% if htEx[3] is defined and htEx[3] and htEx[3] != "---" %}<span>グレード:{{ htEx[3] }}</span>{% endif %}
{% if htEx[28] is defined and htEx[28] == "有り" %}<span>専用BOX付き</span>{% endif %}
</h2>
{% endif %}
<p class="clear"></p>
<table border="0" cellspacing="0" cellpadding="0" class="item_spec_table">
<tbody>
<tr>
<th>品番</th>
<td>{{ Product.id }}</td>
</tr>
{% if htEx[1] is defined and htEx[1] and htEx[2] is defined and htEx[2] %}
<tr>
<th>鑑定番号</th>
<td>
{% if htEx[1] == "PCGS" %}
<img src="/common/img/pcgslogo.png" class="type_logo" alt="PCGS">
<a href="https://www.pcgsasia.com/cert/{{ htEx[2] }}?l=ja"
target="_blank">{{ htEx[2] }}</a>
{% elseif htEx[1] == "NGC" and htEx[3] is defined %}
<img src="/common/img/ngc.jpg" class="type_logo" alt="NGC">
<a href="https://www.ngccoin.com/certlookup/{{ htEx[2] }}/{{ htEx[3]|replace({' ': ''}) }}/"
target="_blank">{{ htEx[2] }}</a>
{% endif %}
</td>
</tr>
{% endif %}
{% if htEx[3] is defined and htEx[3] and htEx[3] != "---" %}
<tr>
<th>グレード数</th>
<td>{{ htEx[3] }}</td>
</tr>
{% endif %}
{% if htEx[20] is defined and htEx[20] %}
<tr>
<th>タイプ</th>
<td>{{ htEx[20] }}</td>
</tr>
{% endif %}
{% if htEx[34] is defined and htEx[34] %}
<tr>
<th>発行限定数</th>
<td>{{ htEx[34] }}</td>
</tr>
{% endif %}
{% if htEx[51] is defined and htEx[51] %}
<tr>
<th>最大発行数</th>
<td>{{ htEx[51] }}</td>
</tr>
{% endif %}
{% if htEx[45] is defined and htEx[45] %}
<tr>
<th>世界現存数</th>
<td>{{ htEx[45] }}</td>
</tr>
{% endif %}
{% if htEx[35] is defined and htEx[35] %}
<tr>
<th>重量</th>
<td>{{ htEx[35] }}</td>
</tr>
{% endif %}
{% if htEx[36] is defined and htEx[36] %}
<tr>
<th>直径</th>
<td>{{ htEx[36] }}</td>
</tr>
{% endif %}
{% if htEx[50] is defined and htEx[50] %}
<tr>
<th>品位</th>
<td>{{ htEx[50] }}</td>
</tr>
{% endif %}
{% if htEx[37] is defined and htEx[37] %}
<tr>
<th>表面</th>
<td>{{ htEx[37] }}</td>
</tr>
{% endif %}
{% if htEx[38] is defined and htEx[38] %}
<tr>
<th>表面</th>
<td>{{ htEx[38] }}</td>
</tr>
{% endif %}
{% if htEx[39] is defined and htEx[39] %}
<tr>
<th>エッジの刻銘</th>
<td>{{ htEx[39] }}</td>
</tr>
{% endif %}
{% if htEx[46] is defined and htEx[46] %}
<tr>
<th>発送元</th>
<td>{{ htEx[46] }}</td>
</tr>
{% endif %}
<tr>
<th>納期</th>
<td>
{% if htEx[47] is defined and htEx[47] %}
{{ htEx[47] }}
{% else %}
<a href="javascript:do_contact_product()">お問い合わせ</a>ください
{% endif %}
</td>
</tr>
</tbody>
</table>
{% if htEx[60] is defined and htEx[60] %}
<div id="shop_voice">
<div class="voice_area">{{ htEx[60] }}</div>
</div>
{% endif %}
</dd>
<dt id="cartbox">
<div id="cartfix">
{% set s_name = Product.Status.name %}
{% if Product.stock_find %}
{% if s_name == "非公開" %}
<ul id="zaiko">
<li>在庫有り</li>
<li></li>
</ul>
{% elseif s_name == "予約品(公開)" %}
<p class="yoyaku"><span>予約品</span></p>
{% if htEx[55] is defined and htEx[55] %}
<p class="meyasu_price"><span>目安価格:</span><b>{{ htEx[55]|number_format }}<em>円(税込)</em></b></p>
{% endif %}
{% elseif s_name == "取り置き(公開)" %}
<p class="meyasu">一般価格:<s>¥ {{ Product.getPrice02IncTaxMin|number_format }}</s><em>(税込)</em></p>
{% if member_price %}
<p class="meyasu red">会員価格:</p>
<p class="yen noto-sans red"><span>¥</span>{{ member_price|number_format }} <em>(税込)</em></p>
{% endif %}
<p id="item_tag"><span id="torioki">取り置き中</span>
{% if product_disp_date is defined %}
<b>{{ product_disp_date }}</b>
{% endif %}
</p>
<p id="yoyaku_txt">取り置き中です<br>お問い合わせ下さい</p>
{% elseif Product.getPrice02IncTaxMin == 0 %}
<p id="item_tag"><b>誠にお手数ですが、お問合せお願い申し上げます。<br>こちらの商品は現在価格が確定しておりませんので、確定次第ご案内申し上げます。</b>
</p>
<p id="yoyaku_txt"></p>
{% else %}
<p class="meyasu">一般価格:<s>¥ {{ Product.getPrice02IncTaxMin|number_format }}</s><em>(税込)</em></p>
{% if member_price %}
<p class="meyasu red">会員価格:</p>
<p class="yen noto-sans red"><span>¥</span>{{ member_price|number_format }} <em>(税込)</em></p>
{% endif %}
{% if jigane_flg %}
<ul id="zaiko"><li>在庫有り</li>
<li>{% if Product.getStockFind == true %}残り {{ Product.getStockMax }}点{% endif %}
{% if htEx[64] is defined and htEx[64] == "117" %}
<small>(入荷予定あり)</small>
{% endif %}
</li>
</ul>
{% endif %}
{% endif %}
{% else %}
{% if s_name == "取り置き(公開)" %}
<p class="meyasu">一般価格:<s>¥ {{ Product.getPrice02IncTaxMin|number_format }}</s><em>(税込)</em></p>
{% if member_price %}
<p class="meyasu red">会員価格:</p>
<p class="yen noto-sans red"><span>¥</span>{{ member_price|number_format }} <em>(税込)</em></p>
{% endif %}
{% endif %}
{% endif %}
<form action="{{ url('product_add_cart', {id:Product.id}) }}" method="post" id="form1" name="form1">
{% if form.quantity is defined %}
{% if s_name == "非売品" %}
{% elseif s_name == "取り置き(公開)" %}
{% elseif s_name == "予約品(公開)" %}
<div id="quantity_area">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<th>数量:</th>
<td>
{{ form_widget(form.quantity) }}
{{ form_errors(form.quantity) }}
</td>
</tr>
</tbody>
</table>
</div>
{% elseif Product.getPrice02IncTaxMin == 0 %}
{% else %}
<div id="quantity_area">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<th>数量:</th>
<td>
{{ form_widget(form.quantity) }}
{{ form_errors(form.quantity) }}
</td>
</tr>
</tbody>
</table>
</div>
{% endif %}
{% endif %}
{% if Product.stock_find %}
<div class="ec-productRole__actions">
{% if form.classcategory_id1 is defined %}
<div class="ec-select">
{{ form_row(form.classcategory_id1) }}
{{ form_errors(form.classcategory_id1) }}
</div>
{% if form.classcategory_id2 is defined %}
<div class="ec-select">
{{ form_row(form.classcategory_id2) }}
{{ form_errors(form.classcategory_id2) }}
</div>
{% endif %}
{% endif %}
</div>
{% if s_name == "非売品" %}
{% elseif s_name == "取り置き(公開)" %}
{% elseif s_name == "予約品(公開)" %}
{# リクエスト予約ボタン(カートボタンの代わり) #}
{% elseif Product.getPrice02IncTaxMin == 0 %}
{% else %}
<p class="btns ye"><a href="javascript:void(0)" onclick="doSubmit()">
<i class="fa-solid fa-cart-shopping"></i> カートに入れる</a></p>
{% endif %}
{% else %}
<p class="btns ye"><a href="javascript:void(0)" disabled="disabled"><i
class="fa-solid fa-cart-shopping"></i> ただいま品切れ中です。</a></p>
{# 再入荷通知ボタン #}
{% if restock_disp_flg is defined and restock_disp_flg == 1 %}
{% if restock_regist_flg is defined and restock_regist_flg == 1 %}
<p class="btns restock-registered"><a href="javascript:void(0)" onclick="handleRestockAction({{ Product.id }}, 2)"><i class="fa-solid fa-bell-slash"></i> 再入荷通知を解除</a></p>
{% else %}
<p class="btns restock"><a href="javascript:void(0)" onclick="handleRestockAction({{ Product.id }}, 1)"><i class="fa-solid fa-bell"></i> 再入荷通知を登録</a></p>
{% endif %}
{% endif %}
{% endif %}
{% if BaseInfo.option_favorite_product %}
{% if is_favorite == false %}
<p class="btns or"><a href="javascript:void(0)" onclick="doFavorite()"><i
class="fa-solid fa-star"></i> お気に入りに追加</a></p>
{% else %}
<p class="btns or"><a href="javascript:void(0)" disabled="disabled"><i
class="fa-solid fa-star"></i>
お気に入りに追加済みです。</a></p>
{% endif %}
{% endif %}
{{ form_rest(form) }}
</form>
{% if s_name == "予約品(公開)" %}
{# リクエスト予約フォーム #}
<form name="product_reserve" id="product_reserve" action="{{ url('plugin_pia_product_reserve') }}" method="post">
<input type="hidden" name="id" value="{{ Product.id }}">
<input type="hidden" id="reserve_num" name="num" value="1">
<p class="btns ye"><button type="submit"><i class="fa-solid fa-calendar-check"></i> リクエスト予約</button></p>
</form>
{% endif %}
<form name="contact_product" id="contact_product" action="/product_contact" method="post">
<input type="hidden" name="id" value="{{ Product.id }}">
<div class="btn_area">
<ul class="row">
<li><button type="submit" id="item-mail">商品についてのお問い合わせ</button></li>
</ul>
</div>
</form>
<p class="btm_txt"><a href="/user_data/delivery">配送・送料・返品について</a></p>
{% if s_name == "予約品(公開)" %}
<div class="can kaigai">
<p>海外受注生産の為、ご注文後のキャンセルができません。<br>
また、ご注文確定後でも入手が確約できない場合がございますので、何卒ご了承の程お願い申し上げます。
</p></div>
<div class="yoyaku_txt2">
ご予約後、価格や納期についてご連絡申し上げます。
数に限りがございますので、ご連絡時点で予約が終了している可能性があることを予めご了承ください。
</div>
{% endif %}
<div class="ec-modal">
<div class="ec-modal-overlay">
<div class="ec-modal-wrap">
<span class="ec-modal-close"><span class="ec-icon"><img src="{{ asset('assets/icon/cross-dark.svg') }}"
alt=""/></span></span>
<div id="ec-modal-header"
class="text-center">{{ 'カートに追加しました。'|trans }}</div>
<div class="ec-modal-box">
<div class="ec-role">
<span class="ec-inlineBtn--cancel">{{ 'お買い物を続ける'|trans }}</span>
<a href="{{ url('cart') }}"
class="ec-inlineBtn--action">{{ 'カートへ進む'|trans }}</a>
</div>
</div>
</div>
</div>
</div>
{% if BaseInfo.option_favorite_product %}
<form action="{{ url('product_add_favorite', {id:Product.id}) }}" id="form2"
method="post"></form>
{% endif %}
</div><!-- cartfix -->
</dt>
</dl>
</div><!-- syosuai_wrap -->
<div id="syousai_btm">
<dl>
<dt id="left">
<div class="syousai_txt">
<dl>
<dt><h3>商品詳細</h3></dt>
<dd>
{{ Product.description_detail|raw }}
</dd>
</dl>
</div><!-- syousai_txt -->
</dt><!-- left -->
<dd></dd>
</dl>
</div><!-- syousai_btm -->
{% endblock %}