<?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;
/* Product/list.twig */
class __TwigTemplate_f49af4555fb1373ab1f5338a84d28263763bef4a20a2709ca1d040989078beb1 extends \Eccube\Twig\Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'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_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Product/list.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Product/list.twig"));
// line 13
$context["body_class"] = "product_page";
// line 11
$this->parent = $this->loadTemplate("default_frame.twig", "Product/list.twig", 11);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
}
// line 15
public function block_javascript($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascript"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascript"));
// line 16
echo " <script>
eccube.productsClassCategories = {
";
// line 18
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["pagination"]) || array_key_exists("pagination", $context) ? $context["pagination"] : (function () { throw new RuntimeError('Variable "pagination" does not exist.', 18, $this->source); })()));
$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["Product"]) {
// line 19
echo " \"";
echo twig_escape_filter($this->env, twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, true, 19), 19, $this->source), "js"), "html", null, true);
echo "\": ";
echo $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getClassCategoriesAsJson($this->sandbox->ensureToStringAllowed($context["Product"], 19, $this->source));
if ((twig_get_attribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, true, 19) == false)) {
echo ", ";
}
// line 20
echo " ";
++$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['Product'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 21
echo " };
\$(function() {
// 表示件数を変更
\$('.disp-number').change(function() {
var dispNumber = \$(this).val();
\$('#disp_number').val(dispNumber);
\$('#pageno').val(1);
\$(\"#form1\").submit();
});
// 並び順を変更
\$('.order-by').change(function() {
var orderBy = \$(this).val();
\$('#orderby').val(orderBy);
\$('#pageno').val(1);
\$(\"#form1\").submit();
});
\$('.add-cart').on('click', function(e) {
var \$form = \$(this).parents('li').find('form');
// 個数フォームのチェック
var \$quantity = \$form.parent().find('.quantity');
if (\$quantity.val() < 1) {
\$quantity[0].setCustomValidity('";
// line 47
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("1以上で入力してください。"), "html", null, true);
echo "');
setTimeout(function() {
loadingOverlay('hide');
}, 100);
return true;
} else {
\$quantity[0].setCustomValidity('');
}
e.preventDefault();
\$.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 75
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 82
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-overlay, .ec-modal .ec-inlineBtn--cancel').on('click', function() {
\$('.ec-modal').hide()
});
</script>
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 96
public function block_main($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "main"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "main"));
// line 97
echo "
";
// line 99
if ((twig_length_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["search_form"]) || array_key_exists("search_form", $context) ? $context["search_form"] : (function () { throw new RuntimeError('Variable "search_form" does not exist.', 99, $this->source); })()), "category_id", [], "any", false, false, true, 99), "vars", [], "any", false, false, true, 99), "errors", [], "any", false, false, true, 99)) > 0)) {
// line 100
echo " <div class=\"ec-searchnavRole\">
<p class=\"errormsg text-danger\">";
// line 101
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ご指定のカテゴリは存在しません"), "html", null, true);
echo "</p>
</div>
";
} else {
// line 104
echo " ";
// line 150
echo " <div class=\"ak-header\">
<div class=\"ak-pageHeader\">
<h1 style=\"text-align: center\">PRODUCTS</h1>
</div>
";
// line 155
$context["Categories"] = twig_get_attribute($this->env, $this->source, $this->env->getFunction('repository')->getCallable()("Eccube\\Entity\\Category"), "getList", [], "method", false, false, true, 155);
// line 186
echo "
";
// line 188
$macros["__internal_parse_1"] = $this;
// line 189
echo "<div class=\"ec-headerCategoryArea\">
<div class=\"ec-itemNav\">
<ul class=\"ec-itemNav__nav\">
";
// line 192
if (twig_get_attribute($this->env, $this->source, (isset($context["pagination"]) || array_key_exists("pagination", $context) ? $context["pagination"] : (function () { throw new RuntimeError('Variable "pagination" does not exist.', 192, $this->source); })()), "params", [], "any", false, false, true, 192)) {
// line 193
echo " <li><a href=\"";
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("homepage");
echo "products/list\">全て</a></li>
";
} else {
// line 195
echo " <li><a class=\"active\" href=\"";
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("homepage");
echo "products/list\">全て</a></li>
";
}
// line 197
echo "
";
// line 198
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_sort_filter($this->env, (isset($context["Categories"]) || array_key_exists("Categories", $context) ? $context["Categories"] : (function () { throw new RuntimeError('Variable "Categories" does not exist.', 198, $this->source); })())));
foreach ($context['_seq'] as $context["_key"] => $context["Category"]) {
// line 199
echo " <li>
";
// line 200
echo twig_call_macro($macros["__internal_parse_1"], "macro_treeCategory", [$context["Category"], (isset($context["pagination"]) || array_key_exists("pagination", $context) ? $context["pagination"] : (function () { throw new RuntimeError('Variable "pagination" does not exist.', 200, $this->source); })())], 200, $context, $this->getSourceContext());
echo "
</li>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Category'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 203
echo " </ul>
</div>
</div>
<style>
#akracing .ak-header .ec-headerCategoryArea .ec-itemNav__nav a.active{
color : #f00;
}
</style>
</div><!-- ak-header -->
";
// line 214
$context["Categories"] = twig_get_attribute($this->env, $this->source, $this->env->getFunction('repository')->getCallable()("Eccube\\Entity\\Category"), "getList", [], "method", false, false, true, 214);
// line 215
echo "
";
// line 339
echo "
";
// line 341
$macros["__internal_parse_3"] = $this;
// line 342
echo "
<div class=\"ak-body\">
<div class=\"\">
";
// line 345
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_sort_filter($this->env, (isset($context["Categories"]) || array_key_exists("Categories", $context) ? $context["Categories"] : (function () { throw new RuntimeError('Variable "Categories" does not exist.', 345, $this->source); })())));
foreach ($context['_seq'] as $context["_key"] => $context["Category"]) {
// line 346
echo "
";
// line 347
if (((twig_get_attribute($this->env, $this->source, (isset($context["pagination"]) || array_key_exists("pagination", $context) ? $context["pagination"] : (function () { throw new RuntimeError('Variable "pagination" does not exist.', 347, $this->source); })()), "params", [], "any", false, false, true, 347) == null) || !twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["pagination"] ?? null), "params", [], "any", false, true, true, 347), "category_id", [], "array", true, true, true, 347))) {
// line 348
echo " ";
// line 349
echo " ";
echo twig_call_macro($macros["__internal_parse_3"], "macro_tree", [$context["Category"], (isset($context["pagination"]) || array_key_exists("pagination", $context) ? $context["pagination"] : (function () { throw new RuntimeError('Variable "pagination" does not exist.', 349, $this->source); })()), (isset($context["forms"]) || array_key_exists("forms", $context) ? $context["forms"] : (function () { throw new RuntimeError('Variable "forms" does not exist.', 349, $this->source); })())], 349, $context, $this->getSourceContext());
echo "
";
} else {
// line 351
echo " ";
// line 352
echo " ";
// line 353
echo " ";
// line 354
echo " ";
$context["categoryId"] = twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["pagination"]) || array_key_exists("pagination", $context) ? $context["pagination"] : (function () { throw new RuntimeError('Variable "pagination" does not exist.', 354, $this->source); })()), "params", [], "any", false, false, true, 354), "category_id", [], "array", false, false, true, 354);
// line 355
echo " ";
if (((isset($context["categoryId"]) || array_key_exists("categoryId", $context) ? $context["categoryId"] : (function () { throw new RuntimeError('Variable "categoryId" does not exist.', 355, $this->source); })()) == twig_get_attribute($this->env, $this->source, $context["Category"], "id", [], "any", false, false, true, 355))) {
// line 356
echo " ";
echo twig_call_macro($macros["__internal_parse_3"], "macro_tree", [$context["Category"], (isset($context["pagination"]) || array_key_exists("pagination", $context) ? $context["pagination"] : (function () { throw new RuntimeError('Variable "pagination" does not exist.', 356, $this->source); })()), (isset($context["forms"]) || array_key_exists("forms", $context) ? $context["forms"] : (function () { throw new RuntimeError('Variable "forms" does not exist.', 356, $this->source); })())], 356, $context, $this->getSourceContext());
echo "
";
}
// line 358
echo " ";
}
// line 359
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Category'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 360
echo " </div>
</div>
";
// line 363
if ((twig_get_attribute($this->env, $this->source, (isset($context["pagination"]) || array_key_exists("pagination", $context) ? $context["pagination"] : (function () { throw new RuntimeError('Variable "pagination" does not exist.', 363, $this->source); })()), "totalItemCount", [], "any", false, false, true, 363) > 0)) {
// line 364
echo " <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 367
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/icon/cross-dark.svg"), "html", null, true);
echo "\" alt=\"\" loading=\"lazy\"/></span></span>
<div id=\"ec-modal-header\" class=\"text-center\">";
// line 368
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 371
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("お買い物を続ける"), "html", null, true);
echo "</span>
<a href=\"";
// line 372
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-pagerRole\">
";
// line 379
$this->loadTemplate("pager.twig", "Product/list.twig", 379)->display(twig_array_merge($context, ["pages" => twig_get_attribute($this->env, $this->source, (isset($context["pagination"]) || array_key_exists("pagination", $context) ? $context["pagination"] : (function () { throw new RuntimeError('Variable "pagination" does not exist.', 379, $this->source); })()), "paginationData", [], "any", false, false, true, 379)]));
// line 380
echo " </div>
";
}
// line 382
echo " ";
}
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 156
public function macro_treeCategory($__Category__ = null, $__pagination__ = null, ...$__varargs__)
{
$macros = $this->macros;
$context = $this->env->mergeGlobals([
"Category" => $__Category__,
"pagination" => $__pagination__,
"varargs" => $__varargs__,
]);
$blocks = [];
ob_start();
try {
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "treeCategory"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "treeCategory"));
// line 157
echo " ";
$macros["__internal_parse_0"] = $this;
// line 158
echo " ";
if (twig_get_attribute($this->env, $this->source, (isset($context["pagination"]) || array_key_exists("pagination", $context) ? $context["pagination"] : (function () { throw new RuntimeError('Variable "pagination" does not exist.', 158, $this->source); })()), "params", [], "any", false, false, true, 158)) {
// line 159
echo " ";
// line 160
echo " ";
// line 161
echo " ";
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["pagination"] ?? null), "params", [], "any", false, true, true, 161), "category_id", [], "array", true, true, true, 161) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["pagination"]) || array_key_exists("pagination", $context) ? $context["pagination"] : (function () { throw new RuntimeError('Variable "pagination" does not exist.', 161, $this->source); })()), "params", [], "any", false, false, true, 161), "category_id", [], "array", false, false, true, 161) == twig_get_attribute($this->env, $this->source, (isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 161, $this->source); })()), "id", [], "any", false, false, true, 161)))) {
// line 162
echo " <a class=\"active\" href=\"";
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_list");
echo "?category_id=";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 162, $this->source); })()), "id", [], "any", false, false, true, 162), 162, $this->source), "html", null, true);
echo "\">
";
// line 163
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 163, $this->source); })()), "name", [], "any", false, false, true, 163), 163, $this->source), "html", null, true);
echo "
</a>
";
} else {
// line 166
echo " <a href=\"";
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_list");
echo "?category_id=";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 166, $this->source); })()), "id", [], "any", false, false, true, 166), 166, $this->source), "html", null, true);
echo "\">
";
// line 167
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 167, $this->source); })()), "name", [], "any", false, false, true, 167), 167, $this->source), "html", null, true);
echo "
</a>
";
}
// line 170
echo " ";
} else {
// line 171
echo " <a href=\"";
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_list");
echo "?category_id=";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 171, $this->source); })()), "id", [], "any", false, false, true, 171), 171, $this->source), "html", null, true);
echo "\">
";
// line 172
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 172, $this->source); })()), "name", [], "any", false, false, true, 172), 172, $this->source), "html", null, true);
echo "
</a>
";
}
// line 175
echo "
";
// line 176
if ((twig_length_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 176, $this->source); })()), "children", [], "any", false, false, true, 176)) > 0)) {
// line 177
echo " <ul>
";
// line 178
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 178, $this->source); })()), "children", [], "any", false, false, true, 178));
foreach ($context['_seq'] as $context["_key"] => $context["ChildCategory"]) {
// line 179
echo " <li>
";
// line 180
echo twig_call_macro($macros["__internal_parse_0"], "macro_treeCategory", [$context["ChildCategory"], (isset($context["pagination"]) || array_key_exists("pagination", $context) ? $context["pagination"] : (function () { throw new RuntimeError('Variable "pagination" does not exist.', 180, $this->source); })())], 180, $context, $this->getSourceContext());
echo "
</li>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ChildCategory'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 183
echo " </ul>
";
}
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
return ('' === $tmp = ob_get_contents()) ? '' : new Markup($tmp, $this->env->getCharset());
} finally {
ob_end_clean();
}
}
// line 216
public function macro_tree($__Category__ = null, $__pagination__ = null, $__forms__ = null, ...$__varargs__)
{
$macros = $this->macros;
$context = $this->env->mergeGlobals([
"Category" => $__Category__,
"pagination" => $__pagination__,
"forms" => $__forms__,
"varargs" => $__varargs__,
]);
$blocks = [];
ob_start();
try {
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "tree"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "tree"));
// line 217
echo " ";
$macros["__internal_parse_2"] = $this;
// line 218
echo " <h2><a href=\"";
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_list");
echo "?category_id=";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 218, $this->source); })()), "id", [], "any", false, false, true, 218), 218, $this->source), "html", null, true);
echo "\">";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 218, $this->source); })()), "name", [], "any", false, false, true, 218), 218, $this->source), "html", null, true);
echo "</a></h2>
";
// line 220
echo " ";
// line 221
echo " ";
if ((twig_get_attribute($this->env, $this->source, (isset($context["pagination"]) || array_key_exists("pagination", $context) ? $context["pagination"] : (function () { throw new RuntimeError('Variable "pagination" does not exist.', 221, $this->source); })()), "totalItemCount", [], "any", false, false, true, 221) > 0)) {
// line 222
echo " <div class=\"ec-shelfRole\">
<ul class=\"ec-shelfGrid\">
";
// line 224
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["pagination"]) || array_key_exists("pagination", $context) ? $context["pagination"] : (function () { throw new RuntimeError('Variable "pagination" does not exist.', 224, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["Product"]) {
// line 225
echo " ";
$context["CategoryItemName"] = "";
// line 226
echo " ";
// line 227
echo " ";
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, $context["Product"], "ProductCategories", [], "any", false, false, true, 227))) {
// line 228
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["Product"], "ProductCategories", [], "any", false, false, true, 228));
foreach ($context['_seq'] as $context["_key"] => $context["ProductCategory"]) {
// line 229
echo "
";
// line 230
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["ProductCategory"], "Category", [], "any", false, false, true, 230), "path", [], "any", false, false, true, 230));
foreach ($context['_seq'] as $context["_key"] => $context["CategoryItem"]) {
// line 231
echo " ";
$context["CategoryItemName"] = twig_get_attribute($this->env, $this->source, $context["CategoryItem"], "name", [], "any", false, false, true, 231);
// line 232
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['CategoryItem'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 233
echo "
";
// line 234
if ((twig_get_attribute($this->env, $this->source, (isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 234, $this->source); })()), "name", [], "any", false, false, true, 234) == (isset($context["CategoryItemName"]) || array_key_exists("CategoryItemName", $context) ? $context["CategoryItemName"] : (function () { throw new RuntimeError('Variable "CategoryItemName" does not exist.', 234, $this->source); })()))) {
// line 235
echo " ";
if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_USER") || (twig_get_attribute($this->env, $this->source, $context["Product"], "member", [], "any", false, false, true, 235) != 1))) {
// line 236
echo " <li class=\"ec-shelfGrid__item\">
";
// line 238
echo " <a href=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_detail", ["id" => twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, true, 238)]), "html", null, true);
echo "\">
<p class=\"ec-shelfGrid__item-image\">
<img src=\"";
// line 240
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Product"], "main_list_image", [], "any", false, false, true, 240), 240, $this->source)), "save_image"), "html", null, true);
echo "\" loading=\"lazy\">
</p>
<h3>";
// line 242
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Product"], "name", [], "any", false, false, true, 242), 242, $this->source), "html", null, true);
echo "</h3>
<div class=\"product_desc\">
";
// line 245
echo " <p class=\"price02-default\">
販売価格:
";
// line 247
if (twig_get_attribute($this->env, $this->source, $context["Product"], "hasProductClass", [], "any", false, false, true, 247)) {
// line 248
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02Min", [], "any", false, false, true, 248) == twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02Max", [], "any", false, false, true, 248))) {
// line 249
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02IncTaxMin", [], "any", false, false, true, 249) == 0)) {
// line 250
echo " オープン価格
";
} else {
// line 252
echo " ";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02IncTaxMin", [], "any", false, false, true, 252), 252, $this->source)), "html", null, true);
echo "
";
}
// line 254
echo " ";
} else {
// line 255
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02IncTaxMin", [], "any", false, false, true, 255) == 0)) {
// line 256
echo " オープン価格 ~ ";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02IncTaxMax", [], "any", false, false, true, 256), 256, $this->source)), "html", null, true);
echo "
";
} else {
// line 258
echo " ";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02IncTaxMin", [], "any", false, false, true, 258), 258, $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, $context["Product"], "getPrice02IncTaxMax", [], "any", false, false, true, 258), 258, $this->source)), "html", null, true);
echo "
";
}
// line 260
echo "
";
}
// line 262
echo " ";
} else {
// line 263
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02IncTaxMin", [], "any", false, false, true, 263) == 0)) {
// line 264
echo " オープン価格
";
} else {
// line 266
echo " ";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02IncTaxMin", [], "any", false, false, true, 266), 266, $this->source)), "html", null, true);
echo "
";
}
// line 268
echo " ";
}
// line 269
echo " </p>
";
// line 271
if (twig_get_attribute($this->env, $this->source, $context["Product"], "description_list", [], "any", false, false, true, 271)) {
// line 272
echo " <p>";
echo twig_nl2br($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Product"], "description_list", [], "any", false, false, true, 272), 272, $this->source));
echo "</p>
";
}
// line 274
echo "
</div><!-- .product_desc -->
</a>
";
// line 280
if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_USER")) {
// line 281
echo " ";
// line 318
echo " ";
}
// line 319
echo " </li>
";
}
// line 321
echo " ";
}
// line 322
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ProductCategory'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 323
echo " ";
}
// line 324
echo " ";
// line 325
echo "
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Product'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 327
echo " </ul>
</div>
";
}
// line 330
echo " ";
// line 331
echo " ";
if ((twig_length_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 331, $this->source); })()), "children", [], "any", false, false, true, 331)) > 0)) {
// line 332
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 332, $this->source); })()), "children", [], "any", false, false, true, 332));
foreach ($context['_seq'] as $context["_key"] => $context["ChildCategory"]) {
// line 333
echo " <div class=\"\">
";
// line 334
echo twig_call_macro($macros["__internal_parse_2"], "macro_tree", [(isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 334, $this->source); })()), (isset($context["pagination"]) || array_key_exists("pagination", $context) ? $context["pagination"] : (function () { throw new RuntimeError('Variable "pagination" does not exist.', 334, $this->source); })()), (isset($context["forms"]) || array_key_exists("forms", $context) ? $context["forms"] : (function () { throw new RuntimeError('Variable "forms" does not exist.', 334, $this->source); })())], 334, $context, $this->getSourceContext());
echo "
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ChildCategory'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 337
echo " ";
}
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
return ('' === $tmp = ob_get_contents()) ? '' : new Markup($tmp, $this->env->getCharset());
} finally {
ob_end_clean();
}
}
public function getTemplateName()
{
return "Product/list.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 777 => 337, 768 => 334, 765 => 333, 760 => 332, 757 => 331, 755 => 330, 750 => 327, 743 => 325, 741 => 324, 738 => 323, 732 => 322, 729 => 321, 725 => 319, 722 => 318, 720 => 281, 718 => 280, 710 => 274, 704 => 272, 702 => 271, 698 => 269, 695 => 268, 689 => 266, 685 => 264, 682 => 263, 679 => 262, 675 => 260, 667 => 258, 661 => 256, 658 => 255, 655 => 254, 649 => 252, 645 => 250, 642 => 249, 639 => 248, 637 => 247, 633 => 245, 628 => 242, 623 => 240, 617 => 238, 614 => 236, 611 => 235, 609 => 234, 606 => 233, 600 => 232, 597 => 231, 593 => 230, 590 => 229, 585 => 228, 582 => 227, 580 => 226, 577 => 225, 573 => 224, 569 => 222, 566 => 221, 564 => 220, 555 => 218, 552 => 217, 531 => 216, 514 => 183, 505 => 180, 502 => 179, 498 => 178, 495 => 177, 493 => 176, 490 => 175, 484 => 172, 477 => 171, 474 => 170, 468 => 167, 461 => 166, 455 => 163, 448 => 162, 445 => 161, 443 => 160, 441 => 159, 438 => 158, 435 => 157, 415 => 156, 404 => 382, 400 => 380, 398 => 379, 386 => 372, 382 => 371, 376 => 368, 372 => 367, 367 => 364, 365 => 363, 360 => 360, 354 => 359, 351 => 358, 345 => 356, 342 => 355, 339 => 354, 337 => 353, 335 => 352, 333 => 351, 327 => 349, 325 => 348, 323 => 347, 320 => 346, 316 => 345, 311 => 342, 309 => 341, 306 => 339, 303 => 215, 301 => 214, 288 => 203, 279 => 200, 276 => 199, 272 => 198, 269 => 197, 263 => 195, 257 => 193, 255 => 192, 250 => 189, 248 => 188, 245 => 186, 243 => 155, 236 => 150, 234 => 104, 228 => 101, 225 => 100, 223 => 99, 219 => 97, 209 => 96, 186 => 82, 176 => 75, 145 => 47, 117 => 21, 103 => 20, 95 => 19, 78 => 18, 74 => 16, 64 => 15, 53 => 11, 51 => 13, 38 => 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' %}
{% block javascript %}
<script>
eccube.productsClassCategories = {
{% for Product in pagination %}
\"{{ Product.id|escape('js') }}\": {{ class_categories_as_json(Product)|raw }}{% if loop.last == false %}, {% endif %}
{% endfor %}
};
\$(function() {
// 表示件数を変更
\$('.disp-number').change(function() {
var dispNumber = \$(this).val();
\$('#disp_number').val(dispNumber);
\$('#pageno').val(1);
\$(\"#form1\").submit();
});
// 並び順を変更
\$('.order-by').change(function() {
var orderBy = \$(this).val();
\$('#orderby').val(orderBy);
\$('#pageno').val(1);
\$(\"#form1\").submit();
});
\$('.add-cart').on('click', function(e) {
var \$form = \$(this).parents('li').find('form');
// 個数フォームのチェック
var \$quantity = \$form.parent().find('.quantity');
if (\$quantity.val() < 1) {
\$quantity[0].setCustomValidity('{{ '1以上で入力してください。'|trans }}');
setTimeout(function() {
loadingOverlay('hide');
}, 100);
return true;
} else {
\$quantity[0].setCustomValidity('');
}
e.preventDefault();
\$.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-overlay, .ec-modal .ec-inlineBtn--cancel').on('click', function() {
\$('.ec-modal').hide()
});
</script>
{% endblock %}
{% block main %}
{% if search_form.category_id.vars.errors|length > 0 %}
<div class=\"ec-searchnavRole\">
<p class=\"errormsg text-danger\">{{ 'ご指定のカテゴリは存在しません'|trans }}</p>
</div>
{% else %}{# カテゴリー表示 #}
{#
<div class=\"ec-searchnavRole\">
<form name=\"form1\" id=\"form1\" method=\"get\" action=\"?\">
{% for item in search_form %}
<input type=\"hidden\" id=\"{{ item.vars.id }}\"
name=\"{{ item.vars.full_name }}\"
{% if item.vars.value is not empty %}value=\"{{ item.vars.value }}\" {% endif %}/>
{% endfor %}
</form>
<div class=\"ec-searchnavRole__topicpath\">
<ol class=\"ec-topicpath\">
<li class=\"ec-topicpath__item\"><a href=\"{{ url('product_list') }}\">{{ '全て'|trans }}</a>
</li>
{% if Category is not null %}
{% for Path in Category.path %}
<li class=\"ec-topicpath__divider\">|</li>
<li class=\"ec-topicpath__item{% if loop.last %}--active{% endif %}\"><a
href=\"{{ url('product_list') }}?category_id={{ Path.id }}\">{{ Path.name }}</a>
</li>
{% endfor %}
{% endif %}
{% if search_form.vars.value and search_form.vars.value.name %}
<li class=\"ec-topicpath__divider\">|</li>
<li class=\"ec-topicpath__item\">{{ '「%name%」の検索結果'|trans({ '%name%': search_form.vars.value.name }) }}</li>
{% endif %}
</ol>
</div>
<div class=\"ec-searchnavRole__infos\">
<div class=\"ec-searchnavRole__counter\">
{% if pagination.totalItemCount > 0 %}
{{ '<span class=\"ec-font-bold\">%count%件</span><span>の商品が見つかりました</span>'|trans({ '%count%': pagination.totalItemCount })|raw }}
{% else %}
<span>{{ 'お探しの商品は見つかりませんでした'|trans }}</span>
{% endif %}
</div>
{% if pagination.totalItemCount > 0 %}
<div class=\"ec-searchnavRole__actions\">
<div class=\"ec-select\">
{{ form_widget(disp_number_form, {'id': '', 'attr': {'class': 'disp-number'}}) }}
{{ form_widget(order_by_form, {'id': '', 'attr': {'class': 'order-by'}}) }}
</div>
</div>
{% endif %}
</div>
</div>
#}
<div class=\"ak-header\">
<div class=\"ak-pageHeader\">
<h1 style=\"text-align: center\">PRODUCTS</h1>
</div>
{% set Categories = repository('Eccube\\\\Entity\\\\Category').getList() %}
{% macro treeCategory(Category,pagination) %}
{% from _self import treeCategory %}
{% if pagination.params %}
{# dump( pagination.params[\"category_id\"] ) #}
{# dump( pagination.params[\"category_id\"] == Category.id ) #}
{% if pagination.params[\"category_id\"] is defined and pagination.params[\"category_id\"] == Category.id %}
<a class=\"active\" href=\"{{ url('product_list') }}?category_id={{ Category.id }}\">
{{ Category.name }}
</a>
{% else %}
<a href=\"{{ url('product_list') }}?category_id={{ Category.id }}\">
{{ Category.name }}
</a>
{% endif %}
{% else %}
<a href=\"{{ url('product_list') }}?category_id={{ Category.id }}\">
{{ Category.name }}
</a>
{% endif %}
{% if Category.children|length > 0 %}
<ul>
{% for ChildCategory in Category.children %}
<li>
{{ treeCategory(ChildCategory,pagination) }}
</li>
{% endfor %}
</ul>
{% endif %}
{% endmacro %}
{# @see https://github.com/bolt/bolt/pull/2388 #}
{% from _self import treeCategory %}
<div class=\"ec-headerCategoryArea\">
<div class=\"ec-itemNav\">
<ul class=\"ec-itemNav__nav\">
{% if pagination.params %}
<li><a href=\"{{ url('homepage') }}products/list\">全て</a></li>
{% else %}
<li><a class=\"active\" href=\"{{ url('homepage') }}products/list\">全て</a></li>
{% endif %}
{% for Category in Categories|sort %}
<li>
{{ treeCategory(Category,pagination) }}
</li>
{% endfor %}
</ul>
</div>
</div>
<style>
#akracing .ak-header .ec-headerCategoryArea .ec-itemNav__nav a.active{
color : #f00;
}
</style>
</div><!-- ak-header -->
{% set Categories = repository('Eccube\\\\Entity\\\\Category').getList() %}
{% macro tree(Category , pagination ,forms) %}
{% from _self import tree %}
<h2><a href=\"{{ url('product_list') }}?category_id={{ Category.id }}\">{{ Category.name }}</a></h2>
{# <h2>{{ Category.name }}</h2> #}
{# 商品情報 #}
{% if pagination.totalItemCount > 0 %}
<div class=\"ec-shelfRole\">
<ul class=\"ec-shelfGrid\">
{% for Product in pagination %}
{% set CategoryItemName = \"\" %}
{# 関連カテゴリ #}
{% if Product.ProductCategories is not empty %}
{% for ProductCategory in Product.ProductCategories %}
{% for CategoryItem in ProductCategory.Category.path %}
{% set CategoryItemName = CategoryItem.name %}
{% endfor %}
{% if Category.name == CategoryItemName %}
{% if is_granted('ROLE_USER') or Product.member != 1 %}{# 会員限定 #}
<li class=\"ec-shelfGrid__item\">
{#<p>{{Category.name}}:{{CategoryItemName}}</p>#}
<a href=\"{{ url('product_detail', {'id': Product.id}) }}\">
<p class=\"ec-shelfGrid__item-image\">
<img src=\"{{ asset(Product.main_list_image|no_image_product, 'save_image') }}\" loading=\"lazy\">
</p>
<h3>{{ Product.name }}</h3>
<div class=\"product_desc\">
{# 20230921@hanari 非表示 #}
<p class=\"price02-default\">
販売価格:
{% if Product.hasProductClass %}
{% if Product.getPrice02Min == Product.getPrice02Max %}
{% if Product.getPrice02IncTaxMin == 0 %}
オープン価格
{% else %}
{{ Product.getPrice02IncTaxMin|price }}
{% endif %}
{% else %}
{% if Product.getPrice02IncTaxMin == 0 %}
オープン価格 ~ {{ Product.getPrice02IncTaxMax|price }}
{% else %}
{{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}
{% endif %}
{% endif %}
{% else %}
{% if Product.getPrice02IncTaxMin == 0 %}
オープン価格
{% else %}
{{ Product.getPrice02IncTaxMin|price }}
{% endif %}
{% endif %}
</p>
{% if Product.description_list %}
<p>{{ Product.description_list|raw|nl2br }}</p>
{% endif %}
</div><!-- .product_desc -->
</a>
{% if is_granted('ROLE_USER') %}{# ログイン後表示 #}
{#
{% if Product.stock_find %}
{% set form = forms[Product.id] %}
<form name=\"form{{ Product.id }}\" id=\"productForm{{ Product.id }}\" action=\"{{ url('product_add_cart', {id:Product.id}) }}\" method=\"post\">
<div class=\"ec-productRole__actions\">
{% if form.classcategory_id1 is defined %}
<div class=\"ec-select\">
{{ form_widget(form.classcategory_id1) }}
{{ form_errors(form.classcategory_id1) }}
</div>
{% if form.classcategory_id2 is defined %}
<div class=\"ec-select\">
{{ form_widget(form.classcategory_id2) }}
{{ form_errors(form.classcategory_id2) }}
</div>
{% endif %}
{% endif %}
<div class=\"ec-numberInput\"><span>{{ '数量'|trans }}</span>
{{ form_widget(form.quantity, {'attr': {'class': 'quantity'}}) }}
{{ form_errors(form.quantity) }}
</div>
</div>
{{ form_rest(form) }}
</form>
<div class=\"ec-productRole__btn\">
<button type=\"submit\" class=\"ec-blockBtn--action add-cart\" data-cartid=\"{{ Product.id }}\" form=\"productForm{{ Product.id }}\">
{{ 'カートに入れる'|trans }}
</button>
</div>
{% else %}
<div class=\"ec-productRole__btn\">
<button type=\"button\" class=\"ec-blockBtn--action\" disabled=\"disabled\">
{{ 'ただいま品切れ中です。'|trans }}
</button>
</div>
{% endif %}
#}
{% endif %}{# ログイン後表示 #}
</li>
{% endif %}
{% endif %}{# 会員限定 #}
{% endfor %}
{% endif %}
{# 関連カテゴリ #}
{% endfor %}
</ul>
</div>
{% endif %}
{# 商品情報 #}
{% if Category.children|length > 0 %}
{% for ChildCategory in Category.children %}
<div class=\"\">
{{ tree(Category , pagination ,forms) }}
</div>
{% endfor %}
{% endif %}
{% endmacro %}
{# @see https://github.com/bolt/bolt/pull/2388 #}
{% from _self import tree %}
<div class=\"ak-body\">
<div class=\"\">
{% for Category in Categories|sort %}
{% if pagination.params == null or pagination.params[\"category_id\"] is not defined %}
{# 一覧表示 #}
{{ tree(Category , pagination ,forms) }}
{% else %}
{# カテゴリー表示 #}
{# dump( pagination.params[\"category_id\"] ) #}
{# dump(Category.id) #}
{% set categoryId = pagination.params[\"category_id\"] %}
{% if categoryId == Category.id %}
{{ tree(Category , pagination ,forms) }}
{% endif %}
{% endif %}
{% endfor %}
</div>
</div>
{% if pagination.totalItemCount > 0 %}
<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=\"\" loading=\"lazy\"/></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-pagerRole\">
{% include \"pager.twig\" with {'pages': pagination.paginationData} %}
</div>
{% endif %}
{% endif %}{# カテゴリー表示 #}
{% endblock %}
", "Product/list.twig", "/home/akracing/www/akracing.dev/app/template/akracing/Product/list.twig");
}
public function checkSecurity()
{
static $tags = array("set" => 13, "for" => 18, "if" => 19, "from" => 188, "include" => 379, "macro" => 156);
static $filters = array("escape" => 19, "raw" => 19, "trans" => 47, "length" => 99, "sort" => 198, "no_image_product" => 240, "price" => 252, "nl2br" => 272);
static $functions = array("class_categories_as_json" => 19, "url" => 75, "repository" => 155, "asset" => 367, "is_granted" => 235);
try {
$this->sandbox->checkSecurity(
['set', 'for', 'if', 'from', 'include', 'macro'],
['escape', 'raw', 'trans', 'length', 'sort', 'no_image_product', 'price', 'nl2br'],
['class_categories_as_json', 'url', 'repository', 'asset', 'is_granted']
);
} 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;
}
}
}