<?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_5a09195ffc144b4e947a81687a5a8e2d 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_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Product/list.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Product/list.twig"));
// line 13
$context["body_class"] = "list_page";
// line 11
$this->parent = $this->loadTemplate("default_frame.twig", "Product/list.twig", 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_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"));
// 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));
echo " ";
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) {
// デフォルトのフォーム送信を必ず阻止する
e.preventDefault();
var \$form = \$(this).closest('form');
if (!\$form.length) {
\$form = \$('#productForm' + \$(this).data('cartid'));
}
// 個数フォームのチェック
var \$quantity = \$form.find('.quantity');
if (\$quantity.val() < 1) {
\$quantity[0].setCustomValidity('";
// line 54
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('');
}
// ボタンを無効化して二重送信を防止
\$('.add-cart').prop('disabled', true);
// デバッグ用 - フォームの内容確認
console.log('Form action:', \$form.attr('action'));
console.log('Form data:', \$form.serialize());
\$.ajax({
url: \$form.attr('action'),
type: \$form.attr('method'),
data: \$form.serialize(),
dataType: 'json'
}).done(function (data) {
console.log('Success:', data);
// レスポンス内のメッセージをモーダルに表示
if (data.messages && data.messages.length > 0) {
\$('#ec-modal-header').text(data.messages[0]);
} else {
\$('#ec-modal-header').text('";
// line 78
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートに追加しました。"), "html", null, true);
echo "');
}
// モーダルを表示
\$('.ec-modal').show();
// カートブロックを更新する
\$.ajax({
url: '";
// line 86
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) {
console.error('Error:', data);
alert('";
// line 94
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();
});
});
</script>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 113
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 114
echo "
";
// line 116
if (( !(null === (isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 116, $this->source); })())) && (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.', 116, $this->source); })()), "id", [], "any", false, false, true, 116) == 10))) {
// line 117
echo "<div class=\"ec-hello-message\">
";
// line 119
echo "</div>
";
}
// line 122
$this->loadTemplate("Block/breadcrumb.twig", "Product/list.twig", 122)->display($context);
// line 123
echo "
";
// line 124
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.', 124, $this->source); })()), "category_id", [], "any", false, false, true, 124), "vars", [], "any", false, false, true, 124), "errors", [], "any", false, false, true, 124)) > 0)) {
// line 125
echo "<div class=\"ec-searchnavRole\">
<p class=\"errormsg text-danger\">";
// line 126
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ご指定のカテゴリは存在しません"), "html", null, true);
echo "</p>
</div>
";
} else {
// line 129
echo "<div class=\"ec-searchnavRole\">
<form name=\"form1\" id=\"form1\" method=\"get\" action=\"?\">
";
// line 131
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["search_form"]) || array_key_exists("search_form", $context) ? $context["search_form"] : (function () { throw new RuntimeError('Variable "search_form" does not exist.', 131, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
// line 132
echo " <input type=\"hidden\" id=\"";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["item"], "vars", [], "any", false, false, true, 132), "id", [], "any", false, false, true, 132), 132, $this->source), "html", null, true);
echo "\" name=\"";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["item"], "vars", [], "any", false, false, true, 132), "full_name", [], "any", false, false, true, 132), 132, $this->source), "html", null, true);
echo "\" ";
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["item"], "vars", [], "any", false, false, true, 132), "value", [], "any", false, false, true, 132))) {
echo "value=\"";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["item"], "vars", [], "any", false, false, true, 132), "value", [], "any", false, false, true, 132), 132, $this->source), "html", null, true);
echo "\" ";
}
echo " />
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 134
echo " </form>
<div class=\"ec-searchnavRole__topicpath\">
<ol class=\"ec-topicpath\">
";
// line 146
echo " ";
if ((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.', 146, $this->source); })()), "vars", [], "any", false, false, true, 146), "value", [], "any", false, false, true, 146) && 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.', 146, $this->source); })()), "vars", [], "any", false, false, true, 146), "value", [], "any", false, false, true, 146), "name", [], "any", false, false, true, 146))) {
// line 147
echo " <li class=\"ec-topicpath__divider\">|</li>
<li class=\"ec-topicpath__item\">";
// line 148
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("「%name%」の検索結果", ["%name%" => 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.', 148, $this->source); })()), "vars", [], "any", false, false, true, 148), "value", [], "any", false, false, true, 148), "name", [], "any", false, false, true, 148)]), "html", null, true);
echo "</li>
";
}
// line 150
echo " </ol>
</div>
<div class=\"ec-searchnavRole__infos\">
<div class=\"ec-searchnavRole__counter\">
";
// line 154
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.', 154, $this->source); })()), "totalItemCount", [], "any", false, false, true, 154) > 0)) {
// line 155
echo " ";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("<span class=\"ec-font-bold\">%count%件</span><span>の商品が見つかりました</span>", ["%count%" => 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.', 155, $this->source); })()), "totalItemCount", [], "any", false, false, true, 155)]);
echo "
";
} else {
// line 157
echo " <span>";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("お探しの商品は見つかりませんでした"), "html", null, true);
echo "</span>
";
}
// line 159
echo " </div>
";
// line 160
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.', 160, $this->source); })()), "totalItemCount", [], "any", false, false, true, 160) > 0)) {
// line 161
echo " <div class=\"ec-searchnavRole__actions\">
<div class=\"ec-select\">
";
// line 163
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock($this->sandbox->ensureToStringAllowed(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.', 163, $this->source); })()), "disp_number", [], "any", false, false, true, 163), 163, $this->source), 'widget', ["id" => "", "attr" => ["class" => "disp-number"]]);
echo "
";
// line 164
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock($this->sandbox->ensureToStringAllowed(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.', 164, $this->source); })()), "orderby", [], "any", false, false, true, 164), 164, $this->source), 'widget', ["id" => "", "attr" => ["class" => "order-by"]]);
echo "
</div>
</div>
";
}
// line 168
echo " </div>
</div>
";
// line 170
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.', 170, $this->source); })()), "totalItemCount", [], "any", false, false, true, 170) > 0)) {
// line 171
echo "<div class=\"ec-shelfRole\">
<ul class=\"ec-shelfGrid\">
";
// line 173
$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.', 173, $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 174
echo " <li class=\"ec-shelfGrid__item\">
<a href=\"";
// line 175
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, 175)]), "html", null, true);
echo "\">
<div class=\"ec-shelfGrid__item-wrap\">
<div class=\"ec-shelfGrid__item-imageWrap\">
<p class=\"ec-shelfGrid__item-image\">
<img src=\"";
// line 179
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, 179), 179, $this->source)), "save_image"), "html", null, true);
echo "\" alt=\"";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Product"], "name", [], "any", false, false, true, 179), 179, $this->source), "html", null, true);
echo "\" ";
if ((twig_get_attribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, true, 179) > 5)) {
echo " loading=\"lazy\"";
}
echo ">
";
// line 181
echo " ";
if ((twig_length_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Product"], "Tags", [], "any", false, false, true, 181)) > 0)) {
// line 182
echo " <ul class=\"ec-productRole__tags\">
";
// line 183
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["Product"], "Tags", [], "any", false, false, true, 183));
foreach ($context['_seq'] as $context["_key"] => $context["Tag"]) {
// line 184
echo " <li class=\"ec-productRole__tag tag_";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Tag"], "id", [], "any", false, false, true, 184), 184, $this->source), "html", null, true);
echo "\"></li>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Tag'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 186
echo " </ul>
";
}
// line 188
echo " </p>
</div>
<div class=\"ec-shelfGrid__item-textWrap\">
<p class=\"ec-productRole__item-title\">";
// line 191
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Product"], "name", [], "any", false, false, true, 191), 191, $this->source), "html", null, true);
echo "</p>
";
// line 192
if (twig_get_attribute($this->env, $this->source, $context["Product"], "description_list", [], "any", false, false, true, 192)) {
// line 193
echo " <div class=\"ec-productRole__item-description\">";
echo $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Product"], "description_list", [], "any", false, false, true, 193), 193, $this->source);
echo "</div>
";
}
// line 195
echo " <p class=\"ec-productRole__item-price\">
";
// line 196
if (twig_get_attribute($this->env, $this->source, $context["Product"], "hasProductClass", [], "any", false, false, true, 196)) {
// line 197
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02Min", [], "any", false, false, true, 197) == twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02Max", [], "any", false, false, true, 197))) {
// line 198
echo " ";
echo twig_escape_filter($this->env, twig_number_format_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02IncTaxMin", [], "any", false, false, true, 198), 198, $this->source)), "html", null, true);
echo "円 <span class=\"ec-price__tax\">(税込)</span>
";
} else {
// line 200
echo " ";
echo twig_escape_filter($this->env, twig_number_format_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02IncTaxMin", [], "any", false, false, true, 200), 200, $this->source)), "html", null, true);
echo "円 ~ ";
echo twig_escape_filter($this->env, twig_number_format_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02IncTaxMax", [], "any", false, false, true, 200), 200, $this->source)), "html", null, true);
echo "円 <span class=\"ec-price__tax\">(税込)</span>
";
}
// line 202
echo " ";
} else {
// line 203
echo " ";
echo twig_escape_filter($this->env, twig_number_format_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02IncTaxMin", [], "any", false, false, true, 203), 203, $this->source)), "html", null, true);
echo "円 <span class=\"ec-price__tax\">(税込)</span>
";
}
// line 205
echo " </p>
</div>
</div>
</a>
";
// line 210
if (twig_get_attribute($this->env, $this->source, $context["Product"], "stock_find", [], "any", false, false, true, 210)) {
// line 211
echo " ";
$context["form"] = twig_get_attribute($this->env, $this->source, (isset($context["forms"]) || array_key_exists("forms", $context) ? $context["forms"] : (function () { throw new RuntimeError('Variable "forms" does not exist.', 211, $this->source); })()), twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, true, 211), [], "array", false, false, true, 211);
// line 212
echo " <form name=\"form";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, true, 212), 212, $this->source), "html", null, true);
echo "\" id=\"productForm";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, true, 212), 212, $this->source), "html", null, true);
echo "\" action=\"";
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, $context["Product"], "id", [], "any", false, false, true, 212)]), "html", null, true);
echo "\" method=\"post\">
<div class=\"ec-productRole__actions\">
";
// line 214
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id1", [], "any", true, true, true, 214)) {
// line 215
echo " <div class=\"ec-select\">
";
// line 216
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.', 216, $this->source); })()), "classcategory_id1", [], "any", false, false, true, 216), 216, $this->source), 'widget');
echo "
";
// line 217
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.', 217, $this->source); })()), "classcategory_id1", [], "any", false, false, true, 217), 217, $this->source), 'errors');
echo "
</div>
";
// line 219
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id2", [], "any", true, true, true, 219)) {
// line 220
echo " <div class=\"ec-select\">
";
// line 221
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.', 221, $this->source); })()), "classcategory_id2", [], "any", false, false, true, 221), 221, $this->source), 'widget');
echo "
";
// line 222
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.', 222, $this->source); })()), "classcategory_id2", [], "any", false, false, true, 222), 222, $this->source), 'errors');
echo "
</div>
";
}
// line 225
echo " ";
}
// line 226
echo " <!-- 数量入力とボタンを一つのdivで囲む -->
<div class=\"ec-productActions\">
<div class=\"ec-numberInput\"><span>";
// line 228
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("数量"), "html", null, true);
echo "</span>
";
// line 229
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.', 229, $this->source); })()), "quantity", [], "any", false, false, true, 229), 229, $this->source), 'widget', ["attr" => ["class" => "quantity"]]);
echo "
";
// line 230
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.', 230, $this->source); })()), "quantity", [], "any", false, false, true, 230), 230, $this->source), 'errors');
echo "
</div>
<div class=\"ec-productRole__btn\">
<button type=\"button\" class=\"ec-blockBtn--action add-cart\" data-cartid=\"";
// line 233
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, true, 233), 233, $this->source), "html", null, true);
echo "\">
";
// line 234
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートに入れる"), "html", null, true);
echo "
</button>
</div>
</div>
</div>
";
// line 239
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.', 239, $this->source); })()), 239, $this->source), 'rest');
echo "
</form>
";
} else {
// line 242
echo " <div class=\"ec-productRole__btn\">
<button type=\"button\" class=\"ec-blockBtn--action\" disabled=\"disabled\">
";
// line 244
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("オンライン在庫なし"), "html", null, true);
echo "
</button>
</div>
";
}
// line 248
echo " </li>
";
++$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 250
echo " </ul>
</div>
<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 255
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 256
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 259
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("お買い物を続ける"), "html", null, true);
echo "</span>
<a href=\"";
// line 260
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 267
$this->loadTemplate("pager.twig", "Product/list.twig", 267)->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.', 267, $this->source); })()), "paginationData", [], "any", false, false, true, 267)]));
// line 268
echo "</div>
";
}
}
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
public function getTemplateName()
{
return "Product/list.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 618 => 268, 616 => 267, 604 => 260, 600 => 259, 594 => 256, 590 => 255, 583 => 250, 568 => 248, 561 => 244, 557 => 242, 551 => 239, 543 => 234, 539 => 233, 533 => 230, 529 => 229, 525 => 228, 521 => 226, 518 => 225, 512 => 222, 508 => 221, 505 => 220, 503 => 219, 498 => 217, 494 => 216, 491 => 215, 489 => 214, 479 => 212, 476 => 211, 474 => 210, 467 => 205, 461 => 203, 458 => 202, 450 => 200, 444 => 198, 441 => 197, 439 => 196, 436 => 195, 430 => 193, 428 => 192, 424 => 191, 419 => 188, 415 => 186, 406 => 184, 402 => 183, 399 => 182, 396 => 181, 386 => 179, 379 => 175, 376 => 174, 359 => 173, 355 => 171, 353 => 170, 349 => 168, 342 => 164, 338 => 163, 334 => 161, 332 => 160, 329 => 159, 323 => 157, 317 => 155, 315 => 154, 309 => 150, 304 => 148, 301 => 147, 298 => 146, 293 => 134, 276 => 132, 272 => 131, 268 => 129, 262 => 126, 259 => 125, 257 => 124, 254 => 123, 252 => 122, 248 => 119, 245 => 117, 243 => 116, 240 => 114, 230 => 113, 202 => 94, 191 => 86, 180 => 78, 153 => 54, 118 => 21, 104 => 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 = 'list_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) {
// デフォルトのフォーム送信を必ず阻止する
e.preventDefault();
var \$form = \$(this).closest('form');
if (!\$form.length) {
\$form = \$('#productForm' + \$(this).data('cartid'));
}
// 個数フォームのチェック
var \$quantity = \$form.find('.quantity');
if (\$quantity.val() < 1) {
\$quantity[0].setCustomValidity('{{ '1以上で入力してください。'|trans }}');
return true;
} else {
\$quantity[0].setCustomValidity('');
}
// ボタンを無効化して二重送信を防止
\$('.add-cart').prop('disabled', true);
// デバッグ用 - フォームの内容確認
console.log('Form action:', \$form.attr('action'));
console.log('Form data:', \$form.serialize());
\$.ajax({
url: \$form.attr('action'),
type: \$form.attr('method'),
data: \$form.serialize(),
dataType: 'json'
}).done(function (data) {
console.log('Success:', data);
// レスポンス内のメッセージをモーダルに表示
if (data.messages && data.messages.length > 0) {
\$('#ec-modal-header').text(data.messages[0]);
} else {
\$('#ec-modal-header').text('{{ 'カートに追加しました。'|trans }}');
}
// モーダルを表示
\$('.ec-modal').show();
// カートブロックを更新する
\$.ajax({
url: '{{ url('block_cart') }}',
type: 'GET',
dataType: 'html'
}).done(function (html) {
\$('.ec-headerRole__cart').html(html);
});
}).fail(function (data) {
console.error('Error:', data);
alert('{{ 'カートへの追加に失敗しました。'|trans }}');
}).always(function (data) {
// Buttonを有効にする
\$('.add-cart').prop('disabled', false);
});
});
// モーダル関連のイベントハンドラ - ここに移動
\$('.ec-modal-wrap').on('click', function (e) {
// モーダル内の処理は外側にバブリングさせない
e.stopPropagation();
});
\$('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function () {
\$('.ec-modal').hide();
});
});
</script>
{% endblock %}
{% block main %}
{# 特定のカテゴリIDまたは商品IDの時に「Hello World」を表示 #}
{% if Category is not null and Category.id == 10 %}
<div class=\"ec-hello-message\">
{#<p>Hello World</p>#}
</div>
{% endif %}
{# パンくず #}
{% include 'Block/breadcrumb.twig' %}
{% 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(search_form.disp_number, {'id': '', 'attr': {'class': 'disp-number'}}) }}
{{ form_widget(search_form.orderby, {'id': '', 'attr': {'class': 'order-by'}}) }}
</div>
</div>
{% endif %}
</div>
</div>
{% if pagination.totalItemCount > 0 %}
<div class=\"ec-shelfRole\">
<ul class=\"ec-shelfGrid\">
{% for Product in pagination %}
<li class=\"ec-shelfGrid__item\">
<a href=\"{{ url('product_detail', {'id': Product.id}) }}\">
<div class=\"ec-shelfGrid__item-wrap\">
<div class=\"ec-shelfGrid__item-imageWrap\">
<p class=\"ec-shelfGrid__item-image\">
<img src=\"{{ asset(Product.main_list_image|no_image_product, 'save_image') }}\" alt=\"{{ Product.name }}\" {% if loop.index > 5 %} loading=\"lazy\"{% endif %}>
{# 商品タグの表示 #}
{% if Product.Tags|length > 0 %}
<ul class=\"ec-productRole__tags\">
{% for Tag in Product.Tags %}
<li class=\"ec-productRole__tag tag_{{ Tag.id }}\"></li>
{% endfor %}
</ul>
{% endif %}
</p>
</div>
<div class=\"ec-shelfGrid__item-textWrap\">
<p class=\"ec-productRole__item-title\">{{ Product.name }}</p>
{% if Product.description_list %}
<div class=\"ec-productRole__item-description\">{{ Product.description_list|raw }}</div>
{% endif %}
<p class=\"ec-productRole__item-price\">
{% if Product.hasProductClass %}
{% if Product.getPrice02Min == Product.getPrice02Max %}
{{ Product.getPrice02IncTaxMin|number_format }}円 <span class=\"ec-price__tax\">(税込)</span>
{% else %}
{{ Product.getPrice02IncTaxMin|number_format }}円 ~ {{ Product.getPrice02IncTaxMax|number_format }}円 <span class=\"ec-price__tax\">(税込)</span>
{% endif %}
{% else %}
{{ Product.getPrice02IncTaxMin|number_format }}円 <span class=\"ec-price__tax\">(税込)</span>
{% endif %}
</p>
</div>
</div>
</a>
{% 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で囲む -->
<div class=\"ec-productActions\">
<div class=\"ec-numberInput\"><span>{{ '数量'|trans }}</span>
{{ form_widget(form.quantity, {'attr': {'class': 'quantity'}}) }}
{{ form_errors(form.quantity) }}
</div>
<div class=\"ec-productRole__btn\">
<button type=\"button\" class=\"ec-blockBtn--action add-cart\" data-cartid=\"{{ Product.id }}\">
{{ 'カートに入れる'|trans }}
</button>
</div>
</div>
</div>
{{ form_rest(form) }}
</form>
{% else %}
<div class=\"ec-productRole__btn\">
<button type=\"button\" class=\"ec-blockBtn--action\" disabled=\"disabled\">
{{ 'オンライン在庫なし'|trans }}
</button>
</div>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
<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-pagerRole\">
{% include \"pager.twig\" with {'pages': pagination.paginationData} %}
</div>
{% endif %}
{% endif %}
{% endblock %}", "Product/list.twig", "/home/xs501433/xs501433.xsrv.jp/public_html/app/template/default/Product/list.twig");
}
public function checkSecurity()
{
static $tags = array("set" => 13, "for" => 18, "if" => 19, "include" => 122);
static $filters = array("escape" => 19, "raw" => 19, "trans" => 54, "length" => 124, "no_image_product" => 179, "number_format" => 198);
static $functions = array("class_categories_as_json" => 19, "url" => 86, "form_widget" => 163, "asset" => 179, "form_errors" => 217, "form_rest" => 239);
try {
$this->sandbox->checkSecurity(
['set', 'for', 'if', 'include'],
['escape', 'raw', 'trans', 'length', 'no_image_product', 'number_format'],
['class_categories_as_json', 'url', 'form_widget', 'asset', 'form_errors', '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;
}
}
}