<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* __string_template__b7ddbfaf71442d4f6cb8c76f5e8ab670 */
class __TwigTemplate_22f5d2f385dc46ea14236878885149b3 extends \Eccube\Twig\Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'stylesheet' => [$this, 'block_stylesheet'],
'javascript' => [$this, 'block_javascript'],
'main' => [$this, 'block_main'],
];
$this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension');
$this->checkSecurity();
}
protected function doGetParent(array $context)
{
// line 11
return "default_frame.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "__string_template__b7ddbfaf71442d4f6cb8c76f5e8ab670"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "__string_template__b7ddbfaf71442d4f6cb8c76f5e8ab670"));
// line 13
$context["body_class"] = "product_page product_detail";
// line 11
$this->parent = $this->loadTemplate("default_frame.twig", "__string_template__b7ddbfaf71442d4f6cb8c76f5e8ab670", 11);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 15
public function block_stylesheet($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheet"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheet"));
// line 16
echo " <style>
</style>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 20
public function block_javascript($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascript"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascript"));
echo "<script>
\$(function () {
var noChange = true;
\$('.item_visual').on('afterChange', function (event, slick, currentSlide) {
if (noChange) {
var \$img = \$(\"div[data-index='\" + currentSlide + \"']\").find('img');
if (\$('#classcategory_id1').length > 0) {
\$('#classcategory_id1').val(\"__unselected\");
\$('#classcategory_id1').change();
}
if (\$img.length > 0) {
var class1 = \$img.data('class_category1');
if (class1) {
\$('#classcategory_id1').val(class1);
\$('#classcategory_id1').change();
}
var class2 = \$img.data('class_category2');
if (class2) {
setTimeout(function () {
\$('#classcategory_id2').val(class2);
\$('#classcategory_id2').change();
}, 100);
}
}
} else {
noChange = true;
}
});
if (\$('#classcategory_id1').length > 0 && \$('#classcategory_id2').length > 0) {
\$('#classcategory_id2').change(function () {
var \$this = \$(this);
if (\$this.val()) {
var class1 = \$('#classcategory_id1').val();
if (\$('#apg_product_class_image_thumb-' + class1 + '-' + \$this.val()).length > 0) {
var class2 = \$this.val();
\$index = \$('#apg_product_class_image_thumb-' + class1 + '-' + class2).parents('div').data('index');
\$('.item_visual').slick('slickGoTo', \$index);
noChange = false;
}
}
});
";
// line 61
if ((twig_get_attribute($this->env, $this->source, (isset($context["apgProductClassConfig"]) || array_key_exists("apgProductClassConfig", $context) ? $context["apgProductClassConfig"] : (function () { throw new RuntimeError('Variable "apgProductClassConfig" does not exist.', 61, $this->source); })()), "getImageType", [], "method", false, false, true, 61) == twig_constant("Plugin\\ApgProductClassImage42\\Domain\\ClassImageType::CLASS_IMAGE1_ONLY"))) {
// line 62
echo " \$('#classcategory_id1').change(function () {
var \$this = \$(this);
if (\$this.val() != \"__unselected\") {
var class1 = \$this.val();
if (\$(\"img[data-class_category1='\" + class1 + \"']\").length > 0) {
var class2 = \$(\"img[data-class_category1='\" + class1 + \"']\").data('class_category2');
\$index = \$('#apg_product_class_image_thumb-' + class1 + '-' + class2).parents('div').data('index');
\$('.item_visual').slick('slickGoTo', \$index);
noChange = false;
}
}
});
";
}
// line 75
echo " } else if (\$('#classcategory_id1').length > 0) {
\$('#classcategory_id1').change(function () {
var \$this = \$(this);
if (\$this.val() != \"__unselected\") {
if (\$('#apg_product_class_image_thumb-' + \$this.val() + '-').length > 0) {
\$index = \$('#apg_product_class_image_thumb-' + \$this.val() + '-').parents('div').data('index');
\$('.item_visual').slick('slickGoTo', \$index);
noChange = false;
}
}
});
}
});
</script>
<script>
eccube.classCategories = ";
// line 91
echo $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getClassCategoriesAsJson($this->sandbox->ensureToStringAllowed((isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 91, $this->source); })()), 91, $this->source));
echo ";
// 規格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);
}
";
// line 102
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id2", [], "any", true, true, true, 102)) {
// line 103
echo " fnSetClassCategories(
\$('#form1'), ";
// line 104
echo json_encode($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 104, $this->source); })()), "classcategory_id2", [], "any", false, false, true, 104), "vars", [], "any", false, false, true, 104), "value", [], "any", false, false, true, 104), 104, $this->source));
echo "
);
";
} elseif (twig_get_attribute($this->env, $this->source, // line 106
($context["form"] ?? null), "classcategory_id1", [], "any", true, true, true, 106)) {
// line 107
echo " eccube.checkStock(\$('#form1'), ";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 107, $this->source); })()), "id", [], "any", false, false, true, 107), 107, $this->source), "html", null, true);
echo ", ";
echo json_encode($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 107, $this->source); })()), "classcategory_id1", [], "any", false, false, true, 107), "vars", [], "any", false, false, true, 107), "value", [], "any", false, false, true, 107), 107, $this->source));
echo ", null);
";
}
// line 109
echo " </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,
slidesToShow: 1,
responsive: [{
breakpoint: 768,
settings: {
dots: true
}
}]
});
\$('.slideThumb').on('click', function() {
var index = \$(this).attr('data-index');
\$('.item_visual').slick('slickGoTo', index, false);
});
\$('.item_visual').slick('setPosition');
});
</script>
<script>
\$(function() {
\$('.add-cart').on('click', function(event) {
";
// line 176
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id1", [], "any", true, true, true, 176)) {
// line 177
echo " // 規格1フォームの必須チェック
if (\$('#classcategory_id1').val() == '__unselected' || \$('#classcategory_id1').val() == '') {
\$('#classcategory_id1')[0].setCustomValidity('";
// line 179
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("項目が選択されていません"), "html", null, true);
echo "');
return true;
} else {
\$('#classcategory_id1')[0].setCustomValidity('');
}
";
}
// line 185
echo "
";
// line 186
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id2", [], "any", true, true, true, 186)) {
// line 187
echo " // 規格2フォームの必須チェック
if (\$('#classcategory_id2').val() == '__unselected' || \$('#classcategory_id2').val() == '') {
\$('#classcategory_id2')[0].setCustomValidity('";
// line 189
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("項目が選択されていません"), "html", null, true);
echo "');
return true;
} else {
\$('#classcategory_id2')[0].setCustomValidity('');
}
";
}
// line 195
echo "
// 個数フォームのチェック
if (\$('#quantity').val() < 1) {
\$('#quantity')[0].setCustomValidity('";
// line 198
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("1以上で入力してください。"), "html", null, true);
echo "');
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').html(this);
});
\$('.ec-modal').show()
// カートブロックを更新する
\$.ajax({
url: \"";
// line 225
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("block_cart");
echo "\",
type: 'GET',
dataType: 'html'
}).done(function(html) {
\$('.ec-headerRole__cart').html(html);
});
}).fail(function(data) {
alert('";
// line 232
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートへの追加に失敗しました。"), "html", null, true);
echo "');
}).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()
});
// 数量 −+ ボタン(押したボタンと同じ行の input を参照)
\$(document).on('click', '.ec-numberInput__btn--up', function() {
var \$input = \$(this).closest('.ec-numberInput__row').find('input[type=\"number\"]');
if (\$input.length) {
var v = (parseInt(\$input.val(), 10) || 0) + 1;
\$input.val(v);
}
});
\$(document).on('click', '.ec-numberInput__btn--down', function() {
var \$input = \$(this).closest('.ec-numberInput__row').find('input[type=\"number\"]');
if (\$input.length) {
var v = Math.max(1, (parseInt(\$input.val(), 10) || 1) - 1);
\$input.val(v);
}
});
</script>
<script type=\"application/ld+json\">
{
\"@context\": \"https://schema.org/\",
\"@type\": \"Product\",
\"name\": \"";
// line 268
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 268, $this->source); })()), "name", [], "any", false, false, true, 268), 268, $this->source), "html", null, true);
echo "\",
\"image\": [
";
// line 270
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 270, $this->source); })()), "ProductImage", [], "any", false, false, true, 270));
$context['_iterated'] = false;
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["img"]) {
// line 271
echo " \"";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 271, $this->source); })()), "request", [], "any", false, false, true, 271), "schemeAndHttpHost", [], "any", false, false, true, 271), 271, $this->source), "html", null, true);
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->sandbox->ensureToStringAllowed($context["img"], 271, $this->source), "save_image"), "html", null, true);
echo "\"";
if ( !twig_get_attribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, true, 271)) {
echo ",";
}
// line 272
echo "
";
$context['_iterated'] = true;
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
if (!$context['_iterated']) {
// line 274
echo " \"";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 274, $this->source); })()), "request", [], "any", false, false, true, 274), "schemeAndHttpHost", [], "any", false, false, true, 274), 274, $this->source), "html", null, true);
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct(""), "save_image"), "html", null, true);
echo "\"
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['img'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 276
echo " ],
\"description\": \"";
// line 277
echo twig_escape_filter($this->env, twig_slice($this->env, twig_replace_filter(((twig_get_attribute($this->env, $this->source, ($context["Product"] ?? null), "description_list", [], "any", true, true, true, 277)) ? (_twig_default_filter($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, ($context["Product"] ?? null), "description_list", [], "any", false, false, true, 277), 277, $this->source), $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 277, $this->source); })()), "description_detail", [], "any", false, false, true, 277), 277, $this->source))) : (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 277, $this->source); })()), "description_detail", [], "any", false, false, true, 277))), ["
" => "", "
" => ""]), 0, 300), "html", null, true);
echo "\",
";
// line 278
if (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 278, $this->source); })()), "code_min", [], "any", false, false, true, 278)) {
// line 279
echo " \"sku\": \"";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 279, $this->source); })()), "code_min", [], "any", false, false, true, 279), 279, $this->source), "html", null, true);
echo "\",
";
}
// line 281
echo " \"offers\": {
\"@type\": \"Offer\",
\"url\": \"";
// line 283
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_detail", ["id" => twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 283, $this->source); })()), "id", [], "any", false, false, true, 283)]), "html", null, true);
echo "\",
\"priceCurrency\": \"";
// line 284
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["eccube_config"]) || array_key_exists("eccube_config", $context) ? $context["eccube_config"] : (function () { throw new RuntimeError('Variable "eccube_config" does not exist.', 284, $this->source); })()), "currency", [], "any", false, false, true, 284), 284, $this->source), "html", null, true);
echo "\",
\"price\": ";
// line 285
((twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 285, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, true, 285)) ? (print (twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 285, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, true, 285), "html", null, true))) : (print (0)));
echo ",
\"availability\": \"";
// line 286
echo ((twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 286, $this->source); })()), "stock_find", [], "any", false, false, true, 286)) ? ("InStock") : ("OutOfStock"));
echo "\"
}
}
</script>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 292
public function block_main($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "main"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "main"));
// line 293
echo " <div class=\"ec-productRole\">
<div class=\"ec-grid2\">
<div class=\"ec-grid2__cell ec-slider\">
<div class=\"ec-sliderItemRole\">
<div class=\"item_visual\">
";
// line 298
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 298, $this->source); })()), "ProductImage", [], "any", false, false, true, 298));
$context['_iterated'] = false;
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["ProductImage"]) {
// line 299
echo " <div class=\"slide-item\"><img src=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->sandbox->ensureToStringAllowed($context["ProductImage"], 299, $this->source), "save_image"), "html", null, true);
echo "\" alt=\"";
((twig_get_attribute($this->env, $this->source, $context["loop"], "first", [], "any", false, false, true, 299)) ? (print (twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 299, $this->source); })()), "name", [], "any", false, false, true, 299), "html", null, true))) : (print ("")));
echo "\"></div>
";
$context['_iterated'] = true;
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
if (!$context['_iterated']) {
// line 301
echo " <div class=\"slide-item\"><img src=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct(""), "save_image"), "html", null, true);
echo "\" alt=\"";
((twig_get_attribute($this->env, $this->source, $context["loop"], "first", [], "any", false, false, true, 301)) ? (print (twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 301, $this->source); })()), "name", [], "any", false, false, true, 301), "html", null, true))) : (print ("")));
echo "\" /></div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ProductImage'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 302
if (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 302, $this->source); })()), "hasProductClass", [], "any", false, false, true, 302)) {
// line 303
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 303, $this->source); })()), "getProductClasses", [], "method", false, false, true, 303));
foreach ($context['_seq'] as $context["_key"] => $context["ProductClass"]) {
// line 304
echo " ";
if (twig_get_attribute($this->env, $this->source, $context["ProductClass"], "file_name", [], "any", false, false, true, 304)) {
// line 305
echo " <div class=\"slide-item\">
";
// line 306
if ((twig_get_attribute($this->env, $this->source, $context["ProductClass"], "ClassCategory1", [], "any", false, false, true, 306) && twig_get_attribute($this->env, $this->source, $context["ProductClass"], "ClassCategory2", [], "any", false, false, true, 306))) {
// line 307
echo " <img id=\"apg_product_class_image-";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["ProductClass"], "ClassCategory1", [], "any", false, false, true, 307), "id", [], "any", false, false, true, 307), 307, $this->source), "html", null, true);
echo "-";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["ProductClass"], "ClassCategory2", [], "any", false, false, true, 307), "id", [], "any", false, false, true, 307), 307, $this->source), "html", null, true);
echo "\"
src=\"";
// line 308
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["ProductClass"], "getImageUrl", [], "method", false, false, true, 308), 308, $this->source), "save_image"), "html", null, true);
echo "\">
";
} elseif (twig_get_attribute($this->env, $this->source, // line 309
$context["ProductClass"], "ClassCategory1", [], "any", false, false, true, 309)) {
// line 310
echo " <img id=\"apg_product_class_image-";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["ProductClass"], "ClassCategory1", [], "any", false, false, true, 310), "id", [], "any", false, false, true, 310), 310, $this->source), "html", null, true);
echo "-\"
src=\"";
// line 311
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["ProductClass"], "getImageUrl", [], "method", false, false, true, 311), 311, $this->source), "save_image"), "html", null, true);
echo "\">
";
}
// line 313
echo " </div>
";
}
// line 315
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ProductClass'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
}
// line 317
echo "
</div>
<div class=\"item_nav\">
";
// line 320
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 320, $this->source); })()), "ProductImage", [], "any", false, false, true, 320));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["ProductImage"]) {
// line 321
echo " <div class=\"slideThumb\" data-index=\"";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["loop"], "index0", [], "any", false, false, true, 321), 321, $this->source), "html", null, true);
echo "\"><img src=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->sandbox->ensureToStringAllowed($context["ProductImage"], 321, $this->source), "save_image"), "html", null, true);
echo "\" alt=\"\"></div>
";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ProductImage'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 322
if (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 322, $this->source); })()), "hasProductClass", [], "any", false, false, true, 322)) {
// line 323
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 323, $this->source); })()), "ProductImage", [], "any", false, false, true, 323), "count", [], "any", false, false, true, 323) > 0)) {
// line 324
echo " ";
$context["imageCount"] = (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 324, $this->source); })()), "ProductImage", [], "any", false, false, true, 324), "count", [], "any", false, false, true, 324) - 1);
// line 325
echo " ";
} else {
// line 326
echo " ";
$context["imageCount"] = 0;
// line 327
echo " ";
}
// line 328
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 328, $this->source); })()), "getProductClasses", [], "method", false, false, true, 328));
foreach ($context['_seq'] as $context["_key"] => $context["ProductClass"]) {
// line 329
echo " ";
if (twig_get_attribute($this->env, $this->source, $context["ProductClass"], "file_name", [], "any", false, false, true, 329)) {
// line 330
echo " ";
$context["imageCount"] = ((isset($context["imageCount"]) || array_key_exists("imageCount", $context) ? $context["imageCount"] : (function () { throw new RuntimeError('Variable "imageCount" does not exist.', 330, $this->source); })()) + 1);
// line 331
echo " <div class=\"slideThumb\" data-index=\"";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["imageCount"]) || array_key_exists("imageCount", $context) ? $context["imageCount"] : (function () { throw new RuntimeError('Variable "imageCount" does not exist.', 331, $this->source); })()), 331, $this->source), "html", null, true);
echo "\">
";
// line 332
if ((twig_get_attribute($this->env, $this->source, $context["ProductClass"], "ClassCategory1", [], "any", false, false, true, 332) && twig_get_attribute($this->env, $this->source, $context["ProductClass"], "ClassCategory2", [], "any", false, false, true, 332))) {
// line 333
echo " <img id=\"apg_product_class_image_thumb-";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["ProductClass"], "ClassCategory1", [], "any", false, false, true, 333), "id", [], "any", false, false, true, 333), 333, $this->source), "html", null, true);
echo "-";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["ProductClass"], "ClassCategory2", [], "any", false, false, true, 333), "id", [], "any", false, false, true, 333), 333, $this->source), "html", null, true);
echo "\"
src=\"";
// line 334
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["ProductClass"], "getImageUrl", [], "method", false, false, true, 334), 334, $this->source), "save_image"), "html", null, true);
echo "\"
data-class_category1=\"";
// line 335
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["ProductClass"], "ClassCategory1", [], "any", false, false, true, 335), "id", [], "any", false, false, true, 335), 335, $this->source), "html", null, true);
echo "\"
data-class_category2=\"";
// line 336
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["ProductClass"], "ClassCategory2", [], "any", false, false, true, 336), "id", [], "any", false, false, true, 336), 336, $this->source), "html", null, true);
echo "\">
";
} elseif (twig_get_attribute($this->env, $this->source, // line 337
$context["ProductClass"], "ClassCategory1", [], "any", false, false, true, 337)) {
// line 338
echo " <img id=\"apg_product_class_image_thumb-";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["ProductClass"], "ClassCategory1", [], "any", false, false, true, 338), "id", [], "any", false, false, true, 338), 338, $this->source), "html", null, true);
echo "-\"
src=\"";
// line 339
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["ProductClass"], "getImageUrl", [], "method", false, false, true, 339), 339, $this->source), "save_image"), "html", null, true);
echo "\"
data-class_category1=\"";
// line 340
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["ProductClass"], "ClassCategory1", [], "any", false, false, true, 340), "id", [], "any", false, false, true, 340), 340, $this->source), "html", null, true);
echo "\">
";
}
// line 342
echo " </div>
";
}
// line 344
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ProductClass'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
}
// line 346
echo "
</div>
";
// line 348
if (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 348, $this->source); })()), "freearea", [], "any", false, false, true, 348)) {
// line 349
echo " <div class=\"ec-productRole__description ec-productRole__freearea\">
";
// line 350
echo $this->extensions['Eccube\Twig\Extension\IgnoreTwigSandboxErrorExtension']->twig_include($this->env, $context, twig_template_from_string($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 350, $this->source); })()), "freearea", [], "any", false, false, true, 350), 350, $this->source)));
echo "
</div>
";
}
// line 353
echo " </div>
</div>
<div class=\"ec-grid2__cell ec-description\">
<div class=\"ec-productRole__profile\">
";
// line 358
echo " ";
if ((twig_get_attribute($this->env, $this->source, ($context["Product"] ?? null), "ViewData", [0 => 13], "method", true, true, true, 358) && twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 358, $this->source); })()), "ViewData", [0 => 13], "method", false, false, true, 358))) {
// line 359
echo " <p class=\"ec-productRole__titleEn\">";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 359, $this->source); })()), "ViewData", [0 => 13], "method", false, false, true, 359), 359, $this->source), "html", null, true);
echo "</p>
";
}
// line 361
echo " <div class=\"ec-productRole__title\">
<h2 class=\"ec-headingTitle\">";
// line 362
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 362, $this->source); })()), "name", [], "any", false, false, true, 362), 362, $this->source), "html", null, true);
echo "</h2>
</div>
";
// line 365
echo " ";
if (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 365, $this->source); })()), "hasProductClass", [], "any", false, false, true, 365)) {
// line 366
echo "<div class=\"ec-productRole__priceRegular\">
";
// line 367
if (( !(null === twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 367, $this->source); })()), "getPrice01Min", [], "any", false, false, true, 367)) && (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 367, $this->source); })()), "getPrice01IncTaxMin", [], "any", false, false, true, 367) == twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 367, $this->source); })()), "getPrice01IncTaxMax", [], "any", false, false, true, 367)))) {
// line 368
echo " <span class=\"ec-productRole__priceRegularPrice\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("通常価格"), "html", null, true);
echo ":<span class=\"price01-default\">";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 368, $this->source); })()), "getPrice01IncTaxMin", [], "any", false, false, true, 368), 368, $this->source)), "html", null, true);
echo "</span></span>
<span class=\"ec-productRole__priceRegularTax\">";
// line 369
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("税込"), "html", null, true);
echo "</span>
";
} elseif (( !(null === twig_get_attribute($this->env, $this->source, // line 370
(isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 370, $this->source); })()), "getPrice01Min", [], "any", false, false, true, 370)) && !(null === twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 370, $this->source); })()), "getPrice01Max", [], "any", false, false, true, 370)))) {
// line 371
echo " <span class=\"ec-productRole__priceRegularPrice\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("通常価格"), "html", null, true);
echo ":<span class=\"price01-default\">";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 371, $this->source); })()), "getPrice01IncTaxMin", [], "any", false, false, true, 371), 371, $this->source)), "html", null, true);
echo " ~ ";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 371, $this->source); })()), "getPrice01IncTaxMax", [], "any", false, false, true, 371), 371, $this->source)), "html", null, true);
echo "</span></span>
<span class=\"ec-productRole__priceRegularTax\">";
// line 372
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("税込"), "html", null, true);
echo "</span>
";
}
// line 374
echo " </div>
";
} else {
// line 376
echo " ";
if ( !(null === twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 376, $this->source); })()), "getPrice01Max", [], "any", false, false, true, 376))) {
// line 377
echo " <div class=\"ec-productRole__priceRegular--div\">
<span class=\"ec-productRole__priceRegularPrice\">";
// line 378
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("通常価格"), "html", null, true);
echo ":";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 378, $this->source); })()), "getPrice01IncTaxMin", [], "any", false, false, true, 378), 378, $this->source)), "html", null, true);
echo "</span>
<span class=\"ec-productRole__priceRegularTax\">";
// line 379
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("税込"), "html", null, true);
echo "</span>
</div>
";
}
// line 382
echo " ";
}
// line 383
echo " ";
// line 384
echo " <div class=\"ec-productRole__price\">
";
// line 385
if (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 385, $this->source); })()), "hasProductClass", [], "any", false, false, true, 385)) {
// line 386
if ((twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 386, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, true, 386) == twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 386, $this->source); })()), "getPrice02IncTaxMax", [], "any", false, false, true, 386))) {
// line 387
echo " <div class=\"ec-price\">
<span class=\"ec-price__price price02-default\">";
// line 388
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 388, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, true, 388), 388, $this->source)), "html", null, true);
echo "</span>
<span class=\"ec-price__tax\">";
// line 389
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("税込"), "html", null, true);
echo "</span>
</div>
";
} else {
// line 392
echo " <div class=\"ec-price\">
<span class=\"ec-price__price price02-default\">";
// line 393
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 393, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, true, 393), 393, $this->source)), "html", null, true);
echo " ~ ";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 393, $this->source); })()), "getPrice02IncTaxMax", [], "any", false, false, true, 393), 393, $this->source)), "html", null, true);
echo "</span>
<span class=\"ec-price__tax\">";
// line 394
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("税込"), "html", null, true);
echo "</span>
</div>
";
}
// line 397
echo " ";
} else {
// line 398
echo " <div class=\"ec-price\">
<span class=\"ec-price__price\">";
// line 399
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 399, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, true, 399), 399, $this->source)), "html", null, true);
echo "</span>
<span class=\"ec-price__tax\">";
// line 400
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("税込"), "html", null, true);
echo "</span>
</div>
";
}
// line 403
echo " </div>
";
// line 405
echo " ";
if ((twig_get_attribute($this->env, $this->source, ($context["Product"] ?? null), "ViewData", [0 => 11], "method", true, true, true, 405) && twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 405, $this->source); })()), "ViewData", [0 => 11], "method", false, false, true, 405))) {
// line 406
echo " <div class=\"ec-productRole__sku\">
SKU:<span class=\"product-code-default\">";
// line 407
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 407, $this->source); })()), "ViewData", [0 => 11], "method", false, false, true, 407), 407, $this->source), "html", null, true);
echo "</span>
</div>
";
}
// line 410
echo " ";
// line 411
echo " ";
if ((twig_get_attribute($this->env, $this->source, ($context["Product"] ?? null), "ViewData", [0 => 5], "method", true, true, true, 411) && twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 411, $this->source); })()), "ViewData", [0 => 5], "method", false, false, true, 411))) {
// line 412
echo " <div class=\"ec-productRole__shortMessage\">
<div class=\"ec-productRole__shortMessageBody\">";
// line 413
echo $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 413, $this->source); })()), "ViewData", [0 => 5], "method", false, false, true, 413), 413, $this->source);
echo "</div>
</div>
";
}
// line 416
echo "
<form action=\"";
// line 417
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_add_cart", ["id" => twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 417, $this->source); })()), "id", [], "any", false, false, true, 417)]), "html", null, true);
echo "\" method=\"post\" id=\"form1\" name=\"form1\">
";
// line 418
if (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 418, $this->source); })()), "stock_find", [], "any", false, false, true, 418)) {
// line 419
echo " <div class=\"ec-productRole__actions\">
";
// line 420
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id1", [], "any", true, true, true, 420)) {
// line 421
echo " <div class=\"ec-select\">
";
// line 422
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 422, $this->source); })()), "classcategory_id1", [], "any", false, false, true, 422), 422, $this->source), 'row');
echo "
";
// line 423
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 423, $this->source); })()), "classcategory_id1", [], "any", false, false, true, 423), 423, $this->source), 'errors');
echo "
</div>
";
// line 425
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id2", [], "any", true, true, true, 425)) {
// line 426
echo " <div class=\"ec-select\">
";
// line 427
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 427, $this->source); })()), "classcategory_id2", [], "any", false, false, true, 427), 427, $this->source), 'row');
echo "
";
// line 428
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 428, $this->source); })()), "classcategory_id2", [], "any", false, false, true, 428), 428, $this->source), 'errors');
echo "
</div>
";
}
// line 431
echo " ";
}
// line 432
echo " <div class=\"ec-numberInput ec-numberInput--withBtns\">
<span>";
// line 433
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("数量"), "html", null, true);
echo "</span>
<div class=\"ec-numberInput__row ec-numberInput__row--bordered\">
<button type=\"button\" class=\"ec-numberInput__btn ec-numberInput__btn--down\" aria-label=\"";
// line 435
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("数量を減らす"), "html", null, true);
echo "\">−</button>
";
// line 436
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 436, $this->source); })()), "quantity", [], "any", false, false, true, 436), 436, $this->source), 'widget');
echo "
<button type=\"button\" class=\"ec-numberInput__btn ec-numberInput__btn--up\" aria-label=\"";
// line 437
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("数量を増やす"), "html", null, true);
echo "\">+</button>
</div>
";
// line 439
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 439, $this->source); })()), "quantity", [], "any", false, false, true, 439), 439, $this->source), 'errors');
echo "
</div>
</div>
<div class=\"ec-productRole__btn\">
<button type=\"submit\" class=\"ec-blockBtn--action add-cart\">
";
// line 444
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートに入れる"), "html", null, true);
echo "
</button>
</div>
";
} else {
// line 448
echo " <div class=\"ec-productRole__btn\">
<button type=\"button\" class=\"ec-blockBtn--action\" disabled=\"disabled\">
";
// line 450
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ただいま品切れ中です。"), "html", null, true);
echo "
</button>
</div>
";
}
// line 454
echo "
";
// line 455
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock($this->sandbox->ensureToStringAllowed((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 455, $this->source); })()), 455, $this->source), 'rest');
echo "
</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=\"";
// line 460
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/icon/cross-dark.svg"), "html", null, true);
echo "\" alt=\"\"/></span></span>
<div id=\"ec-modal-header\" class=\"text-center\">";
// line 461
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートに追加しました。"), "html", null, true);
echo "</div>
<div class=\"ec-modal-box\">
<div class=\"ec-role\">
<span class=\"ec-inlineBtn--cancel\">";
// line 464
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("お買い物を続ける"), "html", null, true);
echo "</span>
<a href=\"";
// line 465
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("cart");
echo "\" class=\"ec-inlineBtn--action\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートへ進む"), "html", null, true);
echo "</a>
</div>
</div>
</div>
</div>
</div>
<div class=\"ec-productRole__secondaryBtns\">
";
// line 472
if (twig_get_attribute($this->env, $this->source, (isset($context["BaseInfo"]) || array_key_exists("BaseInfo", $context) ? $context["BaseInfo"] : (function () { throw new RuntimeError('Variable "BaseInfo" does not exist.', 472, $this->source); })()), "option_favorite_product", [], "any", false, false, true, 472)) {
// line 473
echo " <form action=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_add_favorite", ["id" => twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 473, $this->source); })()), "id", [], "any", false, false, true, 473)]), "html", null, true);
echo "\" method=\"post\" class=\"ec-productRole__secondaryBtnForm\">
";
// line 474
if (((isset($context["is_favorite"]) || array_key_exists("is_favorite", $context) ? $context["is_favorite"] : (function () { throw new RuntimeError('Variable "is_favorite" does not exist.', 474, $this->source); })()) == false)) {
// line 475
echo " <button type=\"submit\" id=\"favorite\" class=\"ec-productRole__secondaryBtn ec-productRole__secondaryBtn--favorite\">
<i class=\"far fa-heart\" aria-hidden=\"true\"></i>";
// line 476
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("お気に入りに追加"), "html", null, true);
echo "
</button>
";
} else {
// line 479
echo " <button type=\"submit\" id=\"favorite\" class=\"ec-productRole__secondaryBtn ec-productRole__secondaryBtn--favorite\" disabled=\"disabled\">
<i class=\"far fa-heart\" aria-hidden=\"true\"></i>";
// line 480
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("お気に入りに追加済です。"), "html", null, true);
echo "
</button>
";
}
// line 483
echo " </form>
";
}
// line 485
echo " <a href=\"";
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("contact");
echo "?product_id=";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 485, $this->source); })()), "id", [], "any", false, false, true, 485), 485, $this->source), "html", null, true);
echo "&product_name=";
echo twig_escape_filter($this->env, twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 485, $this->source); })()), "name", [], "any", false, false, true, 485), 485, $this->source), "url"), "html", null, true);
echo "\" class=\"ec-productRole__secondaryBtn ec-productRole__secondaryBtn--contact\">
<i class=\"fas fa-envelope\" aria-hidden=\"true\"></i>";
// line 486
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("商品へのお問合せ"), "html", null, true);
echo "
</a>
</div>
<div class=\"ec-productRole__description\">";
// line 490
echo twig_nl2br($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 490, $this->source); })()), "description_detail", [], "any", false, false, true, 490), 490, $this->source));
echo "
</div>
</div>
</div>
</div>
</div>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
public function getTemplateName()
{
return "__string_template__b7ddbfaf71442d4f6cb8c76f5e8ab670";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 1084 => 490, 1077 => 486, 1068 => 485, 1064 => 483, 1058 => 480, 1055 => 479, 1049 => 476, 1046 => 475, 1044 => 474, 1039 => 473, 1037 => 472, 1025 => 465, 1021 => 464, 1015 => 461, 1011 => 460, 1003 => 455, 1000 => 454, 993 => 450, 989 => 448, 982 => 444, 974 => 439, 969 => 437, 965 => 436, 961 => 435, 956 => 433, 953 => 432, 950 => 431, 944 => 428, 940 => 427, 937 => 426, 935 => 425, 930 => 423, 926 => 422, 923 => 421, 921 => 420, 918 => 419, 916 => 418, 912 => 417, 909 => 416, 903 => 413, 900 => 412, 897 => 411, 895 => 410, 889 => 407, 886 => 406, 883 => 405, 880 => 403, 874 => 400, 870 => 399, 867 => 398, 864 => 397, 858 => 394, 852 => 393, 849 => 392, 843 => 389, 839 => 388, 836 => 387, 834 => 386, 832 => 385, 829 => 384, 827 => 383, 824 => 382, 818 => 379, 812 => 378, 809 => 377, 806 => 376, 802 => 374, 797 => 372, 788 => 371, 786 => 370, 782 => 369, 775 => 368, 773 => 367, 770 => 366, 767 => 365, 762 => 362, 759 => 361, 753 => 359, 750 => 358, 744 => 353, 738 => 350, 735 => 349, 733 => 348, 729 => 346, 722 => 344, 718 => 342, 713 => 340, 709 => 339, 704 => 338, 702 => 337, 698 => 336, 694 => 335, 690 => 334, 683 => 333, 681 => 332, 676 => 331, 673 => 330, 670 => 329, 665 => 328, 662 => 327, 659 => 326, 656 => 325, 653 => 324, 651 => 323, 649 => 322, 630 => 321, 613 => 320, 608 => 317, 601 => 315, 597 => 313, 592 => 311, 587 => 310, 585 => 309, 581 => 308, 574 => 307, 572 => 306, 569 => 305, 566 => 304, 562 => 303, 560 => 302, 549 => 301, 531 => 299, 513 => 298, 506 => 293, 496 => 292, 481 => 286, 477 => 285, 473 => 284, 469 => 283, 465 => 281, 459 => 279, 457 => 278, 452 => 277, 449 => 276, 439 => 274, 425 => 272, 417 => 271, 399 => 270, 394 => 268, 355 => 232, 345 => 225, 315 => 198, 310 => 195, 301 => 189, 297 => 187, 295 => 186, 292 => 185, 283 => 179, 279 => 177, 277 => 176, 208 => 109, 200 => 107, 198 => 106, 193 => 104, 190 => 103, 188 => 102, 174 => 91, 156 => 75, 141 => 62, 139 => 61, 87 => 20, 75 => 16, 65 => 15, 54 => 11, 52 => 13, 39 => 11,);
}
public function getSourceContext()
{
return new Source("{#
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 product_detail' %}
{% block stylesheet %}
<style>
</style>
{% endblock %}
{% block javascript %}<script>
\$(function () {
var noChange = true;
\$('.item_visual').on('afterChange', function (event, slick, currentSlide) {
if (noChange) {
var \$img = \$(\"div[data-index='\" + currentSlide + \"']\").find('img');
if (\$('#classcategory_id1').length > 0) {
\$('#classcategory_id1').val(\"__unselected\");
\$('#classcategory_id1').change();
}
if (\$img.length > 0) {
var class1 = \$img.data('class_category1');
if (class1) {
\$('#classcategory_id1').val(class1);
\$('#classcategory_id1').change();
}
var class2 = \$img.data('class_category2');
if (class2) {
setTimeout(function () {
\$('#classcategory_id2').val(class2);
\$('#classcategory_id2').change();
}, 100);
}
}
} else {
noChange = true;
}
});
if (\$('#classcategory_id1').length > 0 && \$('#classcategory_id2').length > 0) {
\$('#classcategory_id2').change(function () {
var \$this = \$(this);
if (\$this.val()) {
var class1 = \$('#classcategory_id1').val();
if (\$('#apg_product_class_image_thumb-' + class1 + '-' + \$this.val()).length > 0) {
var class2 = \$this.val();
\$index = \$('#apg_product_class_image_thumb-' + class1 + '-' + class2).parents('div').data('index');
\$('.item_visual').slick('slickGoTo', \$index);
noChange = false;
}
}
});
{% if apgProductClassConfig.getImageType() == constant('Plugin\\\\\\ApgProductClassImage42\\\\\\Domain\\\\\\ClassImageType::CLASS_IMAGE1_ONLY') %}
\$('#classcategory_id1').change(function () {
var \$this = \$(this);
if (\$this.val() != \"__unselected\") {
var class1 = \$this.val();
if (\$(\"img[data-class_category1='\" + class1 + \"']\").length > 0) {
var class2 = \$(\"img[data-class_category1='\" + class1 + \"']\").data('class_category2');
\$index = \$('#apg_product_class_image_thumb-' + class1 + '-' + class2).parents('div').data('index');
\$('.item_visual').slick('slickGoTo', \$index);
noChange = false;
}
}
});
{% endif %}
} else if (\$('#classcategory_id1').length > 0) {
\$('#classcategory_id1').change(function () {
var \$this = \$(this);
if (\$this.val() != \"__unselected\") {
if (\$('#apg_product_class_image_thumb-' + \$this.val() + '-').length > 0) {
\$index = \$('#apg_product_class_image_thumb-' + \$this.val() + '-').parents('div').data('index');
\$('.item_visual').slick('slickGoTo', \$index);
noChange = false;
}
}
});
}
});
</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,
slidesToShow: 1,
responsive: [{
breakpoint: 768,
settings: {
dots: true
}
}]
});
\$('.slideThumb').on('click', function() {
var index = \$(this).attr('data-index');
\$('.item_visual').slick('slickGoTo', index, false);
});
\$('.item_visual').slick('setPosition');
});
</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').html(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()
});
// 数量 −+ ボタン(押したボタンと同じ行の input を参照)
\$(document).on('click', '.ec-numberInput__btn--up', function() {
var \$input = \$(this).closest('.ec-numberInput__row').find('input[type=\"number\"]');
if (\$input.length) {
var v = (parseInt(\$input.val(), 10) || 0) + 1;
\$input.val(v);
}
});
\$(document).on('click', '.ec-numberInput__btn--down', function() {
var \$input = \$(this).closest('.ec-numberInput__row').find('input[type=\"number\"]');
if (\$input.length) {
var v = Math.max(1, (parseInt(\$input.val(), 10) || 1) - 1);
\$input.val(v);
}
});
</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 %}
<div class=\"ec-productRole\">
<div class=\"ec-grid2\">
<div class=\"ec-grid2__cell ec-slider\">
<div class=\"ec-sliderItemRole\">
<div class=\"item_visual\">
{% for ProductImage in Product.ProductImage %}
<div class=\"slide-item\"><img src=\"{{ asset(ProductImage, 'save_image') }}\" alt=\"{{ loop.first ? Product.name : '' }}\"></div>
{% else %}
<div class=\"slide-item\"><img src=\"{{ asset(''|no_image_product, 'save_image') }}\" alt=\"{{ loop.first ? Product.name : '' }}\" /></div>
{% endfor %}{% if Product.hasProductClass -%}
{% for ProductClass in Product.getProductClasses() %}
{% if ProductClass.file_name %}
<div class=\"slide-item\">
{% if ProductClass.ClassCategory1 and ProductClass.ClassCategory2 %}
<img id=\"apg_product_class_image-{{ ProductClass.ClassCategory1.id }}-{{ ProductClass.ClassCategory2.id }}\"
src=\"{{ asset(ProductClass.getImageUrl(),'save_image') }}\">
{% elseif ProductClass.ClassCategory1 %}
<img id=\"apg_product_class_image-{{ ProductClass.ClassCategory1.id }}-\"
src=\"{{ asset(ProductClass.getImageUrl(),'save_image') }}\">
{% endif %}
</div>
{% endif %}
{% endfor %}
{% endif %}
</div>
<div class=\"item_nav\">
{% for ProductImage in Product.ProductImage %}
<div class=\"slideThumb\" data-index=\"{{ loop.index0 }}\"><img src=\"{{ asset(ProductImage, 'save_image') }}\" alt=\"\"></div>
{% endfor %}{% if Product.hasProductClass -%}
{% if Product.ProductImage.count > 0 %}
{% set imageCount = Product.ProductImage.count - 1 %}
{% else %}
{% set imageCount = 0 %}
{% endif %}
{% for ProductClass in Product.getProductClasses() %}
{% if ProductClass.file_name %}
{% set imageCount = imageCount + 1 %}
<div class=\"slideThumb\" data-index=\"{{ imageCount }}\">
{% if ProductClass.ClassCategory1 and ProductClass.ClassCategory2 %}
<img id=\"apg_product_class_image_thumb-{{ ProductClass.ClassCategory1.id }}-{{ ProductClass.ClassCategory2.id }}\"
src=\"{{ asset(ProductClass.getImageUrl(),'save_image') }}\"
data-class_category1=\"{{ ProductClass.ClassCategory1.id }}\"
data-class_category2=\"{{ ProductClass.ClassCategory2.id }}\">
{% elseif ProductClass.ClassCategory1 %}
<img id=\"apg_product_class_image_thumb-{{ ProductClass.ClassCategory1.id }}-\"
src=\"{{ asset(ProductClass.getImageUrl(),'save_image') }}\"
data-class_category1=\"{{ ProductClass.ClassCategory1.id }}\">
{% endif %}
</div>
{% endif %}
{% endfor %}
{% endif %}
</div>
{% if Product.freearea %}
<div class=\"ec-productRole__description ec-productRole__freearea\">
{{ include(template_from_string(Product.freearea)) }}
</div>
{% endif %}
</div>
</div>
<div class=\"ec-grid2__cell ec-description\">
<div class=\"ec-productRole__profile\">
{# 商品名 #}
{% if Product.ViewData(13) is defined and Product.ViewData(13) %}
<p class=\"ec-productRole__titleEn\">{{ Product.ViewData(13) }}</p>
{% endif %}
<div class=\"ec-productRole__title\">
<h2 class=\"ec-headingTitle\">{{ Product.name }}</h2>
</div>
{# 通常価格 #}
{% 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__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__priceRegularTax\">{{ '税込'|trans }}</span>
{% endif %}
</div>
{% else %}
{% if Product.getPrice01Max is not null %}
<div class=\"ec-productRole__priceRegular--div\">
<span class=\"ec-productRole__priceRegularPrice\">{{ '通常価格'|trans }}:{{ Product.getPrice01IncTaxMin|price }}</span>
<span class=\"ec-productRole__priceRegularTax\">{{ '税込'|trans }}</span>
</div>
{% endif %}
{% endif %}
{# 販売価格 #}
<div class=\"ec-productRole__price\">
{% if Product.hasProductClass -%}
{% if Product.getPrice02IncTaxMin == Product.getPrice02IncTaxMax %}
<div class=\"ec-price\">
<span class=\"ec-price__price price02-default\">{{ Product.getPrice02IncTaxMin|price }}</span>
<span class=\"ec-price__tax\">{{ '税込'|trans }}</span>
</div>
{% else %}
<div class=\"ec-price\">
<span class=\"ec-price__price price02-default\">{{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}</span>
<span class=\"ec-price__tax\">{{ '税込'|trans }}</span>
</div>
{% endif %}
{% else %}
<div class=\"ec-price\">
<span class=\"ec-price__price\">{{ Product.getPrice02IncTaxMin|price }}</span>
<span class=\"ec-price__tax\">{{ '税込'|trans }}</span>
</div>
{% endif %}
</div>
{# 商品コード #}
{% if Product.ViewData(11) is defined and Product.ViewData(11) %}
<div class=\"ec-productRole__sku\">
SKU:<span class=\"product-code-default\">{{ Product.ViewData(11) }}</span>
</div>
{% endif %}
{# ショートメッセージ #}
{% if Product.ViewData(5) is defined and Product.ViewData(5) %}
<div class=\"ec-productRole__shortMessage\">
<div class=\"ec-productRole__shortMessageBody\">{{ Product.ViewData(5)|raw }}</div>
</div>
{% endif %}
<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 ec-numberInput--withBtns\">
<span>{{ '数量'|trans }}</span>
<div class=\"ec-numberInput__row ec-numberInput__row--bordered\">
<button type=\"button\" class=\"ec-numberInput__btn ec-numberInput__btn--down\" aria-label=\"{{ '数量を減らす'|trans }}\">−</button>
{{ form_widget(form.quantity) }}
<button type=\"button\" class=\"ec-numberInput__btn ec-numberInput__btn--up\" aria-label=\"{{ '数量を増やす'|trans }}\">+</button>
</div>
{{ 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>
<div class=\"ec-productRole__secondaryBtns\">
{% if BaseInfo.option_favorite_product %}
<form action=\"{{ url('product_add_favorite', {id:Product.id}) }}\" method=\"post\" class=\"ec-productRole__secondaryBtnForm\">
{% if is_favorite == false %}
<button type=\"submit\" id=\"favorite\" class=\"ec-productRole__secondaryBtn ec-productRole__secondaryBtn--favorite\">
<i class=\"far fa-heart\" aria-hidden=\"true\"></i>{{ 'お気に入りに追加'|trans }}
</button>
{% else %}
<button type=\"submit\" id=\"favorite\" class=\"ec-productRole__secondaryBtn ec-productRole__secondaryBtn--favorite\" disabled=\"disabled\">
<i class=\"far fa-heart\" aria-hidden=\"true\"></i>{{ 'お気に入りに追加済です。'|trans }}
</button>
{% endif %}
</form>
{% endif %}
<a href=\"{{ url('contact') }}?product_id={{ Product.id }}&product_name={{ Product.name|e('url') }}\" class=\"ec-productRole__secondaryBtn ec-productRole__secondaryBtn--contact\">
<i class=\"fas fa-envelope\" aria-hidden=\"true\"></i>{{ '商品へのお問合せ'|trans }}
</a>
</div>
<div class=\"ec-productRole__description\">{{ Product.description_detail|raw|nl2br }}
</div>
</div>
</div>
</div>
</div>
{% endblock %}
", "__string_template__b7ddbfaf71442d4f6cb8c76f5e8ab670", "");
}
public function checkSecurity()
{
static $tags = array("set" => 13, "if" => 61, "for" => 270);
static $filters = array("raw" => 91, "json_encode" => 104, "escape" => 107, "trans" => 179, "no_image_product" => 274, "slice" => 277, "replace" => 277, "default" => 277, "price" => 368, "e" => 485, "nl2br" => 490);
static $functions = array("constant" => 61, "class_categories_as_json" => 91, "url" => 225, "asset" => 271, "include" => 350, "template_from_string" => 350, "form_row" => 422, "form_errors" => 423, "form_widget" => 436, "form_rest" => 455);
try {
$this->sandbox->checkSecurity(
['set', 'if', 'for'],
['raw', 'json_encode', 'escape', 'trans', 'no_image_product', 'slice', 'replace', 'default', 'price', 'e', 'nl2br'],
['constant', 'class_categories_as_json', 'url', 'asset', 'include', 'template_from_string', 'form_row', 'form_errors', 'form_widget', 'form_rest']
);
} catch (SecurityError $e) {
$e->setSourceContext($this->source);
if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
$e->setTemplateLine($tags[$e->getTagName()]);
} elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
$e->setTemplateLine($filters[$e->getFilterName()]);
} elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
$e->setTemplateLine($functions[$e->getFunctionName()]);
}
throw $e;
}
}
}