var/cache/dev/twig/d1/d1c1d27c80f9553288220536498f6fea.php line 54

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* __string_template__11125b70eaf62826e48221c352188b19 */
  14. class __TwigTemplate_084bb19d5be9dbeb223bf7b014db6802 extends \Eccube\Twig\Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->blocks = [
  23.             'javascript' => [$this'block_javascript'],
  24.             'main' => [$this'block_main'],
  25.         ];
  26.         $this->sandbox $this->env->getExtension('\Twig\Extension\SandboxExtension');
  27.         $this->checkSecurity();
  28.     }
  29.     protected function doGetParent(array $context)
  30.     {
  31.         // line 11
  32.         return "default_frame.twig";
  33.     }
  34.     protected function doDisplay(array $context, array $blocks = [])
  35.     {
  36.         $macros $this->macros;
  37.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  38.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""__string_template__11125b70eaf62826e48221c352188b19"));
  39.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  40.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""__string_template__11125b70eaf62826e48221c352188b19"));
  41.         // line 13
  42.         $context["body_class"] = "product_page";
  43.         // line 11
  44.         $this->parent $this->loadTemplate("default_frame.twig""__string_template__11125b70eaf62826e48221c352188b19"11);
  45.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  46.         
  47.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  48.         
  49.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  50.     }
  51.     // line 15
  52.     public function block_javascript($context, array $blocks = [])
  53.     {
  54.         $macros $this->macros;
  55.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  56.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascript"));
  57.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  58.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascript"));
  59.         // line 16
  60.         echo "    <script>
  61.         eccube.productsClassCategories = {
  62.             ";
  63.         // line 18
  64.         $context['_parent'] = $context;
  65.         $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); })()));
  66.         $context['loop'] = [
  67.           'parent' => $context['_parent'],
  68.           'index0' => 0,
  69.           'index'  => 1,
  70.           'first'  => true,
  71.         ];
  72.         if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  73.             $length count($context['_seq']);
  74.             $context['loop']['revindex0'] = $length 1;
  75.             $context['loop']['revindex'] = $length;
  76.             $context['loop']['length'] = $length;
  77.             $context['loop']['last'] = === $length;
  78.         }
  79.         foreach ($context['_seq'] as $context["_key"] => $context["Product"]) {
  80.             // line 19
  81.             echo "            \"";
  82.             echo twig_escape_filter($this->envtwig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["Product"], "id", [], "any"falsefalsetrue19), 19$this->source), "js"), "html"nulltrue);
  83.             echo "\": ";
  84.             echo $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getClassCategoriesAsJson($this->sandbox->ensureToStringAllowed($context["Product"], 19$this->source));
  85.             if ((twig_get_attribute($this->env$this->source$context["loop"], "last", [], "any"falsefalsetrue19) == false)) {
  86.                 echo ", ";
  87.             }
  88.             // line 20
  89.             echo "            ";
  90.             ++$context['loop']['index0'];
  91.             ++$context['loop']['index'];
  92.             $context['loop']['first'] = false;
  93.             if (isset($context['loop']['length'])) {
  94.                 --$context['loop']['revindex0'];
  95.                 --$context['loop']['revindex'];
  96.                 $context['loop']['last'] = === $context['loop']['revindex0'];
  97.             }
  98.         }
  99.         $_parent $context['_parent'];
  100.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Product'], $context['_parent'], $context['loop']);
  101.         $context array_intersect_key($context$_parent) + $_parent;
  102.         // line 21
  103.         echo "        };
  104.         \$(function() {
  105.             // 表示件数を変更
  106.             \$('.disp-number').change(function() {
  107.                 var dispNumber = \$(this).val();
  108.                 \$('#disp_number').val(dispNumber);
  109.                 \$('#pageno').val(1);
  110.                 \$(\"#form1\").submit();
  111.             });
  112.             // 並び順を変更
  113.             \$('.order-by').change(function() {
  114.                 var orderBy = \$(this).val();
  115.                 \$('#orderby').val(orderBy);
  116.                 \$('#pageno').val(1);
  117.                 \$(\"#form1\").submit();
  118.             });
  119.             \$('.add-cart').on('click', function(e) {
  120.                 var \$form = \$(this).parents('li').find('form');
  121.                 // ── 画像登録必須チェック ──
  122.                 var missing = false;
  123.                 \$form.find('input[type=\"hidden\"][required]').each(function() {
  124.                     if (!\$.trim(\$(this).val())) {
  125.                         alert('画像登録が必要です');
  126.                         missing = true;
  127.                         return false;  // each() を抜ける
  128.                     }
  129.                 });
  130.                 if (missing) {
  131.                     e.preventDefault();
  132.                     return false;    // AJAX 送信を止める
  133.                 }
  134.                 // 個数フォームのチェック
  135.                 var \$quantity = \$form.parent().find('.quantity');
  136.                 if (\$quantity.val() < 1) {
  137.                     \$quantity[0].setCustomValidity('";
  138.         // line 61
  139.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("1以上で入力してください。"), "html"nulltrue);
  140.         echo "');
  141.                     setTimeout(function() {
  142.                         loadingOverlay('hide');
  143.                     }, 100);
  144.                     return true;
  145.                 } else {
  146.                     \$quantity[0].setCustomValidity('');
  147.                 }
  148.                 e.preventDefault();
  149.                 \$.ajax({
  150.                     url: \$form.attr('action'),
  151.                     type: \$form.attr('method'),
  152.                     data: \$form.serialize(),
  153.                     dataType: 'json',
  154.                     beforeSend: function(xhr, settings) {
  155.                         // Buttonを無効にする
  156.                         \$('.add-cart').prop('disabled', true);
  157.                     }
  158.                 }).done(function(data) {
  159.                     // レスポンス内のメッセージをalertで表示
  160.                     \$.each(data.messages, function() {
  161.                         \$('#ec-modal-header').text(this);
  162.                     });
  163.                     \$('.ec-modal').show()
  164.                     // カートブロックを更新する
  165.                     \$.ajax({
  166.                         url: '";
  167.         // line 89
  168.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("block_cart");
  169.         echo "',
  170.                         type: 'GET',
  171.                         dataType: 'html'
  172.                     }).done(function(html) {
  173.                         \$('.ec-headerRole__cart').html(html);
  174.                     });
  175.                 }).fail(function(data) {
  176.                     alert('";
  177.         // line 96
  178.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートへの追加に失敗しました。"), "html"nulltrue);
  179.         echo "');
  180.                 }).always(function(data) {
  181.                     // Buttonを有効にする
  182.                     \$('.add-cart').prop('disabled', false);
  183.                 });
  184.             });
  185.         });
  186.         \$('.ec-modal-wrap').on('click', function(e) {
  187.             // モーダル内の処理は外側にバブリングさせない
  188.             e.stopPropagation();
  189.         });
  190.         \$('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function() {
  191.             \$('.ec-modal').hide()
  192.         });
  193.     </script>
  194. ";
  195.         
  196.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  197.         
  198.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  199.     }
  200.     // line 114
  201.     public function block_main($context, array $blocks = [])
  202.     {
  203.         $macros $this->macros;
  204.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  205.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""main"));
  206.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  207.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""main"));
  208.         // line 115
  209.         echo "    ";
  210.         if ((twig_length_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_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.'115$this->source); })()), "category_id", [], "any"falsefalsetrue115), "vars", [], "any"falsefalsetrue115), "errors", [], "any"falsefalsetrue115)) > 0)) {
  211.             // line 116
  212.             echo "        <div class=\"ec-searchnavRole\">
  213.             <p class=\"errormsg text-danger\">";
  214.             // line 117
  215.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ご指定のカテゴリは存在しません"), "html"nulltrue);
  216.             echo "</p>
  217.         </div>
  218.     ";
  219.         } else {
  220.             // line 120
  221.             echo "        <div class=\"ec-searchnavRole\">
  222.             <form name=\"form1\" id=\"form1\" method=\"get\" action=\"?\">
  223.                 ";
  224.             // line 122
  225.             $context['_parent'] = $context;
  226.             $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.'122$this->source); })()));
  227.             foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
  228.                 // line 123
  229.                 echo "                    <input type=\"hidden\" id=\"";
  230.                 echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["item"], "vars", [], "any"falsefalsetrue123), "id", [], "any"falsefalsetrue123), 123$this->source), "html"nulltrue);
  231.                 echo "\"
  232.                            name=\"";
  233.                 // line 124
  234.                 echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["item"], "vars", [], "any"falsefalsetrue124), "full_name", [], "any"falsefalsetrue124), 124$this->source), "html"nulltrue);
  235.                 echo "\"
  236.                            ";
  237.                 // line 125
  238.                 if ( !twig_test_empty(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["item"], "vars", [], "any"falsefalsetrue125), "value", [], "any"falsefalsetrue125))) {
  239.                     echo "value=\"";
  240.                     echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["item"], "vars", [], "any"falsefalsetrue125), "value", [], "any"falsefalsetrue125), 125$this->source), "html"nulltrue);
  241.                     echo "\" ";
  242.                 }
  243.                 echo "/>
  244.                 ";
  245.             }
  246.             $_parent $context['_parent'];
  247.             unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']);
  248.             $context array_intersect_key($context$_parent) + $_parent;
  249.             // line 127
  250.             echo "            </form>
  251.             <div class=\"ec-searchnavRole__topicpath\">
  252.                 <ol class=\"ec-topicpath\">
  253.                     <li class=\"ec-topicpath__item\"><a href=\"";
  254.             // line 130
  255.             echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_list");
  256.             echo "\">";
  257.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("全て"), "html"nulltrue);
  258.             echo "</a>
  259.                     </li>
  260.                     ";
  261.             // line 132
  262.             if ( !(null === (isset($context["Category"]) || array_key_exists("Category"$context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.'132$this->source); })()))) {
  263.                 // line 133
  264.                 echo "                        ";
  265.                 $context['_parent'] = $context;
  266.                 $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.'133$this->source); })()), "path", [], "any"falsefalsetrue133));
  267.                 $context['loop'] = [
  268.                   'parent' => $context['_parent'],
  269.                   'index0' => 0,
  270.                   'index'  => 1,
  271.                   'first'  => true,
  272.                 ];
  273.                 if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  274.                     $length count($context['_seq']);
  275.                     $context['loop']['revindex0'] = $length 1;
  276.                     $context['loop']['revindex'] = $length;
  277.                     $context['loop']['length'] = $length;
  278.                     $context['loop']['last'] = === $length;
  279.                 }
  280.                 foreach ($context['_seq'] as $context["_key"] => $context["Path"]) {
  281.                     // line 134
  282.                     echo "                            <li class=\"ec-topicpath__divider\">|</li>
  283.                             <li class=\"ec-topicpath__item";
  284.                     // line 135
  285.                     if (twig_get_attribute($this->env$this->source$context["loop"], "last", [], "any"falsefalsetrue135)) {
  286.                         echo "--active";
  287.                     }
  288.                     echo "\"><a
  289.                                         href=\"";
  290.                     // line 136
  291.                     echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_list");
  292.                     echo "?category_id=";
  293.                     echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["Path"], "id", [], "any"falsefalsetrue136), 136$this->source), "html"nulltrue);
  294.                     echo "\">";
  295.                     echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["Path"], "name", [], "any"falsefalsetrue136), 136$this->source), "html"nulltrue);
  296.                     echo "</a>
  297.                             </li>
  298.                         ";
  299.                     ++$context['loop']['index0'];
  300.                     ++$context['loop']['index'];
  301.                     $context['loop']['first'] = false;
  302.                     if (isset($context['loop']['length'])) {
  303.                         --$context['loop']['revindex0'];
  304.                         --$context['loop']['revindex'];
  305.                         $context['loop']['last'] = === $context['loop']['revindex0'];
  306.                     }
  307.                 }
  308.                 $_parent $context['_parent'];
  309.                 unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Path'], $context['_parent'], $context['loop']);
  310.                 $context array_intersect_key($context$_parent) + $_parent;
  311.                 // line 139
  312.                 echo "                    ";
  313.             }
  314.             // line 140
  315.             echo "                    ";
  316.             if ((twig_get_attribute($this->env$this->sourcetwig_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.'140$this->source); })()), "vars", [], "any"falsefalsetrue140), "value", [], "any"falsefalsetrue140) && twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_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.'140$this->source); })()), "vars", [], "any"falsefalsetrue140), "value", [], "any"falsefalsetrue140), "name", [], "any"falsefalsetrue140))) {
  317.                 // line 141
  318.                 echo "                        <li class=\"ec-topicpath__divider\">|</li>
  319.                         <li class=\"ec-topicpath__item\">";
  320.                 // line 142
  321.                 echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("「%name%」の検索結果", ["%name%" => twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_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.'142$this->source); })()), "vars", [], "any"falsefalsetrue142), "value", [], "any"falsefalsetrue142), "name", [], "any"falsefalsetrue142)]), "html"nulltrue);
  322.                 echo "</li>
  323.                     ";
  324.             }
  325.             // line 144
  326.             echo "                </ol>
  327.             </div>
  328.             <div class=\"ec-searchnavRole__infos\">
  329.                 <div class=\"ec-searchnavRole__counter\">
  330.                     ";
  331.             // line 148
  332.             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.'148$this->source); })()), "totalItemCount", [], "any"falsefalsetrue148) > 0)) {
  333.                 // line 149
  334.                 echo "                        ";
  335.                 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.'149$this->source); })()), "totalItemCount", [], "any"falsefalsetrue149)]);
  336.                 echo "
  337.                     ";
  338.             } else {
  339.                 // line 151
  340.                 echo "                        <span>";
  341.                 echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("お探しの商品は見つかりませんでした"), "html"nulltrue);
  342.                 echo "</span>
  343.                     ";
  344.             }
  345.             // line 153
  346.             echo "                </div>
  347.                 ";
  348.             // line 154
  349.             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"falsefalsetrue154) > 0)) {
  350.                 // line 155
  351.                 echo "                    <div class=\"ec-searchnavRole__actions\">
  352.                         <div class=\"ec-select\">
  353.                             ";
  354.                 // line 157
  355.                 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.'157$this->source); })()), "disp_number", [], "any"falsefalsetrue157), 157$this->source), 'widget', ["id" => """attr" => ["class" => "disp-number"]]);
  356.                 echo "
  357.                             ";
  358.                 // line 158
  359.                 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.'158$this->source); })()), "orderby", [], "any"falsefalsetrue158), 158$this->source), 'widget', ["id" => """attr" => ["class" => "order-by"]]);
  360.                 echo "
  361.                         </div>
  362.                     </div>
  363.                 ";
  364.             }
  365.             // line 162
  366.             echo "            </div>
  367.         </div>
  368.         ";
  369.             // line 164
  370.             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.'164$this->source); })()), "totalItemCount", [], "any"falsefalsetrue164) > 0)) {
  371.                 // line 165
  372.                 echo "            <div class=\"ec-shelfRole\">
  373.                 <ul class=\"ec-shelfGrid\">
  374.                     ";
  375.                 // line 167
  376.                 $context['_parent'] = $context;
  377.                 $context['_seq'] = twig_ensure_traversable((isset($context["pagination"]) || array_key_exists("pagination"$context) ? $context["pagination"] : (function () { throw new RuntimeError('Variable "pagination" does not exist.'167$this->source); })()));
  378.                 $context['loop'] = [
  379.                   'parent' => $context['_parent'],
  380.                   'index0' => 0,
  381.                   'index'  => 1,
  382.                   'first'  => true,
  383.                 ];
  384.                 if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  385.                     $length count($context['_seq']);
  386.                     $context['loop']['revindex0'] = $length 1;
  387.                     $context['loop']['revindex'] = $length;
  388.                     $context['loop']['length'] = $length;
  389.                     $context['loop']['last'] = === $length;
  390.                 }
  391.                 foreach ($context['_seq'] as $context["_key"] => $context["Product"]) {
  392.                     // line 168
  393.                     echo "                        <li class=\"ec-shelfGrid__item\">
  394.                             <a href=\"";
  395.                     // line 169
  396.                     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"falsefalsetrue169)]), "html"nulltrue);
  397.                     echo "\">
  398.                                 <p class=\"ec-shelfGrid__item-image\">
  399.                                     <img src=\"";
  400.                     // line 171
  401.                     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"falsefalsetrue171), 171$this->source)), "save_image"), "html"nulltrue);
  402.                     echo "\" alt=\"";
  403.                     echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["Product"], "name", [], "any"falsefalsetrue171), 171$this->source), "html"nulltrue);
  404.                     echo "\" ";
  405.                     if ((twig_get_attribute($this->env$this->source$context["loop"], "index", [], "any"falsefalsetrue171) > 5)) {
  406.                         echo " loading=\"lazy\"";
  407.                     }
  408.                     echo ">
  409.                                 </p>
  410.                                 <p>";
  411.                     // line 173
  412.                     echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["Product"], "name", [], "any"falsefalsetrue173), 173$this->source), "html"nulltrue);
  413.                     echo "</p>
  414.                                 ";
  415.                     // line 174
  416.                     if (twig_get_attribute($this->env$this->source$context["Product"], "description_list", [], "any"falsefalsetrue174)) {
  417.                         // line 175
  418.                         echo "                                    <p>";
  419.                         echo twig_nl2br($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["Product"], "description_list", [], "any"falsefalsetrue175), 175$this->source));
  420.                         echo "</p>
  421.                                 ";
  422.                     }
  423.                     // line 177
  424.                     echo "                                <p class=\"price02-default\">
  425.                                     ";
  426.                     // line 178
  427.                     if (twig_get_attribute($this->env$this->source$context["Product"], "hasProductClass", [], "any"falsefalsetrue178)) {
  428.                         // line 179
  429.                         echo "                                        ";
  430.                         if ((twig_get_attribute($this->env$this->source$context["Product"], "getPrice02Min", [], "any"falsefalsetrue179) == twig_get_attribute($this->env$this->source$context["Product"], "getPrice02Max", [], "any"falsefalsetrue179))) {
  431.                             // line 180
  432.                             echo "                                            ";
  433.                             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"falsefalsetrue180), 180$this->source)), "html"nulltrue);
  434.                             echo "
  435.                                         ";
  436.                         } else {
  437.                             // line 182
  438.                             echo "                                            ";
  439.                             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"falsefalsetrue182), 182$this->source)), "html"nulltrue);
  440.                             echo " ~ ";
  441.                             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"falsefalsetrue182), 182$this->source)), "html"nulltrue);
  442.                             echo "
  443.                                         ";
  444.                         }
  445.                         // line 184
  446.                         echo "                                    ";
  447.                     } else {
  448.                         // line 185
  449.                         echo "                                        ";
  450.                         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"falsefalsetrue185), 185$this->source)), "html"nulltrue);
  451.                         echo "
  452.                                     ";
  453.                     }
  454.                     // line 187
  455.                     echo "                                </p>
  456.                             </a>
  457.                             ";
  458.                     // line 190
  459.                     if (twig_get_attribute($this->env$this->source$context["Product"], "stock_find", [], "any"falsefalsetrue190)) {
  460.                         // line 191
  461.                         echo "                                ";
  462.                         $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.'191$this->source); })()), twig_get_attribute($this->env$this->source$context["Product"], "id", [], "any"falsefalsetrue191), [], "array"falsefalsetrue191);
  463.                         // line 192
  464.                         echo "                                <form name=\"form";
  465.                         echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["Product"], "id", [], "any"falsefalsetrue192), 192$this->source), "html"nulltrue);
  466.                         echo "\" id=\"productForm";
  467.                         echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["Product"], "id", [], "any"falsefalsetrue192), 192$this->source), "html"nulltrue);
  468.                         echo "\" action=\"";
  469.                         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"falsefalsetrue192)]), "html"nulltrue);
  470.                         echo "\" method=\"post\">
  471.                                     <div class=\"ec-productRole__actions\">
  472.                                         ";
  473.                         // line 194
  474.                         if (twig_get_attribute($this->env$this->source, ($context["form"] ?? null), "classcategory_id1", [], "any"truetruetrue194)) {
  475.                             // line 195
  476.                             echo "                                            <div class=\"ec-select\">
  477.                                                 ";
  478.                             // line 196
  479.                             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.'196$this->source); })()), "classcategory_id1", [], "any"falsefalsetrue196), 196$this->source), 'widget');
  480.                             echo "
  481.                                                 ";
  482.                             // line 197
  483.                             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.'197$this->source); })()), "classcategory_id1", [], "any"falsefalsetrue197), 197$this->source), 'errors');
  484.                             echo "
  485.                                             </div>
  486.                                             ";
  487.                             // line 199
  488.                             if (twig_get_attribute($this->env$this->source, ($context["form"] ?? null), "classcategory_id2", [], "any"truetruetrue199)) {
  489.                                 // line 200
  490.                                 echo "                                                <div class=\"ec-select\">
  491.                                                     ";
  492.                                 // line 201
  493.                                 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.'201$this->source); })()), "classcategory_id2", [], "any"falsefalsetrue201), 201$this->source), 'widget');
  494.                                 echo "
  495.                                                     ";
  496.                                 // line 202
  497.                                 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.'202$this->source); })()), "classcategory_id2", [], "any"falsefalsetrue202), 202$this->source), 'errors');
  498.                                 echo "
  499.                                                 </div>
  500.                                             ";
  501.                             }
  502.                             // line 205
  503.                             echo "                                        ";
  504.                         }
  505.                         // line 207
  506.                         echo $this->extensions['Eccube\Twig\Extension\IgnoreTwigSandboxErrorExtension']->twig_include($this->env$context"Product/option.twig", ["form" => (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'207$this->source); })())]);
  507.                         echo "
  508.                                         <div class=\"ec-numberInput\"><span>";
  509.                         // line 208
  510.                         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("数量"), "html"nulltrue);
  511.                         echo "</span>
  512.                                             ";
  513.                         // line 209
  514.                         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.'209$this->source); })()), "quantity", [], "any"falsefalsetrue209), 209$this->source), 'widget', ["attr" => ["class" => "quantity"]]);
  515.                         echo "
  516.                                             ";
  517.                         // line 210
  518.                         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.'210$this->source); })()), "quantity", [], "any"falsefalsetrue210), 210$this->source), 'errors');
  519.                         echo "
  520.                                         </div>
  521.                                     </div>
  522.                                     ";
  523.                         // line 213
  524.                         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.'213$this->source); })()), 213$this->source), 'rest');
  525.                         echo "
  526.                                 </form>
  527.                                 <div class=\"ec-productRole__btn\">
  528.                                     <button type=\"submit\" class=\"ec-blockBtn--action add-cart\" data-cartid=\"";
  529.                         // line 216
  530.                         echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["Product"], "id", [], "any"falsefalsetrue216), 216$this->source), "html"nulltrue);
  531.                         echo "\" form=\"productForm";
  532.                         echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["Product"], "id", [], "any"falsefalsetrue216), 216$this->source), "html"nulltrue);
  533.                         echo "\">
  534.                                         ";
  535.                         // line 217
  536.                         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートに入れる"), "html"nulltrue);
  537.                         echo "
  538.                                     </button>
  539.                                 </div>
  540.                             ";
  541.                     } else {
  542.                         // line 221
  543.                         echo "                                <div class=\"ec-productRole__btn\">
  544.                                     <button type=\"button\" class=\"ec-blockBtn--action\" disabled=\"disabled\">
  545.                                         ";
  546.                         // line 223
  547.                         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ただいま品切れ中です。"), "html"nulltrue);
  548.                         echo "
  549.                                     </button>
  550.                                 </div>
  551.                             ";
  552.                     }
  553.                     // line 227
  554.                     echo "                        </li>
  555.                     ";
  556.                     ++$context['loop']['index0'];
  557.                     ++$context['loop']['index'];
  558.                     $context['loop']['first'] = false;
  559.                     if (isset($context['loop']['length'])) {
  560.                         --$context['loop']['revindex0'];
  561.                         --$context['loop']['revindex'];
  562.                         $context['loop']['last'] = === $context['loop']['revindex0'];
  563.                     }
  564.                 }
  565.                 $_parent $context['_parent'];
  566.                 unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Product'], $context['_parent'], $context['loop']);
  567.                 $context array_intersect_key($context$_parent) + $_parent;
  568.                 // line 229
  569.                 echo "                </ul>
  570.             </div>
  571.             ";
  572.                 // line 231
  573.                 echo $this->extensions['Eccube\Twig\Extension\IgnoreTwigSandboxErrorExtension']->twig_include($this->env$context"Product/option_description.twig");
  574.                 echo "<div class=\"ec-modal\">
  575.                 <div class=\"ec-modal-overlay\">
  576.                     <div class=\"ec-modal-wrap\">
  577.                         <span class=\"ec-modal-close\"><span class=\"ec-icon\"><img src=\"";
  578.                 // line 234
  579.                 echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/icon/cross-dark.svg"), "html"nulltrue);
  580.                 echo "\" alt=\"\"/></span></span>
  581.                         <div id=\"ec-modal-header\" class=\"text-center\">";
  582.                 // line 235
  583.                 echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートに追加しました。"), "html"nulltrue);
  584.                 echo "</div>
  585.                         <div class=\"ec-modal-box\">
  586.                             <div class=\"ec-role\">
  587.                                 <span class=\"ec-inlineBtn--cancel\">";
  588.                 // line 238
  589.                 echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("お買い物を続ける"), "html"nulltrue);
  590.                 echo "</span>
  591.                                 <a href=\"";
  592.                 // line 239
  593.                 echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("cart");
  594.                 echo "\" class=\"ec-inlineBtn--action\">";
  595.                 echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートへ進む"), "html"nulltrue);
  596.                 echo "</a>
  597.                             </div>
  598.                         </div>
  599.                     </div>
  600.                 </div>
  601.             </div>
  602.             <div class=\"ec-pagerRole\">
  603.                 ";
  604.                 // line 246
  605.                 $this->loadTemplate("pager.twig""__string_template__11125b70eaf62826e48221c352188b19"246)->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.'246$this->source); })()), "paginationData", [], "any"falsefalsetrue246)]));
  606.                 // line 247
  607.                 echo "            </div>
  608.         ";
  609.             }
  610.             // line 249
  611.             echo "    ";
  612.         }
  613.         // line 250
  614.         echo " ";
  615.         // line 251
  616.         echo "  <div id=\"imageModal\" class=\"modal-overlay\" style=\"display:none;\">
  617.     <div class=\"modal-content\">
  618.       <button id=\"btnCancel\" type=\"button\">&times;</button>
  619.       <div class=\"modal-body\">
  620.         <section class=\"image-area\">
  621.           <canvas id=\"editCanvas\" width=\"532\" height=\"532\"></canvas>
  622.           <div class=\"confirm-area\">
  623.             <button id=\"btnConfirm\" type=\"button\">作成完了</button>
  624.           </div>
  625.         </section>
  626.         <section class=\"control-area\">
  627.           <div>
  628.             <button id=\"uploadBtn\" type=\"button\">画像アップロード</button>
  629.             <button id=\"deleteBtn\"  type=\"button\" disabled>削除</button>
  630.           </div>
  631.           <div class=\"slider-row\">
  632.             <label for=\"sizeSlider\">サイズ</label>
  633.             <input type=\"range\" id=\"sizeSlider\" min=\"0\" max=\"24\" step=\"1\" value=\"12\">
  634.           </div>
  635.           <div class=\"slider-row\">
  636.             <label for=\"rotateSlider\">回 転</label>
  637.             <input type=\"range\" id=\"rotateSlider\" min=\"0\" max=\"24\" step=\"1\" value=\"12\">
  638.           </div>
  639.         </section>
  640.         <section class=\"info-area\">
  641.           <h2>画像作成機能の使い方</h2>
  642.           <p>
  643.             まず、[画像アップロード]ボタンを押して、画像をアップロードしてください。<br>
  644.             サイズや回転を調整して自由にレイアウトしてください。<br>
  645.             ドラッグして画像の表示位置を変えることもできます。<br>
  646.             画像が完成したら[作成完了]ボタンを押して保存してください。<br>
  647.             画像を間違った時は、[削除]ボタンで削除してやり直せます。<br>
  648.             作成を中止して元の画面に戻りたいときは、[×]ボタンを押してください。
  649.           </p>
  650.         </section>
  651.       </div>
  652.     </div>
  653.   </div>
  654. ";
  655.         
  656.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  657.         
  658.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  659.     }
  660.     public function getTemplateName()
  661.     {
  662.         return "__string_template__11125b70eaf62826e48221c352188b19";
  663.     }
  664.     public function isTraitable()
  665.     {
  666.         return false;
  667.     }
  668.     public function getDebugInfo()
  669.     {
  670.         return array (  645 => 251,  643 => 250,  640 => 249,  636 => 247,  634 => 246,  622 => 239,  618 => 238,  612 => 235,  608 => 234,  602 => 231,  598 => 229,  583 => 227,  576 => 223,  572 => 221,  565 => 217,  559 => 216,  553 => 213,  547 => 210,  543 => 209,  539 => 208,  535 => 207,  532 => 205,  526 => 202,  522 => 201,  519 => 200,  517 => 199,  512 => 197,  508 => 196,  505 => 195,  503 => 194,  493 => 192,  490 => 191,  488 => 190,  483 => 187,  477 => 185,  474 => 184,  466 => 182,  460 => 180,  457 => 179,  455 => 178,  452 => 177,  446 => 175,  444 => 174,  440 => 173,  429 => 171,  424 => 169,  421 => 168,  404 => 167,  400 => 165,  398 => 164,  394 => 162,  387 => 158,  383 => 157,  379 => 155,  377 => 154,  374 => 153,  368 => 151,  362 => 149,  360 => 148,  354 => 144,  349 => 142,  346 => 141,  343 => 140,  340 => 139,  319 => 136,  313 => 135,  310 => 134,  292 => 133,  290 => 132,  283 => 130,  278 => 127,  266 => 125,  262 => 124,  257 => 123,  253 => 122,  249 => 120,  243 => 117,  240 => 116,  237 => 115,  227 => 114,  200 => 96,  190 => 89,  159 => 61,  117 => 21,  103 => 20,  95 => 19,  78 => 18,  74 => 16,  64 => 15,  53 => 11,  51 => 13,  38 => 11,);
  671.     }
  672.     public function getSourceContext()
  673.     {
  674.         return new Source("{#
  675. This file is part of EC-CUBE
  676. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  677. http://www.ec-cube.co.jp/
  678. For the full copyright and license information, please view the LICENSE
  679. file that was distributed with this source code.
  680. #}
  681. {% extends 'default_frame.twig' %}
  682. {% set body_class = 'product_page' %}
  683. {% block javascript %}
  684.     <script>
  685.         eccube.productsClassCategories = {
  686.             {% for Product in pagination %}
  687.             \"{{ Product.id|escape('js') }}\": {{ class_categories_as_json(Product)|raw }}{% if loop.last == false %}, {% endif %}
  688.             {% endfor %}
  689.         };
  690.         \$(function() {
  691.             // 表示件数を変更
  692.             \$('.disp-number').change(function() {
  693.                 var dispNumber = \$(this).val();
  694.                 \$('#disp_number').val(dispNumber);
  695.                 \$('#pageno').val(1);
  696.                 \$(\"#form1\").submit();
  697.             });
  698.             // 並び順を変更
  699.             \$('.order-by').change(function() {
  700.                 var orderBy = \$(this).val();
  701.                 \$('#orderby').val(orderBy);
  702.                 \$('#pageno').val(1);
  703.                 \$(\"#form1\").submit();
  704.             });
  705.             \$('.add-cart').on('click', function(e) {
  706.                 var \$form = \$(this).parents('li').find('form');
  707.                 // ── 画像登録必須チェック ──
  708.                 var missing = false;
  709.                 \$form.find('input[type=\"hidden\"][required]').each(function() {
  710.                     if (!\$.trim(\$(this).val())) {
  711.                         alert('画像登録が必要です');
  712.                         missing = true;
  713.                         return false;  // each() を抜ける
  714.                     }
  715.                 });
  716.                 if (missing) {
  717.                     e.preventDefault();
  718.                     return false;    // AJAX 送信を止める
  719.                 }
  720.                 // 個数フォームのチェック
  721.                 var \$quantity = \$form.parent().find('.quantity');
  722.                 if (\$quantity.val() < 1) {
  723.                     \$quantity[0].setCustomValidity('{{ '1以上で入力してください。'|trans }}');
  724.                     setTimeout(function() {
  725.                         loadingOverlay('hide');
  726.                     }, 100);
  727.                     return true;
  728.                 } else {
  729.                     \$quantity[0].setCustomValidity('');
  730.                 }
  731.                 e.preventDefault();
  732.                 \$.ajax({
  733.                     url: \$form.attr('action'),
  734.                     type: \$form.attr('method'),
  735.                     data: \$form.serialize(),
  736.                     dataType: 'json',
  737.                     beforeSend: function(xhr, settings) {
  738.                         // Buttonを無効にする
  739.                         \$('.add-cart').prop('disabled', true);
  740.                     }
  741.                 }).done(function(data) {
  742.                     // レスポンス内のメッセージをalertで表示
  743.                     \$.each(data.messages, function() {
  744.                         \$('#ec-modal-header').text(this);
  745.                     });
  746.                     \$('.ec-modal').show()
  747.                     // カートブロックを更新する
  748.                     \$.ajax({
  749.                         url: '{{ url('block_cart') }}',
  750.                         type: 'GET',
  751.                         dataType: 'html'
  752.                     }).done(function(html) {
  753.                         \$('.ec-headerRole__cart').html(html);
  754.                     });
  755.                 }).fail(function(data) {
  756.                     alert('{{ 'カートへの追加に失敗しました。'|trans }}');
  757.                 }).always(function(data) {
  758.                     // Buttonを有効にする
  759.                     \$('.add-cart').prop('disabled', false);
  760.                 });
  761.             });
  762.         });
  763.         \$('.ec-modal-wrap').on('click', function(e) {
  764.             // モーダル内の処理は外側にバブリングさせない
  765.             e.stopPropagation();
  766.         });
  767.         \$('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function() {
  768.             \$('.ec-modal').hide()
  769.         });
  770.     </script>
  771. {% endblock %}
  772. {% block main %}
  773.     {% if search_form.category_id.vars.errors|length > 0 %}
  774.         <div class=\"ec-searchnavRole\">
  775.             <p class=\"errormsg text-danger\">{{ 'ご指定のカテゴリは存在しません'|trans }}</p>
  776.         </div>
  777.     {% else %}
  778.         <div class=\"ec-searchnavRole\">
  779.             <form name=\"form1\" id=\"form1\" method=\"get\" action=\"?\">
  780.                 {% for item in search_form %}
  781.                     <input type=\"hidden\" id=\"{{ item.vars.id }}\"
  782.                            name=\"{{ item.vars.full_name }}\"
  783.                            {% if item.vars.value is not empty %}value=\"{{ item.vars.value }}\" {% endif %}/>
  784.                 {% endfor %}
  785.             </form>
  786.             <div class=\"ec-searchnavRole__topicpath\">
  787.                 <ol class=\"ec-topicpath\">
  788.                     <li class=\"ec-topicpath__item\"><a href=\"{{ url('product_list') }}\">{{ '全て'|trans }}</a>
  789.                     </li>
  790.                     {% if Category is not null %}
  791.                         {% for Path in Category.path %}
  792.                             <li class=\"ec-topicpath__divider\">|</li>
  793.                             <li class=\"ec-topicpath__item{% if loop.last %}--active{% endif %}\"><a
  794.                                         href=\"{{ url('product_list') }}?category_id={{ Path.id }}\">{{ Path.name }}</a>
  795.                             </li>
  796.                         {% endfor %}
  797.                     {% endif %}
  798.                     {% if search_form.vars.value and search_form.vars.value.name %}
  799.                         <li class=\"ec-topicpath__divider\">|</li>
  800.                         <li class=\"ec-topicpath__item\">{{ '「%name%」の検索結果'|trans({ '%name%': search_form.vars.value.name }) }}</li>
  801.                     {% endif %}
  802.                 </ol>
  803.             </div>
  804.             <div class=\"ec-searchnavRole__infos\">
  805.                 <div class=\"ec-searchnavRole__counter\">
  806.                     {% if pagination.totalItemCount > 0 %}
  807.                         {{ '<span class=\"ec-font-bold\">%count%件</span><span>の商品が見つかりました</span>'|trans({ '%count%': pagination.totalItemCount })|raw }}
  808.                     {% else %}
  809.                         <span>{{ 'お探しの商品は見つかりませんでした'|trans }}</span>
  810.                     {% endif %}
  811.                 </div>
  812.                 {% if pagination.totalItemCount > 0 %}
  813.                     <div class=\"ec-searchnavRole__actions\">
  814.                         <div class=\"ec-select\">
  815.                             {{ form_widget(search_form.disp_number, {'id': '', 'attr': {'class': 'disp-number'}}) }}
  816.                             {{ form_widget(search_form.orderby, {'id': '', 'attr': {'class': 'order-by'}}) }}
  817.                         </div>
  818.                     </div>
  819.                 {% endif %}
  820.             </div>
  821.         </div>
  822.         {% if pagination.totalItemCount > 0 %}
  823.             <div class=\"ec-shelfRole\">
  824.                 <ul class=\"ec-shelfGrid\">
  825.                     {% for Product in pagination %}
  826.                         <li class=\"ec-shelfGrid__item\">
  827.                             <a href=\"{{ url('product_detail', {'id': Product.id}) }}\">
  828.                                 <p class=\"ec-shelfGrid__item-image\">
  829.                                     <img src=\"{{ asset(Product.main_list_image|no_image_product, 'save_image') }}\" alt=\"{{ Product.name }}\" {% if loop.index > 5 %} loading=\"lazy\"{% endif %}>
  830.                                 </p>
  831.                                 <p>{{ Product.name }}</p>
  832.                                 {% if Product.description_list %}
  833.                                     <p>{{ Product.description_list|raw|nl2br }}</p>
  834.                                 {% endif %}
  835.                                 <p class=\"price02-default\">
  836.                                     {% if Product.hasProductClass %}
  837.                                         {% if Product.getPrice02Min == Product.getPrice02Max %}
  838.                                             {{ Product.getPrice02IncTaxMin|price }}
  839.                                         {% else %}
  840.                                             {{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}
  841.                                         {% endif %}
  842.                                     {% else %}
  843.                                         {{ Product.getPrice02IncTaxMin|price }}
  844.                                     {% endif %}
  845.                                 </p>
  846.                             </a>
  847.                             {% if Product.stock_find %}
  848.                                 {% set form = forms[Product.id] %}
  849.                                 <form name=\"form{{ Product.id }}\" id=\"productForm{{ Product.id }}\" action=\"{{ url('product_add_cart', {id:Product.id}) }}\" method=\"post\">
  850.                                     <div class=\"ec-productRole__actions\">
  851.                                         {% if form.classcategory_id1 is defined %}
  852.                                             <div class=\"ec-select\">
  853.                                                 {{ form_widget(form.classcategory_id1) }}
  854.                                                 {{ form_errors(form.classcategory_id1) }}
  855.                                             </div>
  856.                                             {% if form.classcategory_id2 is defined %}
  857.                                                 <div class=\"ec-select\">
  858.                                                     {{ form_widget(form.classcategory_id2) }}
  859.                                                     {{ form_errors(form.classcategory_id2) }}
  860.                                                 </div>
  861.                                             {% endif %}
  862.                                         {% endif %}
  863. {# オプション描画はここだけ #}
  864. {{ include('Product/option.twig', { form: form }) }}
  865.                                         <div class=\"ec-numberInput\"><span>{{ '数量'|trans }}</span>
  866.                                             {{ form_widget(form.quantity, {'attr': {'class': 'quantity'}}) }}
  867.                                             {{ form_errors(form.quantity) }}
  868.                                         </div>
  869.                                     </div>
  870.                                     {{ form_rest(form) }}
  871.                                 </form>
  872.                                 <div class=\"ec-productRole__btn\">
  873.                                     <button type=\"submit\" class=\"ec-blockBtn--action add-cart\" data-cartid=\"{{ Product.id }}\" form=\"productForm{{ Product.id }}\">
  874.                                         {{ 'カートに入れる'|trans }}
  875.                                     </button>
  876.                                 </div>
  877.                             {% else %}
  878.                                 <div class=\"ec-productRole__btn\">
  879.                                     <button type=\"button\" class=\"ec-blockBtn--action\" disabled=\"disabled\">
  880.                                         {{ 'ただいま品切れ中です。'|trans }}
  881.                                     </button>
  882.                                 </div>
  883.                             {% endif %}
  884.                         </li>
  885.                     {% endfor %}
  886.                 </ul>
  887.             </div>
  888.             {{ include('Product/option_description.twig') }}<div class=\"ec-modal\">
  889.                 <div class=\"ec-modal-overlay\">
  890.                     <div class=\"ec-modal-wrap\">
  891.                         <span class=\"ec-modal-close\"><span class=\"ec-icon\"><img src=\"{{ asset('assets/icon/cross-dark.svg') }}\" alt=\"\"/></span></span>
  892.                         <div id=\"ec-modal-header\" class=\"text-center\">{{ 'カートに追加しました。'|trans }}</div>
  893.                         <div class=\"ec-modal-box\">
  894.                             <div class=\"ec-role\">
  895.                                 <span class=\"ec-inlineBtn--cancel\">{{ 'お買い物を続ける'|trans }}</span>
  896.                                 <a href=\"{{ url('cart') }}\" class=\"ec-inlineBtn--action\">{{ 'カートへ進む'|trans }}</a>
  897.                             </div>
  898.                         </div>
  899.                     </div>
  900.                 </div>
  901.             </div>
  902.             <div class=\"ec-pagerRole\">
  903.                 {% include \"pager.twig\" with {'pages': pagination.paginationData} %}
  904.             </div>
  905.         {% endif %}
  906.     {% endif %}
  907.  {# ─── ここから「画像登録」用モーダルを1回だけ埋め込む ─── #}
  908.   <div id=\"imageModal\" class=\"modal-overlay\" style=\"display:none;\">
  909.     <div class=\"modal-content\">
  910.       <button id=\"btnCancel\" type=\"button\">&times;</button>
  911.       <div class=\"modal-body\">
  912.         <section class=\"image-area\">
  913.           <canvas id=\"editCanvas\" width=\"532\" height=\"532\"></canvas>
  914.           <div class=\"confirm-area\">
  915.             <button id=\"btnConfirm\" type=\"button\">作成完了</button>
  916.           </div>
  917.         </section>
  918.         <section class=\"control-area\">
  919.           <div>
  920.             <button id=\"uploadBtn\" type=\"button\">画像アップロード</button>
  921.             <button id=\"deleteBtn\"  type=\"button\" disabled>削除</button>
  922.           </div>
  923.           <div class=\"slider-row\">
  924.             <label for=\"sizeSlider\">サイズ</label>
  925.             <input type=\"range\" id=\"sizeSlider\" min=\"0\" max=\"24\" step=\"1\" value=\"12\">
  926.           </div>
  927.           <div class=\"slider-row\">
  928.             <label for=\"rotateSlider\">回 転</label>
  929.             <input type=\"range\" id=\"rotateSlider\" min=\"0\" max=\"24\" step=\"1\" value=\"12\">
  930.           </div>
  931.         </section>
  932.         <section class=\"info-area\">
  933.           <h2>画像作成機能の使い方</h2>
  934.           <p>
  935.             まず、[画像アップロード]ボタンを押して、画像をアップロードしてください。<br>
  936.             サイズや回転を調整して自由にレイアウトしてください。<br>
  937.             ドラッグして画像の表示位置を変えることもできます。<br>
  938.             画像が完成したら[作成完了]ボタンを押して保存してください。<br>
  939.             画像を間違った時は、[削除]ボタンで削除してやり直せます。<br>
  940.             作成を中止して元の画面に戻りたいときは、[×]ボタンを押してください。
  941.           </p>
  942.         </section>
  943.       </div>
  944.     </div>
  945.   </div>
  946. {% endblock %}
  947. ""__string_template__11125b70eaf62826e48221c352188b19""");
  948.     }
  949.     
  950.     public function checkSecurity()
  951.     {
  952.         static $tags = array("set" => 13"for" => 18"if" => 19"include" => 246);
  953.         static $filters = array("escape" => 19"raw" => 19"trans" => 61"length" => 115"no_image_product" => 171"nl2br" => 175"price" => 180);
  954.         static $functions = array("class_categories_as_json" => 19"url" => 89"form_widget" => 157"asset" => 171"form_errors" => 197"include" => 207"form_rest" => 213);
  955.         try {
  956.             $this->sandbox->checkSecurity(
  957.                 ['set''for''if''include'],
  958.                 ['escape''raw''trans''length''no_image_product''nl2br''price'],
  959.                 ['class_categories_as_json''url''form_widget''asset''form_errors''include''form_rest']
  960.             );
  961.         } catch (SecurityError $e) {
  962.             $e->setSourceContext($this->source);
  963.             if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
  964.                 $e->setTemplateLine($tags[$e->getTagName()]);
  965.             } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
  966.                 $e->setTemplateLine($filters[$e->getFilterName()]);
  967.             } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
  968.                 $e->setTemplateLine($functions[$e->getFunctionName()]);
  969.             }
  970.             throw $e;
  971.         }
  972.     }
  973. }