<?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_79051449ded15c29287e88308e07e0ffc3c0c76b13c067dc5cf4e9c02f81edaf 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.twig";
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 13
        $context["body_class"] = "product_page";
        // line 11
        $this->parent = $this->loadTemplate("default_frame.twig", "Product/list.twig", 11);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 15
    public function block_javascript($context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 16
        echo "    <script>
        eccube.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"]);
            if ((twig_get_attribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, false, 19) == false)) {
                echo ", ";
            }
            // line 20
            echo "            ";
            ++$context['loop']['index0'];
            ++$context['loop']['index'];
            $context['loop']['first'] = false;
            if (isset($context['loop']['length'])) {
                --$context['loop']['revindex0'];
                --$context['loop']['revindex'];
                $context['loop']['last'] = 0 === $context['loop']['revindex0'];
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Product'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 21
        echo "        };

        \$(function() {

            // 表示件数を変更
            \$('.disp-number').change(function() {
                var dispNumber = \$(this).val();
                \$('#disp_number').val(dispNumber);
                \$('#pageno').val(1);
                \$(\"#form1\").submit();
            });

            // 並び順を変更
            \$('.order-by').change(function() {
                var orderBy = \$(this).val();
                \$('#orderby').val(orderBy);
                \$('#pageno').val(1);
                \$(\"#form1\").submit();
            });

            \$('.add-cart').on('click', function(e) {
                var \$form = \$(this).parents('li').find('form');

                // 個数フォームのチェック
                var \$quantity = \$form.parent().find('.quantity');
                if (\$quantity.val() < 1) {
                    \$quantity[0].setCustomValidity('";
        // line 47
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("1以上で入力してください。"), "html", null, true);
        echo "');
                    setTimeout(function() {
                        loadingOverlay('hide');
                    }, 100);
                    return true;
                } else {
                    \$quantity[0].setCustomValidity('');
                }
                e.preventDefault();
                \$.ajax({
                    url: \$form.attr('action'),
                    type: \$form.attr('method'),
                    data: \$form.serialize(),
                    dataType: 'json',
                    beforeSend: function(xhr, settings) {
                        // Buttonを無効にする
                        \$('.add-cart').prop('disabled', true);
                    }
                }).done(function(data) {
                    // レスポンス内のメッセージをalertで表示
                    \$.each(data.messages, function() {
                        \$('#ec-modal-header').html(this);
                    });

                    \$('#ec-modal-checkbox').prop('checked', true);

                    // カートブロックを更新する
                    \$.ajax({
                        url: '";
        // line 75
        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 82
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートへの追加に失敗しました。"), "html", null, true);
        echo "');
                }).always(function(data) {
                    // Buttonを有効にする
                    \$('.add-cart').prop('disabled', false);
                });
            });
        });
    </script>
";
    }

    // line 92
    public function block_main($context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 93
        echo "    ";
        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, 93), "vars", [], "any", false, false, false, 93), "errors", [], "any", false, false, false, 93)) > 0)) {
            // line 94
            echo "        <div class=\"ec-searchnavRole\">
            <p class=\"errormsg text-danger\">";
            // line 95
            echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ご指定のカテゴリは存在しません"), "html", null, true);
            echo "</p>
        </div>
    ";
        } else {
            // line 98
            echo "        ";
            // line 143
            echo "        ";
            if ((twig_get_attribute($this->env, $this->source, ($context["pagination"] ?? null), "totalItemCount", [], "any", false, false, false, 143) > 0)) {
                // line 144
                echo "            <div class=\"ec-shelfRole\">
                <ul class=\"ec-shelfGrid\">
                    ";
                // line 146
                $context["i"] = 0;
                // line 147
                echo "                    ";
                $context['_parent'] = $context;
                $context['_seq'] = twig_ensure_traversable(($context["pagination"] ?? null));
                foreach ($context['_seq'] as $context["_key"] => $context["Product"]) {
                    // line 148
                    echo "                        <li class=\"ec-shelfGrid__item\">
                            <div>
                                <a href=\"";
                    // line 150
                    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, 150)]), "html", null, true);
                    echo "\">
                                    <p class=\"ec-shelfGrid__item-image\">
                                        <img src=\"";
                    // line 152
                    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, 152)), "save_image"), "html", null, true);
                    echo "\">
                                    </p>
                                    <h2>";
                    // line 154
                    echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Product"], "name", [], "any", false, false, false, 154), "html", null, true);
                    echo "</h2>
                                    ";
                    // line 155
                    if (twig_get_attribute($this->env, $this->source, $context["Product"], "description_list", [], "any", false, false, false, 155)) {
                        // line 156
                        echo "                                        ";
                        // line 157
                        echo "                                    ";
                    }
                    // line 158
                    echo "                                    <p class=\"price02-default text_red\">
                                        ";
                    // line 159
                    if (twig_get_attribute($this->env, $this->source, $context["Product"], "hasProductClass", [], "any", false, false, false, 159)) {
                        // line 160
                        echo "                                            ";
                        if ((twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02Min", [], "any", false, false, false, 160) == twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02Max", [], "any", false, false, false, 160))) {
                            // line 161
                            echo "                                                ";
                            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, 161)), "html", null, true);
                            echo " (";
                            if ($this->extensions['Customize\Twig\Extension\CustomizeTaxExtension']->isReducedTaxProcuct(twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 161))) {
                                echo "8";
                            } else {
                                echo "10";
                            }
                            echo "%税込)
                                            ";
                        } else {
                            // line 163
                            echo "                                                ";
                            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, 163)), "html", null, true);
                            echo " ～ ";
                            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, 163)), "html", null, true);
                            echo " (";
                            if ($this->extensions['Customize\Twig\Extension\CustomizeTaxExtension']->isReducedTaxProcuct(twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 163))) {
                                echo "8";
                            } else {
                                echo "10";
                            }
                            echo "%税込)
                                            ";
                        }
                        // line 165
                        echo "                                        ";
                    } else {
                        // line 166
                        echo "                                            ";
                        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, 166)), "html", null, true);
                        echo " (";
                        if ($this->extensions['Customize\Twig\Extension\CustomizeTaxExtension']->isReducedTaxProcuct(twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 166))) {
                            echo "8";
                        } else {
                            echo "10";
                        }
                        echo "%税込)
                                        ";
                    }
                    // line 168
                    echo "                                    </p>
                                    <div class=\"ec-blockBtn--action\">商品詳細を見る</div>
                                </a>
                            </div>
";
                    // line 209
                    echo "                        </li>
                        
                        ";
                    // line 212
                    echo "                        ";
                    // line 216
                    echo "                    ";
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Product'], $context['_parent'], $context['loop']);
                $context = array_intersect_key($context, $_parent) + $_parent;
                // line 217
                echo "                </ul>
            </div>
            <div class=\"ec-modal\">
                <input type=\"checkbox\" id=\"ec-modal-checkbox\" class=\"checkbox\">
                <div class=\"ec-modal-overlay\">
                    <label for=\"ec-modal-checkbox\" class=\"ec-modal-overlay-close\"></label>
                    <div class=\"ec-modal-wrap\">
                        <label for=\"ec-modal-checkbox\" class=\"ec-modal-close\"><span class=\"ec-icon\"><img src=\"";
                // line 224
                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></label>
                        <div id=\"ec-modal-header\" class=\"text-center\">";
                // line 225
                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\">
                                <label for=\"ec-modal-checkbox\" class=\"ec-inlineBtn--cancel\">";
                // line 228
                echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("お買い物を続ける"), "html", null, true);
                echo "</label>
                                <a href=\"";
                // line 229
                echo $this->extensions['Eccube\Twig\Extension\IgnoreRoutingNotFoundExtension']->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 236
                $this->loadTemplate("pager.twig", "Product/list.twig", 236)->display(twig_array_merge($context, ["pages" => twig_get_attribute($this->env, $this->source, ($context["pagination"] ?? null), "paginationData", [], "any", false, false, false, 236)]));
                // line 237
                echo "            </div>
        ";
            }
            // line 239
            echo "    ";
        }
    }

    public function getTemplateName()
    {
        return "Product/list.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  344 => 239,  340 => 237,  338 => 236,  326 => 229,  322 => 228,  316 => 225,  312 => 224,  303 => 217,  297 => 216,  295 => 212,  291 => 209,  285 => 168,  273 => 166,  270 => 165,  256 => 163,  244 => 161,  241 => 160,  239 => 159,  236 => 158,  233 => 157,  231 => 156,  229 => 155,  225 => 154,  220 => 152,  215 => 150,  211 => 148,  206 => 147,  204 => 146,  200 => 144,  197 => 143,  195 => 98,  189 => 95,  186 => 94,  183 => 93,  179 => 92,  166 => 82,  156 => 75,  125 => 47,  97 => 21,  83 => 20,  75 => 19,  58 => 18,  54 => 16,  50 => 15,  45 => 11,  43 => 13,  36 => 11,);
    }

    public function getSourceContext()
    {
        return new Source("", "Product/list.twig", "/home/probiotech2/www/mamebio/app/template/default/Product/list.twig");
    }
}
