{#
This file is part of EC-CUBE
Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
http://www.ec-cube.co.jp/
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% extends 'default_frame.twig' %}
{% set body_class = 'product_page' %}
{% block stylesheet %}
<style>
.slick-slider {
margin-bottom: 30px;
}
.slick-dots {
position: absolute;
bottom: -45px;
display: block;
width: 100%;
padding: 0;
list-style: none;
text-align: center;
}
.slick-dots li {
position: relative;
display: inline-block;
width: 20px;
height: 20px;
margin: 0 5px;
padding: 0;
cursor: pointer;
}
.slick-dots li button {
font-size: 0;
line-height: 0;
display: block;
width: 20px;
height: 20px;
padding: 5px;
cursor: pointer;
color: transparent;
border: 0;
outline: none;
background: transparent;
}
.slick-dots li button:hover,
.slick-dots li button:focus {
outline: none;
}
.slick-dots li button:hover:before,
.slick-dots li button:focus:before {
opacity: 1;
}
.slick-dots li button:before {
content: " ";
line-height: 20px;
position: absolute;
top: 0;
left: 0;
width: 12px;
height: 12px;
text-align: center;
opacity: .25;
background-color: black;
border-radius: 50%;
}
.slick-dots li.slick-active button:before {
opacity: .75;
background-color: black;
}
.slick-dots li button.thumbnail img {
width: 0;
height: 0;
}
</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
}
}]
});
$('.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>
{% endblock %}
{% block main %}
<!-- PAGE CONTENTS -->
<div class="products productsWakamefurikake productsSingle">
<section class="sub-container">
{# 広告流入かそれ以外かの条件分岐 #}
{% if Product.id is same as(59) %}
<div class="ad">
<section class="ad-kvArea">
<div class="ad-kvArea__inner">
<h1 class="dn">しそ入ひじきふりかけ</h1>
<img src="{{ asset('assets/img/product-ad/kv.png')}}" class="imgFit dn-sp__ad kv__ad">
<img src="{{ asset('assets/img/product-ad/kv-sp.png')}}" class="imgAd dn-pcTab__ad">
</div>
</section>
<section class="ad-timeArea">
<div class="ad-timeArea__inner">
<h2><span class="hl-red">うま味と甘味</span>の絶妙なバランスが<br><span class="hl-big">様々な場面で<br class="dn-pc__ad"><span class="hl-red">大活躍!</span></h2>
<div class="ad-timeArea__contents">
<section class="ad-timeArea__contents-time">
<div class="ad-timeArea__contents-time__left">
<h3>時短×簡単</h3>
<p>
おにぎりが簡単に絶品に!<br>
忙しい朝やお弁当作りにも時短で便利。<br>
<br>
パパッとひとふりで、お茶漬けが本格的な味に。<br>
しその風味豊かなひじきふりかけで
<span class="timeTxt">時短料理<span class="black">を</span>実現!</span>
</p>
</div>
<div class="ad-timeArea__contents-time__right">
<img src="{{ asset('assets/img/product-ad/furikake_img.png')}}" class="dn-mobile">
<img src="{{ asset('assets/img/product-ad/furikake_img-sp.png')}}" class="dn-pc__ad">
</div>
</section>
<section class="ad-timeArea__contents-arrangement">
<div class="ad-timeArea__contents-arrangement__heading">
<h3>アレンジは多種多様<span>いつもの料理が手軽に<br class="dn-pc__ad">美味しく健康的に!</span></h3>
</div>
<div class="ad-timeArea__contents-arrangement__items">
<div class="ad-timeArea__contents-arrangement__item">
<img src="{{ asset('assets/img/product-ad/cooki_img01.png')}}" class="imgFit">
<p>チャーハンに!</p>
</div>
<div class="ad-timeArea__contents-arrangement__item">
<img src="{{ asset('assets/img/product-ad/cooki_img02.png')}}" class="imgFit">
<p>浅漬けに!</p>
</div>
<div class="ad-timeArea__contents-arrangement__item">
<img src="{{ asset('assets/img/product-ad/cooki_img03.png')}}" class="imgFit">
<p>トーストにも!</p>
</div>
</div>
</section>
</div>
</div>
</section>
<section class="ad-healthyArea">
<div class="ad-healthyArea__inner">
<h2><span>食物繊維</span>と<br class="dn-pcTab__ad"><span>ミネラル</span>たっぷり!</h2>
<div class="ad-healthyArea__inner__inner">
<div class="ad-healthyArea__txt">
<p class="top-txt">
海藻類の中でも特に<br>
<span>栄養価の高い</span>ひじき。
</p>
<p class="bottom-txt">
カルシウム、食物繊維、マグネシウムが<br>
豊富に含まれます。<br>
その他にも、ビタミンBや鉄分なども含ま<br>
れ、しかも低カロリー。
</p>
</div>
<div class="ad-healthyArea__img dn-pc__ad">
<img src="{{ asset('assets/img/product-ad/healthy-sp.png')}}" class="imgFit">
</div>
</div>
</div>
</section>
<section class="ad-voiceArea">
<div class="ad-voiceArea__inner">
<div class="ad-voiceArea__content">
<div class="ad-voiceArea__heading">
<h2><span>いつも沢山のお声<br class="dn-pc__ad">ありがとうございます!</span><br class="dn-mobile">ご利用いただいた<br class="dn-pc">お客様からのお声</h2>
</div>
<div class="ad-voiceArea__items">
<div class="ad-voiceArea__item">
<div class="ad-voiceArea__item-left">VOICE<br>01</div>
<div class="ad-voiceArea__item-right">
<p><span>とても美味しい</span>ひじきふりかけです。<br>
しっとりしていて食べやすく、<span>ホカホカご飯にもお弁当にも最適</span>です。</p>
</div>
</div>
<div class="ad-voiceArea__item">
<div class="ad-voiceArea__item-left">VOICE<br>02</div>
<div class="ad-voiceArea__item-right">
<p>しっとりとしたヒジキがほんのりしそ風味で<span>すごく好きな味です。</span><br>
<span>もう一袋買えば良かった、</span>と後悔してます。</p>
</div>
</div>
<div class="ad-voiceArea__item">
<div class="ad-voiceArea__item-left">VOICE<br>03</div>
<div class="ad-voiceArea__item-right">
<p>毎朝食べてます。美味しいし、<span>手軽にひじきが食べれてとても満足</span>です。<br>
いつも塩分無視してたっぷりかけてるので、<span>無くなったらリピ</span>します。</p>
</div>
</div>
<div class="ad-voiceArea__item">
<div class="ad-voiceArea__item-left">VOICE<br>04</div>
<div class="ad-voiceArea__item-right">
<p>おにぎりに使うのがお気に入りで<span>幼稚園児のお弁当や食事に栄養をプラス</span><br class="dn-mobile">
するのに活用させてもらってます!</p>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="ad-aboutArea">
<div class="ad-aboutArea__inner">
<h2>30年以上の<br class="dn-pcTab__ad"><span>「おいしさの追求」</span>で<br>多くのファンに<br class="dn-pcTab__ad">ご支持いただく</h2>
<div class="ad-aboutArea__content">
<div class="ad-aboutArea__content-kv">
<img src="{{ asset('assets/img/product-ad/history1.png')}}" class="imgFit">
</div>
<div class="ad-aboutArea__content-items">
<div class="ad-aboutArea__content-items__left">
<h3>大正10年(1921年)創業<br>100年の歴史と革新</h3>
<p>
1921年に山陰特産品の板わかめ問屋として創業。<br>
<br>
「ひじきふりかけ」の先駆者<br>
30年以上の「おいしさの追求」で、<br>
多くのファンに支持されてきました。<br>
<br>
忙しくても、自分や大切な人の健康を支えたい<br class="dn-mobile">
あなたへ。<br>
栄養豊富な海の幸を、食卓と健康を大切にする<br class="dn-mobile">
すべての方のためにお届けします。<br>
</p>
</div>
<div class="ad-aboutArea__content-items__right">
<div class="ad-aboutArea__content-items__right-top">
<img src="{{ asset('assets/img/product-ad/history2.png')}}" class="imgFit">
</div>
<div class="ad-aboutArea__content-items__right-bottom">
<img src="{{ asset('assets/img/product-ad/history3.png')}}" class="imgFit">
</div>
</div>
</div>
</div>
</div>
</section>
<div class="ad-cart">
<a href="#cart__area">
<div>
<div>
<img src="{{ asset('assets/img/product-ad/icon-cart.png')}}" class="imgFit dn-sp__ad">
<img src="{{ asset('assets/img/product-ad/icon-cart-sp.png')}}" class="imgFit dn-pcTab__ad">
</div>
<p>
商品をカートに<br class="dn-sp__ad">追加する
</p>
</div>
</a>
</div>
</div>
{% else %}
<!-- H1 商品カテゴリーの見出し -->
<div class="sub-h1--products">
<h1 class="itemTitle">
{{ Product.name }}
</h1>
<div class="itemImg">
<div class="itemImgInner">
<img src="{{ asset('assets/img/products/wf_h1_01.jpg') }}" alt="" class="imgObjectFitCover">
</div>
</div>
</div>
<!-- /H1 -->
{% endif %}
<!-- CONTENTS -->
<div class="l-container l-2ColumnContainer">
<!-- MAIN-CONTENTS -->
<div class="l-main">
<!-- BREAD CRUMBS -->
<div class="sub-breadcrumbsWrap">
<ul class="sub-breadcrumbs">
<li><a href="/">TOP</a></li>
<li><a href="/products/list">商品一覧</a></li>
<li>{{ Product.name }}</li>
</ul>
</div>
<!-- /BREAD CRUMBS -->
<!-- MAIN CONTENTS -->
<section class="products-sgContent">
<!-- PRODUCTS PHOTO -->
<div class="products-sgContent__pPhoto">
<div class="productsPhotoSlide">
<ul id="categorySingleSlider" class="main clearfix">
{% for ProductImage in Product.ProductImage %}
<li><span class="imgWrap">
<img src="{{ asset(ProductImage, 'save_image') }}" alt="{{ loop.first ? Product.name : '' }}" alt=""
class="imgObjectFitCover" {% if loop.index > 1 %} loading="lazy"{% endif %}>
</span>
</li>
{% else %}
<li>
<span class="imgWrap">
<img src="{{ asset(''|no_image_product, 'save_image') }}" alt="{{ loop.first ? Product.name : '' }}"
class="imgObjectFitCover">
</span>
</li>
{% endfor %}
</ul>
<ul id="categorySingleSliderNav" class="sub clearfix">
{% for ProductImage in Product.ProductImage %}
<li data-index="{{ loop.index0 }}">
<span class="imgWrap">
<img src="{{ asset(ProductImage, 'save_image') }}" alt=""
class="imgObjectFitCover" loading="lazy">
</span>
</li>
{% endfor %}
</ul>
</div>
</div>
<!-- /PRODUCTS PHOTO -->
<!-- PRODUCTS DATA -->
<div class="products-sgContent__pData" id="cart__area">
<div class="titleWrap">
<h2 class="itemPName">{{ Product.name }}</h2>
{% if Product.hasProductClass -%}
{% if Product.getPrice02IncTaxMin == Product.getPrice02IncTaxMax %}
<p class="itemPrice">
{{ Product.getPrice02IncTaxMin|price }}
<span class="tax">{{ '(税込)'|trans }}</span>
</p>
{% else %}
<p class="itemPrice">
{{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}
<span class="tax">{{ '(税込)'|trans }}</span>
</p>
{% endif %}
{% else %}
<p class="itemPrice">
{{ Product.getPrice02IncTaxMin|price }}
<span class="tax">{{ '(税込)'|trans }}</span>
</p>
{% endif %}
</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="quantityWrap">
<span>数量</span>
<div class="quantityWrapInner">
<div class="item-select">
{{ form_widget(form.quantity) }}
{{ form_errors(form.quantity) }}
</div>
<div class="product-single-quantityBtnBlock">
<div class="quantityBtn quantityBtn__plus"><span class="btnInner">+</span></div>
<div class="quantityBtn quantityBtn__minus"><span class="btnInner">-</span></div>
</div>
</div>
</div>
</div>
<div class="cartBtnWrap">
<button type="submit" class="ec-blockBtn--action add-cart mod-btn-02 cartBtn">
{{ 'カートに入れる'|trans }}
</button>
</div>
{% else %}
<div class="ec-productRole__btn">
<button type="button" class="ec-blockBtn--action" disabled="disabled">
{{ 'ただいま品切れ中です。'|trans }}
</button>
</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>
{{ form_rest(form) }}
</form>
{% if BaseInfo.option_favorite_product %}
<form action="{{ url('product_add_favorite', {id:Product.id}) }}" method="post">
<div class="favoriteBtnWrap">
{% if is_favorite == false %}
<button type="submit" id="favorite" class="ec-blockBtn--cancel mod-btn-02 favoriteBtn">お気に入りに追加</button>
{% else %}
<button type="submit" id="favorite" class="ec-blockBtn--cancel mod-btn-02 favoriteBtn"
disabled="disabled">{{ 'お気に入りに追加済です。'|trans }}
</button>
{% endif %}
</div>
</form>
{% endif %}
<div class="itemInfoWrap">
<p>
{{ Product.description_detail|raw|nl2br }}
</p>
</div>
{% if Product.freearea %}
<div class="ec-productRole__description">
{{ include(template_from_string(Product.freearea), sandboxed = true) }}
</div>
{% endif %}
</div>
<!-- /PRODUCTS DATA -->
</section>
<!-- /MAIN CONTENTS -->
<div class="marginTop30">
{% if plugin_snippets is defined %}
{{ include('snippet.twig', { snippets: plugin_snippets }) }}
{% endif %}
</div>
{% if Layout.MainBottom %}
{{ include('block.twig', {'Blocks': Layout.MainBottom}) }}
{% endif %}
{% if Layout.ContentsBottom %}
<div class="ec-layoutRole__contentBottom">
{{ include('block.twig', {'Blocks': Layout.ContentsBottom}) }}
</div>
{% endif %}
</div>
<!-- /MAIN-CONTENTS -->
<!-- SIDE-CONTENTS -->
{{ include('Block/side_menu.twig') }}
<!-- /SIDE-CONTENTS -->
</div>
<!-- /CONTENTS -->
</section>
</div>
<!-- /PAGE CONTENTS -->
{% endblock %}