{% extends 'default_frame.twig' %}
{% set body_class = 'product_page' %}
{% block stylesheet %}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.css"/>
<link rel="stylesheet" href="/test-ec-05/html/user_data/assets/css/detail.min.css">
<style>
.ec-layoutRole .ec-layoutRole__contents {
max-width: unset;
}
.p-detail__fv__inner__right {
width: 40%;
}
.p-detail__fv__inner__right__price {
font-size: clamp(30px,3.2vw,36px);
}
.p-detail__fv__inner__right__price .small {
font-size: 16px;
}
.p-detail__fv__inner__right__quantity {
justify-content: left;
align-items: flex-end;
margin: 15px 0 0;
}
.ec-productRole__btn,.ec-productRole__btn {
width: 200px;
margin-right: 40px;
}
.ec-productRole__btn button,.ec-productRole__btn button {
font-size: 16px;
border-radius: 5px;
}
.ec-blockBtn--action {
background-color: #B72C11;
border-color: #B72C11;
}
.ec-blockBtn--cancel {
background-color: #EEC5C1;
border-color: #EEC5C1;
color: #333;
}
.ec-productRole__price {
line-height: 0;
}
.ec-productRole__description {
margin-top: 20px;
border-top: 1px solid #333;
padding-top: 10px;
}
.p-detail__fv__inner__right__price {
color: #B72C11;
font-weight: bold;
}
.p-detail__fv__inner__right__price.underline{
border-bottom: 1px solid #B72C11;
}
.sale.ec-blockBtn--action {
width: fit-content;
font-size: 18px;
cursor: unset;
line-height: 1.8;
display: inline-block;
height: auto;
margin-left: 15px;
}
.Category__list {
display: flex;
}
.Category__list_item {
margin-right: 15px;
}
.Category__list_item a {
display: block;
background-color: #fefefe;
border: 1px solid #333;
padding: 0 8px;
color: #333;
border-radius: 5px;
}
@media screen and (min-width:768px) and (max-width:1024px) {
.ec-productRole__btn {
margin-right: 40px;
width: 250px;
}
.p-detail__fv__inner__right {
width: 100%;
}
}
@media screen and (max-width:768px) {
.p-detail__fv__inner__right {
width: 100%;
}
.ec-productRole__btn {
width: 70%;
}
.p-detail__fv__inner__right__quantity {
flex-direction: column;
justify-content: space-between;
align-items: stretch;
}
.ec-productRole__btn {
margin-bottom: 20px;
}
.ec-numberInput {
margin-bottom: 15px;
}
.sale.ec-blockBtn--action {
margin-left: 0;
display: block;
}
}
</style>
{% endblock %}
{% block javascript %}
<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
}
}]
});
});
</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}},
// "price": {{ Product.getPrice02Min ? Product.getPrice02Min : 0}},
"availability": "{{ Product.stock_find ? "InStock" : "OutOfStock" }}"
}
}
</script>
{% endblock %}
{% block main %}
<section class="p-detail__fv">
<div class="p-detail__fv__inner">
<div class="p-detail__fv__inner__left">
<div class="swiper">
<!-- Additional required wrapper -->
<div class="swiper-wrapper">
<!-- Slides -->
{% for ProductImage in Product.ProductImage %}
<div class="swiper-slide"><img src="{{ asset(ProductImage, 'save_image') }}" alt="{{ loop.first ? Product.name : '' }}"></div>
{% else %}
<div class="swiper-slide"><img src="{{ asset(''|no_image_product, 'save_image') }}" alt="{{ loop.first ? Product.name : '' }}" /></div>
{% endfor %}
</div>
</div>
<div class="slider-thumbnail">
<!-- Additional required wrapper -->
<div class="swiper-wrapper">
<!-- Slides -->
{% for ProductImage in Product.ProductImage %}
<div class="swiper-slide" data-index="{{ loop.index0 }}"><img src="{{ asset(ProductImage, 'save_image') }}" alt="" width="133" height="133" loading="lazy"></div>
{% endfor %}
</div>
</div>
<p style="text-align: left; font-size:14px;">※写真はイメージです。<br>配達時には食品安全考慮の為真空パックにてお届け致します。</p>
{% if Product.id == '9' or Product.id == '7' or Product.id == '8' or Product.id == '18' or Product.id == '6' or Product.id == '5' or Product.id == '14' or Product.id == '13' or Product.id == '19' %}
<p style="text-align: left; font-size:14px;">※商品に味付けはございません。<br>ご家庭で塩、ブラックペッパー、タレ、お出汁などご準備ください。</p>
{% elseif Product.id == '12' %}
<p style="text-align: left; font-size:14px;">※塩、ブラックペッパーにて味付けをしておりますが、<br>調理後味気が足りない場合は塩を少々お掛けください。<br>また、わさび、おろししょうが、おろしニンニクが合います。</p>
{% elseif Product.id == '11' %}
<p style="text-align: left; font-size:14px;">※塩、ブラックペッパーにて味付けされておりますので調理後そのままお召し上がり下さい。</p>
{% elseif Product.id == '16' or Product.id == '17' %}
<p style="text-align: left; font-size:14px;">※ご自宅の油にてお揚げください。<br>※卵、小麦粉、パン粉を使用しております。<br>当該品目のアレルギーをお持ちの方はお控え下さい。</p>
{% endif %}
<div class="ec-productRole__description__pcNone">{{ Product.description_detail|raw|nl2br }}
</div>
</div>
<div class="p-detail__fv__inner__right">
{% if Product.freearea %}
<p class="p-detail__fv__inner__right__subtitle">
{{ include(template_from_string(Product.freearea)) }}
{#<br>{{ Product.name }}#}
</p>
{% endif %}
{#<h2 class="p-detail__fv__inner__right__title">#}
{# {{ Product.name }}#}
{#</h2>#}
{% if Product.hasProductClass -%}
<div class="ec-productRole__priceRegular">
{% if Product.getPrice01Min is not null and Product.getPrice01IncTaxMin == Product.getPrice01IncTaxMax %}
<span class="ec-productRole__priceRegularPrice">{{ '通常価格'|trans }}:<span class="price01-default">{{ Product.getPrice01IncTaxMin|price }}</span></span>
{#<span class="ec-productRole__priceRegularPrice">{{ '通常価格'|trans }}:<span class="price01-default">{{ Product.getPrice01Min|price }}</span></span>#}
<span class="ec-productRole__priceRegularTax">{{ '税込'|trans }}</span>
{% elseif Product.getPrice01Min is not null and Product.getPrice01Max is not null %}
<span class="ec-productRole__priceRegularPrice">{{ '通常価格'|trans }}:<span class="price01-default">{{ Product.getPrice01IncTaxMin|price }}~ {{ Product.getPrice01IncTaxMax|price }}</span></span>
{#<span class="ec-productRole__priceRegularPrice">{{ '通常価格'|trans }}:<span class="price01-default">{{ Product.getPrice01Min|price }}~ {{ Product.getPrice01Max|price }}</span></span>#}
<span class="ec-productRole__priceRegularTax">{{ '税込'|trans }}</span>
{% endif %}
</div>
{% else %}
{% if Product.getPrice01Max is not null %}
<span class="ec-productRole__priceRegularPrice">{{ '通常価格'|trans }}:{{ Product.getPrice01IncTaxMin|price }}</span>
{#<span class="ec-productRole__priceRegularPrice">{{ '通常価格'|trans }}:{{ Product.getPrice01Min|price }}</span>#}
<span class="ec-productRole__priceRegularTax">{{ '税込'|trans }}</span>
{% endif %}
{% endif %}
<p class="p-detail__fv__inner__right__price">
<div class="ec-productRole__price">
販売価格
{% if Product.hasProductClass -%}
{% if Product.getPrice02IncTaxMin == Product.getPrice02IncTaxMax %}
<div class="p-detail__fv__inner__right__price">
<span class="ec-price__price price02-default p-detail__fv__inner__right__price underline">{{ Product.getPrice02IncTaxMin|price }}</span>
{#<span class="ec-price__price price02-default p-detail__fv__inner__right__price">{{ Product.getPrice02Min|price }}</span>#}
<span class="ec-price__tax small">{{ '税込'|trans }}</span>
</div>
{% else %}
<div class="p-detail__fv__inner__right__price">
<span class="ec-price__price price02-default p-detail__fv__inner__right__price underline">{{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}</span>
{#<span class="ec-price__price price02-default p-detail__fv__inner__right__price">{{ Product.getPrice02Min|price }} ~ {{ Product.getPrice02Max|price }}</span>#}
<span class="ec-price__tax small">{{ '税込'|trans }}</span>
</div>
{% endif %}
{% else %}
<div class="p-detail__fv__inner__right__price">
<span class="ec-price__price p-detail__fv__inner__right__price underline">{{ Product.getPrice02IncTaxMin|price }}</span>
{#<span class="ec-price__price p-detail__fv__inner__right__price">{{ Product.getPrice02Min|price }}</span>#}
<span class="ec-price__tax small">{{ '税込'|trans }}</span>
</div>
{% endif %}
</div>
</p>
{% if Product.ProductCategories is not empty %}
<div class="ec-productRole__category">
<div>{{ '関連カテゴリ'|trans }}</div>
<ul class="Category__list">
{% for ProductCategory in Product.ProductCategories %}
<li class="Category__list_item">
{% for Category in ProductCategory.Category.path %}
<a href="{{ url('product_list') }}?category_id={{ Category.id }}#page_anchor">{{ Category.name }}</a> {%- if loop.last == false %}
<span>></span>{% endif -%}
{% endfor %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
<div class="p-detail__fv__inner__right__quantity">
{#<p>数量</p>#}
{#<div class="p-detail__fv__inner__right__quantity__box">#}
{# <p>ー</p>#}
{# <p>1</p>#}
{# <p>+</p>#}
{#</div>#}
<form action="{{ url('product_add_cart', {id:Product.id}) }}" method="post" id="form1" name="form1">
{% 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 class="ec-numberInput"><span>{{ '数量'|trans }}</span>
{{ form_widget(form.quantity) }}
{{ form_errors(form.quantity) }}
</div>
</div>
<div class="ec-productRole__btn">
<button type="submit" class="ec-blockBtn--action add-cart">
{{ 'カートに入れる'|trans }}
</button>
</div>
{% else %}
<div class="ec-productRole__btn">
<button type="button" class="ec-blockBtn--action" disabled="disabled">
{{ 'ただいま品切れ中です。'|trans }}
</button>
</div>
{% endif %}
{{ form_rest(form) }}
</form>
<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}) }}" method="post">
<div class="ec-productRole__btn">
{% if is_favorite == false %}
<button type="submit" id="favorite" class="ec-blockBtn--cancel">
{{ 'お気に入りに追加'|trans }}
</button>
{% else %}
<button type="submit" id="favorite" class="ec-blockBtn--cancel"
disabled="disabled">{{ 'お気に入りに追加済です。'|trans }}
</button>
{% endif %}
</div>
</form>
{% endif %}
</div>
<p style="margin-top: 15px; font-size:14px;">送料は全国一律1,350円となっております。<br>
商品合計金額で16,000円以上購入で、送料は弊社負担とさせていただきます。</p>
<div class="ec-productRole__description__spNone">{{ Product.description_detail|raw|nl2br }}
</div>
</div>
</div>
</section>
<section class="p-detail__merchandise">
<img class="cloud2" src="{{asset ('/test-ec-05/html/user_data/assets/img/common/cloud_gl1.webp')}}" alt="雲">
<img class="cloud1" src="{{asset ('/test-ec-05/html/user_data/assets/img/common/cloud__gl2.webp')}}" alt="雲">
<img id="visible" class="absolute3" src="{{asset ('/test-ec-05/html/user_data/assets/img/common/chara2.webp')}}" alt="キャラクター">
<div class="section__title">
<img src="{{asset ('/test-ec-05/html/user_data/assets/img/common/cow.webp')}}" alt="牛のイラスト">
<h2>商品詳細</h2>
</div>
<div class="p-detail__merchandise__box">
<div class="p-detail__merchandise__box__left">
<img src="{{asset ('/test-ec-05/html/user_data/assets/img/common/EC6062.jpeg')}}" alt="お肉の写真">
</div>
<p class="p-detail__merchandise__box__right">
私たちが自信を持って厳選した銘柄牛を<br>
端材まで余すことなくふんだんに使用し、<br>
カルビ、ロース、モモなどの部位の他に<br>
ハンバーグなどの加工食品も合わせた詰<br>
め合わせとなっております。<br>
銘柄牛の美味しさがギュッと詰まった商<br>
品となっておりますので、ぜひこの機会<br>
にお求めください。</p>
</div>
</section>
{% endblock %}