<?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_34617cf9974f309a092fa78094dbd38a3f3ec9f658d9a68fb564161bd12d4d61 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'],
];
}
protected function doGetParent(array $context)
{
// line 11
return "default_frame_product.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"));
// line 13
$context["body_class"] = "product_page";
// line 11
$this->parent = $this->loadTemplate("default_frame_product.twig", "Product/list.twig", 11);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_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"));
// line 16
echo "\t<script>
\t\teccube.productsClassCategories = {
";
// line 18
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(($context["pagination"] ?? null));
$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, twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 19), "js"), "html", null, true);
echo "\" : ";
echo $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getClassCategoriesAsJson($context["Product"]);
echo "
";
// line 20
if ((twig_get_attribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, false, 20) == false)) {
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 45
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 69
echo $this->extensions['Eccube\Twig\Extension\IgnoreRoutingNotFoundExtension']->getUrl("block_cart");
echo "', type: 'GET', dataType: 'html'}).done(function (html) {
\$('.ec-headerRole__cart').html(html);
});
}).fail(function (data) {
alert('";
// line 73
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()
});
\t</script>
";
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 89
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"));
// line 90
echo "\t";
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, ($context["search_form"] ?? null), "category_id", [], "any", false, false, false, 90), "vars", [], "any", false, false, false, 90), "errors", [], "any", false, false, false, 90)) > 0)) {
// line 91
echo "\t\t<div class=\"ec-searchnavRole\">
\t\t\t<p class=\"errormsg text-danger\">";
// line 92
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ご指定のカテゴリは存在しません"), "html", null, true);
echo "</p>
\t\t</div>
\t";
} else {
// line 95
echo "\t\t<div class=\"ec-searchnavRole\">
\t\t\t<form name=\"form1\" id=\"form1\" method=\"get\" action=\"?\">
\t\t\t\t";
// line 97
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(($context["search_form"] ?? null));
foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
// line 98
echo "\t\t\t\t\t<input type=\"hidden\" id=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["item"], "vars", [], "any", false, false, false, 98), "id", [], "any", false, false, false, 98), "html", null, true);
echo "\" name=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["item"], "vars", [], "any", false, false, false, 98), "full_name", [], "any", false, false, false, 98), "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, false, 98), "value", [], "any", false, false, false, 98))) {
echo " value=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["item"], "vars", [], "any", false, false, false, 98), "value", [], "any", false, false, false, 98), "html", null, true);
echo "\" ";
}
echo "/>
\t\t\t\t";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 100
echo "\t\t\t</form>
\t\t\t<div class=\"ec-searchnavRole__infos\">
\t\t\t\t<div class=\"ec-searchnavRole__counter\">
\t\t\t\t\t";
// line 103
if ((twig_get_attribute($this->env, $this->source, ($context["pagination"] ?? null), "totalItemCount", [], "any", false, false, false, 103) > 0)) {
// line 104
echo "\t\t\t\t\t\t";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("<span class=\"ec-font-bold\">全 %count% 件</span>", ["%count%" => twig_get_attribute($this->env, $this->source, ($context["pagination"] ?? null), "totalItemCount", [], "any", false, false, false, 104)]);
echo "
\t\t\t\t\t";
} else {
// line 106
echo "\t\t\t\t\t\t<span>";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("お探しの商品は見つかりませんでした"), "html", null, true);
echo "</span>
\t\t\t\t\t";
}
// line 108
echo "\t\t\t\t</div>
\t\t\t\t";
// line 109
if ((twig_get_attribute($this->env, $this->source, ($context["pagination"] ?? null), "totalItemCount", [], "any", false, false, false, 109) > 0)) {
// line 110
echo "\t\t\t\t\t<div class=\"ec-searchnavRole__actions\">
\t\t\t\t\t\t<div class=\"ec-select\">
\t\t\t\t\t\t\t表示件数 ";
// line 112
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, ($context["search_form"] ?? null), "disp_number", [], "any", false, false, false, 112), 'widget', ["id" => "", "attr" => ["class" => "disp-number"]]);
echo "
\t\t\t\t\t\t\t";
// line 113
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, ($context["search_form"] ?? null), "orderby", [], "any", false, false, false, 113), 'widget', ["id" => "", "attr" => ["class" => "order-by"]]);
echo "
\t\t\t\t\t\t</div>
\t\t\t\t\t</div>
\t\t\t\t";
}
// line 117
echo "\t\t\t</div>
\t\t</div>
\t\t";
// line 119
if ((twig_get_attribute($this->env, $this->source, ($context["pagination"] ?? null), "totalItemCount", [], "any", false, false, false, 119) > 0)) {
// line 120
echo "\t\t\t<div class=\"ec-shelfRole\">
\t\t\t\t<ul class=\"ec-shelfGrid\">
\t\t\t\t\t";
// line 122
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(($context["pagination"] ?? null));
$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 123
echo "\t\t\t\t\t\t<li class=\"ec-shelfGrid__item\">
\t\t\t\t\t\t\t<a href=\"";
// line 124
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\IgnoreRoutingNotFoundExtension']->getUrl("product_detail", ["id" => twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 124)]), "html", null, true);
echo "\">
\t\t\t\t\t\t\t\t<p class=\"ec-shelfGrid__item-image\">
\t\t\t\t\t\t\t\t\t<img src=\"";
// line 126
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct(twig_get_attribute($this->env, $this->source, $context["Product"], "main_list_image", [], "any", false, false, false, 126)), "save_image"), "html", null, true);
echo "\" alt=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Product"], "name", [], "any", false, false, false, 126), "html", null, true);
echo "\" ";
if ((twig_get_attribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 126) > 5)) {
echo " loading=\"lazy\" ";
}
echo ">
\t\t\t\t\t\t\t\t</p>
\t\t\t\t\t\t\t\t<p class=\"ec-shelfGrid__title\">";
// line 128
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Product"], "name", [], "any", false, false, false, 128), "html", null, true);
echo "</p>
\t\t\t\t\t\t\t\t";
// line 129
if (twig_get_attribute($this->env, $this->source, $context["Product"], "description_list", [], "any", false, false, false, 129)) {
// line 130
echo "\t\t\t\t\t\t\t\t\t<p>";
echo twig_nl2br(twig_get_attribute($this->env, $this->source, $context["Product"], "description_list", [], "any", false, false, false, 130));
echo "</p>
\t\t\t\t\t\t\t\t";
}
// line 132
echo "\t\t\t\t\t\t\t\t<p class=\"price02-default\">
\t\t\t\t\t\t\t\t\t";
// line 133
if (twig_get_attribute($this->env, $this->source, $context["Product"], "hasProductClass", [], "any", false, false, false, 133)) {
// line 134
echo "\t\t\t\t\t\t\t\t\t\t";
if ((twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02Min", [], "any", false, false, false, 134) == twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02Max", [], "any", false, false, false, 134))) {
// line 135
echo "\t\t\t\t\t\t\t\t\t\t\t";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02IncTaxMin", [], "any", false, false, false, 135)), "html", null, true);
echo "
\t\t\t\t\t\t\t\t\t\t";
} else {
// line 137
echo "\t\t\t\t\t\t\t\t\t\t\t";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02IncTaxMin", [], "any", false, false, false, 137)), "html", null, true);
echo "
\t\t\t\t\t\t\t\t\t\t\t~
\t\t\t\t\t\t\t\t\t\t\t";
// line 139
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02IncTaxMax", [], "any", false, false, false, 139)), "html", null, true);
echo "
\t\t\t\t\t\t\t\t\t\t";
}
// line 141
echo "\t\t\t\t\t\t\t\t\t";
} else {
// line 142
echo "\t\t\t\t\t\t\t\t\t\t";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02IncTaxMin", [], "any", false, false, false, 142)), "html", null, true);
echo "
\t\t\t\t\t\t\t\t\t";
}
// line 144
echo "\t\t\t\t\t\t\t\t</p>
\t\t\t\t\t\t\t</a>
\t\t\t\t\t\t\t<a href=\"";
// line 146
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\IgnoreRoutingNotFoundExtension']->getUrl("product_detail", ["id" => twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 146)]), "html", null, true);
echo "\">
\t\t\t\t\t\t\t\t<button type=\"button\" class=\"ec-shelfGrid__btn\">";
// line 147
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("詳しく見る"), "html", null, true);
echo "<i class=\"fas fa-angle-right\"></i>
\t\t\t\t\t\t\t\t</button>
\t\t\t\t\t\t\t</a>
\t\t\t\t\t\t</li>
\t\t\t\t\t";
++$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 152
echo "\t\t\t\t</ul>
\t\t\t</div>
\t\t\t<div class=\"ec-pagerRole\">
\t\t\t\t";
// line 155
$this->loadTemplate("pager.twig", "Product/list.twig", 155)->display(twig_array_merge($context, ["pages" => twig_get_attribute($this->env, $this->source, ($context["pagination"] ?? null), "paginationData", [], "any", false, false, false, 155)]));
// line 156
echo "\t\t\t</div>
\t\t";
}
// line 158
echo "\t";
}
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
public function getTemplateName()
{
return "Product/list.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 402 => 158, 398 => 156, 396 => 155, 391 => 152, 372 => 147, 368 => 146, 364 => 144, 358 => 142, 355 => 141, 350 => 139, 344 => 137, 338 => 135, 335 => 134, 333 => 133, 330 => 132, 324 => 130, 322 => 129, 318 => 128, 307 => 126, 302 => 124, 299 => 123, 282 => 122, 278 => 120, 276 => 119, 272 => 117, 265 => 113, 261 => 112, 257 => 110, 255 => 109, 252 => 108, 246 => 106, 240 => 104, 238 => 103, 233 => 100, 216 => 98, 212 => 97, 208 => 95, 202 => 92, 199 => 91, 196 => 90, 189 => 89, 167 => 73, 160 => 69, 133 => 45, 107 => 21, 91 => 20, 84 => 19, 67 => 18, 63 => 16, 56 => 15, 48 => 11, 46 => 13, 36 => 11,);
}
public function getSourceContext()
{
return new Source("", "Product/list.twig", "/home/xs767078/koyoju.shop/public_html/business/app/template/default/Product/list.twig");
}
}