<?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;
/* @SDream/Product/list.twig */
class __TwigTemplate_4eaa23340cc35470523cf0741a003365 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;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@SDream/Product/list.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@SDream/Product/list.twig"));
// line 13
$context["body_class"] = "product_page";
// line 11
$this->parent = $this->loadTemplate("default_frame.twig", "@SDream/Product/list.twig", 11);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 15
public function block_javascript($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascript"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascript"));
// line 16
echo " <script>
eccube.productsClassCategories = {
";
// line 18
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["pagination"]) || array_key_exists("pagination", $context) ? $context["pagination"] : (function () { throw new RuntimeError('Variable "pagination" does not exist.', 18, $this->source); })()));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["Product"]) {
// line 19
echo " \"";
echo twig_escape_filter($this->env, twig_escape_filter($this->env, 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').text(this);
});
\$('.ec-modal').show()
// カートブロックを更新する
\$.ajax({
url: '";
// line 75
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("block_cart");
echo "',
type: 'GET',
dataType: 'html'
}).done(function(html) {
\$('.ec-headerRole__cart').html(html);
});
}).fail(function(data) {
alert('";
// line 82
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートへの追加に失敗しました。"), "html", null, true);
echo "');
}).always(function(data) {
// Buttonを有効にする
\$('.add-cart').prop('disabled', false);
});
});
});
\$('.ec-modal-wrap').on('click', function(e) {
// モーダル内の処理は外側にバブリングさせない
e.stopPropagation();
});
\$('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function() {
\$('.ec-modal').hide()
});
</script>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 100
public function block_main($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "main"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "main"));
// line 101
echo "
";
// line 102
$context["current_category"] = null;
// line 103
echo "
";
// line 152
echo "
";
// line 153
if ((twig_length_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["search_form"]) || array_key_exists("search_form", $context) ? $context["search_form"] : (function () { throw new RuntimeError('Variable "search_form" does not exist.', 153, $this->source); })()), "category_id", [], "any", false, false, false, 153), "vars", [], "any", false, false, false, 153), "errors", [], "any", false, false, false, 153)) > 0)) {
// line 154
echo " <div class=\"ec-searchnavRole\">
<p class=\"errormsg text-danger\">";
// line 155
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ご指定のカテゴリは存在しません"), "html", null, true);
echo "</p>
</div>
";
} else {
// line 158
echo " <div class=\"ec-searchnavRole\">
<form name=\"form1\" id=\"form1\" method=\"get\" action=\"?\">
";
// line 160
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["search_form"]) || array_key_exists("search_form", $context) ? $context["search_form"] : (function () { throw new RuntimeError('Variable "search_form" does not exist.', 160, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
// line 161
echo " <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, 161), "id", [], "any", false, false, false, 161), "html", null, true);
echo "\"
name=\"";
// line 162
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, 162), "full_name", [], "any", false, false, false, 162), "html", null, true);
echo "\"
";
// line 163
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, 163), "value", [], "any", false, false, false, 163))) {
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, 163), "value", [], "any", false, false, false, 163), "html", null, true);
echo "\" ";
}
echo "/>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 165
echo " </form>
<div class=\"catimgself\">
";
// line 168
if (( !twig_test_empty((isset($context["CategorySelf"]) || array_key_exists("CategorySelf", $context) ? $context["CategorySelf"] : (function () { throw new RuntimeError('Variable "CategorySelf" does not exist.', 168, $this->source); })())) && !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["CategorySelf"]) || array_key_exists("CategorySelf", $context) ? $context["CategorySelf"] : (function () { throw new RuntimeError('Variable "CategorySelf" does not exist.', 168, $this->source); })()), "category_picfilename", [], "any", false, false, false, 168)))) {
// line 169
echo " <img src=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(twig_get_attribute($this->env, $this->source, (isset($context["CategorySelf"]) || array_key_exists("CategorySelf", $context) ? $context["CategorySelf"] : (function () { throw new RuntimeError('Variable "CategorySelf" does not exist.', 169, $this->source); })()), "category_picfilename", [], "any", false, false, false, 169)), "html", null, true);
echo "\" alt=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["CategorySelf"]) || array_key_exists("CategorySelf", $context) ? $context["CategorySelf"] : (function () { throw new RuntimeError('Variable "CategorySelf" does not exist.', 169, $this->source); })()), "category_picalt", [], "any", false, false, false, 169), "html", null, true);
echo "\" />
";
}
// line 171
echo " <div class=\"catimgchild-container\">
";
// line 172
if ( !twig_test_empty((isset($context["CategoryList"]) || array_key_exists("CategoryList", $context) ? $context["CategoryList"] : (function () { throw new RuntimeError('Variable "CategoryList" does not exist.', 172, $this->source); })()))) {
// line 173
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["CategoryList"]) || array_key_exists("CategoryList", $context) ? $context["CategoryList"] : (function () { throw new RuntimeError('Variable "CategoryList" does not exist.', 173, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["cat"]) {
// line 174
echo " ";
if ((( !twig_test_empty($context["cat"]) && !twig_test_empty(twig_get_attribute($this->env, $this->source, $context["cat"], "category_minipicfilename", [], "any", false, false, false, 174))) && (twig_test_empty(twig_get_attribute($this->env, $this->source, $context["cat"], "category_enable", [], "any", false, false, false, 174)) || (twig_get_attribute($this->env, $this->source, $context["cat"], "category_enable", [], "any", false, false, false, 174) != "1")))) {
// line 175
echo " <div class=\"catimgchild\">
<a href=\"";
// line 176
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_list");
echo "?category_id=";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cat"], "id", [], "any", false, false, false, 176), "html", null, true);
echo "\">
<img src=\"";
// line 177
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(twig_get_attribute($this->env, $this->source, $context["cat"], "category_minipicfilename", [], "any", false, false, false, 177)), "html", null, true);
echo "\" alt=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cat"], "category_picalt", [], "any", false, false, false, 177), "html", null, true);
echo "\" />
</a>
</div>
";
}
// line 181
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['cat'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 182
echo " ";
}
// line 183
echo " </div>
</div>
<style>
.catimgself {
display: flex;
flex-direction: column;
align-items: center;
}
.catimgself img {
max-width: 100%;
height: auto;
}
.catimgchild-container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin: 0; /* 親コンテナのマージンをリセット */
}
.catimgchild {
flex: 1 0 33.33%; /* 子要素を3列に分けるために幅を調整 */
max-width: 33.33%; /* 子要素の最大幅を設定 */
text-align: center;
margin: 0; /* 子要素間の間隔をなくす */
box-sizing: border-box; /* パディングとボーダーを含めて要素のサイズを計算 */
}
.catimgchild img {
width: 100%;
height: auto;
}
</style>
";
// line 275
echo "
<div class=\"ec-searchnavRole__topicpath\">
<ol class=\"ec-topicpath\">
<li class=\"ec-topicpath__item\"><a href=\"";
// line 278
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_list");
echo "\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("全て"), "html", null, true);
echo "</a>
</li>
";
// line 280
if ( !(null === (isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 280, $this->source); })()))) {
// line 281
echo "
";
// line 282
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 282, $this->source); })()), "path", [], "any", false, false, false, 282));
$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["Path"]) {
// line 283
echo " <li class=\"ec-topicpath__divider\">|</li>
<li class=\"ec-topicpath__item";
// line 286
if (twig_get_attribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, false, 286)) {
echo "--active";
}
echo "\">
<a href=\"";
// line 287
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_list");
echo "?category_id=";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Path"], "id", [], "any", false, false, false, 287), "html", null, true);
echo "\">";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Path"], "name", [], "any", false, false, false, 287), "html", null, true);
echo "</a>
";
// line 289
if ((twig_get_attribute($this->env, $this->source, $context["Path"], "name", [], "any", false, false, false, 289) == "産地で選ぶ")) {
// line 290
echo " |<a href=\"/products/list?category_id=76\">北海道</a>
|<a href=\"/products/list?category_id=77\">東北</a>
|<a href=\"/products/list?category_id=78\">関東</a>
|<a href=\"/products/list?category_id=79\">信越</a>
|<a href=\"/products/list?category_id=81\">北陸</a>
|<a href=\"/products/list?category_id=80\">中部</a>
|<a href=\"/products/list?category_id=83\">西日本</a>
|<a href=\"/products/list?category_id=86\">国内</a>
";
} elseif ((twig_get_attribute($this->env, $this->source, // line 298
$context["Path"], "name", [], "any", false, false, false, 298) == "銘柄で選ぶ")) {
// line 299
echo " |<a href=\"/products/list?category_id=66\">コシヒカリ</a>
|<a href=\"/products/list?category_id=67\">ひとめぼれ</a>
|<a href=\"/products/list?category_id=68\">あきたこまち</a>
|<a href=\"/products/list?category_id=69\">各他の銘柄</a>
|<a href=\"/products/list?category_id=70\">逸品米</a>
|<a href=\"/products/list?category_id=71\">無洗米</a>
";
} elseif ((twig_get_attribute($this->env, $this->source, // line 305
$context["Path"], "name", [], "any", false, false, false, 305) == "価格帯で選ぶ")) {
// line 306
echo " |<a href=\"/products/list?category_id=41\">299円以下</a>
|<a href=\"/products/list?category_id=42\">239円以下</a>
|<a href=\"/products/list?category_id=43\">329円以上</a>
";
} elseif ((twig_get_attribute($this->env, $this->source, // line 309
$context["Path"], "name", [], "any", false, false, false, 309) == "粒サイズで選ぶ")) {
// line 310
echo " |<a href=\"/products/list?category_id=58\">通常</a>
|<a href=\"/products/list?category_id=59\">やや小粒</a>
|<a href=\"/products/list?category_id=60\">ブレンド</a>
";
} elseif ((twig_get_attribute($this->env, $this->source, // line 313
$context["Path"], "name", [], "any", false, false, false, 313) == "ロットサイズで選ぶ")) {
// line 314
echo " |<a href=\"/products/list?category_id=49\">小ロット</a>
<a href=\"/products/list?category_id=50\">業務用</a>
|<a href=\"/products/list?category_id=51\">大口割引</a>
|<a href=\"/products/list?category_id=52\">激安</a>
";
} elseif ((twig_get_attribute($this->env, $this->source, // line 318
$context["Path"], "name", [], "any", false, false, false, 318) == "精米方法で選ぶ")) {
// line 319
echo " |<a href=\"/products/list?category_id=116\">上白精米</a>
|<a href=\"/products/list?category_id=117\">精白米</a>
|<a href=\"/products/list?category_id=118\">玄米</a>
";
}
// line 323
echo "
</li>
";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Path'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 326
echo " ";
}
// line 327
echo " ";
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["search_form"]) || array_key_exists("search_form", $context) ? $context["search_form"] : (function () { throw new RuntimeError('Variable "search_form" does not exist.', 327, $this->source); })()), "vars", [], "any", false, false, false, 327), "value", [], "any", false, false, false, 327) && twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["search_form"]) || array_key_exists("search_form", $context) ? $context["search_form"] : (function () { throw new RuntimeError('Variable "search_form" does not exist.', 327, $this->source); })()), "vars", [], "any", false, false, false, 327), "value", [], "any", false, false, false, 327), "name", [], "any", false, false, false, 327))) {
// line 328
echo " <li class=\"ec-topicpath__divider\">|</li>
<li class=\"ec-topicpath__item\">";
// line 329
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("「%name%」の検索結果", ["%name%" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["search_form"]) || array_key_exists("search_form", $context) ? $context["search_form"] : (function () { throw new RuntimeError('Variable "search_form" does not exist.', 329, $this->source); })()), "vars", [], "any", false, false, false, 329), "value", [], "any", false, false, false, 329), "name", [], "any", false, false, false, 329)]), "html", null, true);
echo "</li>
";
}
// line 331
echo " </ol>
</div>
<div class=\"ec-searchnavRole__infos\">
<div class=\"ec-searchnavRole__counter\">
";
// line 335
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.', 335, $this->source); })()), "totalItemCount", [], "any", false, false, false, 335) > 0)) {
// line 336
echo " ";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("<span class=\"ec-font-bold\">%count%件</span><span>の商品が見つかりました</span>", ["%count%" => twig_get_attribute($this->env, $this->source, (isset($context["pagination"]) || array_key_exists("pagination", $context) ? $context["pagination"] : (function () { throw new RuntimeError('Variable "pagination" does not exist.', 336, $this->source); })()), "totalItemCount", [], "any", false, false, false, 336)]);
echo "
";
} else {
// line 338
echo " <span>";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("お探しの商品は見つかりませんでした"), "html", null, true);
echo "</span>
";
}
// line 340
echo " </div>
";
// line 341
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.', 341, $this->source); })()), "totalItemCount", [], "any", false, false, false, 341) > 0)) {
// line 342
echo " <div class=\"ec-searchnavRole__actions\">
<div class=\"ec-select\">
";
// line 344
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(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.', 344, $this->source); })()), "disp_number", [], "any", false, false, false, 344), 'widget', ["id" => "", "attr" => ["class" => "disp-number"]]);
echo "
";
// line 345
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(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.', 345, $this->source); })()), "orderby", [], "any", false, false, false, 345), 'widget', ["id" => "", "attr" => ["class" => "order-by"]]);
echo "
</div>
</div>
";
}
// line 349
echo " </div>
</div>
<div id=\"flash-area\"></div>
";
// line 352
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.', 352, $this->source); })()), "totalItemCount", [], "any", false, false, false, 352) > 0)) {
// line 353
echo " <div class=\"ec-shelfRole\">
<ul class=\"ec-shelfGrid\">
";
// line 355
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["pagination"]) || array_key_exists("pagination", $context) ? $context["pagination"] : (function () { throw new RuntimeError('Variable "pagination" does not exist.', 355, $this->source); })()));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["Product"]) {
echo "
";
// line 356
if ((twig_get_attribute($this->env, $this->source, $context["Product"], "limited_ids", [], "any", false, false, false, 356) == "")) {
// line 357
echo " <li class=\"ec-shelfGrid__item\">
<a href=\"";
// line 358
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_detail", ["id" => twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 358)]), "html", null, true);
echo "\">
<p class=\"ec-shelfGrid__item-image\">
";
// line 361
if ((twig_get_attribute($this->env, $this->source, (isset($context["eccube_config"]) || array_key_exists("eccube_config", $context) ? $context["eccube_config"] : (function () { throw new RuntimeError('Variable "eccube_config" does not exist.', 361, $this->source); })()), "app_mode", [], "any", false, false, false, 361) != "display")) {
// line 362
echo " ";
$context["image_url"] = $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(twig_get_attribute($this->env, $this->source, $context["Product"], "main_list_image", [], "any", false, false, false, 362), "save_image");
} elseif (twig_get_attribute($this->env, $this->source, // line 363
$context["Product"], "mainDisplayImage", [], "any", false, false, false, 363)) {
// line 364
echo " ";
$context["image_url"] = (twig_get_attribute($this->env, $this->source, (isset($context["eccube_config"]) || array_key_exists("eccube_config", $context) ? $context["eccube_config"] : (function () { throw new RuntimeError('Variable "eccube_config" does not exist.', 364, $this->source); })()), "img_folder", [], "any", false, false, false, 364) . twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["Product"], "mainDisplayImage", [], "any", false, false, false, 364), "fileName", [], "any", false, false, false, 364));
}
// line 366
echo "
";
// line 367
if (array_key_exists("image_url", $context)) {
// line 368
echo " <img src=\"";
echo twig_escape_filter($this->env, (isset($context["image_url"]) || array_key_exists("image_url", $context) ? $context["image_url"] : (function () { throw new RuntimeError('Variable "image_url" does not exist.', 368, $this->source); })()), "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, 368), "html", null, true);
echo "\" ";
if ((twig_get_attribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 368) > 5)) {
echo "loading=\"lazy\"";
}
echo ">
";
} else {
// line 370
echo " <div class=\"ec-shelfGrid__item-noimage\">
★画像準備中
</div>
";
}
// line 375
echo " </p>
<p>";
// line 376
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Product"], "name", [], "any", false, false, false, 376), "html", null, true);
echo "</p>
";
// line 377
if (twig_get_attribute($this->env, $this->source, $context["Product"], "description_list", [], "any", false, false, false, 377)) {
// line 378
echo " <p>";
echo twig_nl2br(twig_get_attribute($this->env, $this->source, $context["Product"], "description_list", [], "any", false, false, false, 378));
echo "</p>
";
}
// line 380
echo " <p class=\"price02-default\">
";
// line 382
if ((twig_get_attribute($this->env, $this->source, (isset($context["eccube_config"]) || array_key_exists("eccube_config", $context) ? $context["eccube_config"] : (function () { throw new RuntimeError('Variable "eccube_config" does not exist.', 382, $this->source); })()), "app_mode", [], "any", false, false, false, 382) != "display")) {
// line 383
echo " ";
if (twig_get_attribute($this->env, $this->source, $context["Product"], "hasProductClass", [], "any", false, false, false, 383)) {
// line 384
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02IncTaxMin", [], "any", false, false, false, 384) == twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02IncTaxMax", [], "any", false, false, false, 384))) {
// line 385
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, 385)), "html", null, true);
echo "
";
} else {
// line 387
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, 387)), "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, 387)), "html", null, true);
echo "
";
}
// line 389
echo " ";
} else {
// line 390
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, 390)), "html", null, true);
echo "
";
}
} else {
// line 394
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["Product"], "getPriceSellerInTaxMin", [], "any", false, false, false, 394) == twig_get_attribute($this->env, $this->source, $context["Product"], "getPriceSellerInTaxMax", [], "any", false, false, false, 394))) {
// line 395
echo " ";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, $context["Product"], "getPriceSellerInTaxMin", [], "any", false, false, false, 395)), "html", null, true);
echo "
";
} else {
// line 397
echo " ";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, $context["Product"], "getPriceSellerInTaxMin", [], "any", false, false, false, 397)), "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"], "getPriceSellerInTaxMax", [], "any", false, false, false, 397)), "html", null, true);
echo "
";
}
// line 399
echo "
";
}
// line 401
echo " </p>
</a>
";
// line 404
if ((twig_get_attribute($this->env, $this->source, (isset($context["eccube_config"]) || array_key_exists("eccube_config", $context) ? $context["eccube_config"] : (function () { throw new RuntimeError('Variable "eccube_config" does not exist.', 404, $this->source); })()), "app_mode", [], "any", false, false, false, 404) != "display")) {
// line 405
echo " ";
if (twig_get_attribute($this->env, $this->source, $context["Product"], "stock_find", [], "any", false, false, false, 405)) {
// line 406
echo "
";
// line 407
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, $context["Product"], "locked_ids", [], "any", false, false, false, 407))) {
echo "
<br>
<button type=\"button\" class=\"ec-blockBtn--action add-cart\" data-cartid=\"";
// line 409
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 409), "html", null, true);
echo "\" onclick=\"submitFormAndRedirect('";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 409), "html", null, true);
echo "', '";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_detail", ["id" => twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 409)]), "html", null, true);
echo "')\">
";
// line 410
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("詳細表示"), "html", null, true);
echo "
</button>
";
} else {
// line 414
echo " ";
$context["form"] = twig_get_attribute($this->env, $this->source, (isset($context["forms"]) || array_key_exists("forms", $context) ? $context["forms"] : (function () { throw new RuntimeError('Variable "forms" does not exist.', 414, $this->source); })()), twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 414), [], "array", false, false, false, 414);
// line 415
echo " <form name=\"form";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 415), "html", null, true);
echo "\" id=\"productForm";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 415), "html", null, true);
echo "\" action=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_add_cart", ["id" => twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 415)]), "html", null, true);
echo "\" method=\"post\">
<div class=\"ec-productRole__actions\">
";
// line 417
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id1", [], "any", true, true, false, 417)) {
// line 418
echo " <div class=\"ec-select\">
";
// line 419
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(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.', 419, $this->source); })()), "classcategory_id1", [], "any", false, false, false, 419), 'widget');
echo "
";
// line 420
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(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.', 420, $this->source); })()), "classcategory_id1", [], "any", false, false, false, 420), 'errors');
echo "
</div>
";
// line 422
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id2", [], "any", true, true, false, 422)) {
// line 423
echo " <div class=\"ec-select\">
";
// line 424
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(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.', 424, $this->source); })()), "classcategory_id2", [], "any", false, false, false, 424), 'widget');
echo "
";
// line 425
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(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.', 425, $this->source); })()), "classcategory_id2", [], "any", false, false, false, 425), 'errors');
echo "
</div>
";
}
// line 428
echo " ";
}
// line 429
echo " <div class=\"ec-numberInput\"><span>";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("数量"), "html", null, true);
echo "</span>
";
// line 430
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(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.', 430, $this->source); })()), "quantity", [], "any", false, false, false, 430), 'widget', ["attr" => ["class" => "quantity"]]);
echo "
";
// line 431
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(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.', 431, $this->source); })()), "quantity", [], "any", false, false, false, 431), 'errors');
echo "
</div>
</div>
";
// line 434
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 434, $this->source); })()), 'rest');
echo "
</form>
<div class=\"ec-productRole__btn\">
<button type=\"submit\" class=\"ec-blockBtn--action add-cart\" data-cartid=\"";
// line 438
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 438), "html", null, true);
echo "\" form=\"productForm";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 438), "html", null, true);
echo "\">
";
// line 439
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートに入れる"), "html", null, true);
echo "
</button>
</div>
";
}
// line 445
echo " ";
} else {
// line 446
echo " <div class=\"ec-productRole__btn\">
<button type=\"button\" class=\"ec-blockBtn--action\" disabled=\"disabled\">
";
// line 448
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ただいま品切れ中です。"), "html", null, true);
echo "
</button>
</div>
";
}
}
// line 454
echo " </li>
";
}
// line 456
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 457
echo " </ul>
</div>
<div class=\"ec-modal\">
<div class=\"ec-modal-overlay\">
<div class=\"ec-modal-wrap\">
<span class=\"ec-modal-close\"><span class=\"ec-icon\"><img src=\"";
// line 462
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/icon/cross-dark.svg"), "html", null, true);
echo "\" alt=\"\"/></span></span>
<div id=\"ec-modal-header\" class=\"text-center\">";
// line 463
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートに追加しました。"), "html", null, true);
echo "</div>
<div class=\"ec-modal-box\">
<div class=\"ec-role\">
<span class=\"ec-inlineBtn--cancel\">";
// line 466
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("お買い物を続ける"), "html", null, true);
echo "</span>
<a href=\"";
// line 467
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("cart");
echo "\" class=\"ec-inlineBtn--action\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートへ進む"), "html", null, true);
echo "</a>
</div>
</div>
</div>
</div>
</div>
<div class=\"ec-pagerRole\">
";
// line 474
$this->loadTemplate("pager.twig", "@SDream/Product/list.twig", 474)->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.', 474, $this->source); })()), "paginationData", [], "any", false, false, false, 474)]));
// line 475
echo " </div>
";
}
// line 477
echo " ";
}
// line 478
echo "
<style>
.selectedmenu {
height: 35px;
margin: 20px;
border: 0px solid;
background-color: #F0FFF0;
display: flex;
align-items: center;
justify-content: center; /* 水平方向にも中央揃えする場合 */
}
.selectedmenu img {
/*height: 50%;*/
}
</style>
<script>
function submitFormAndRedirect(productId, url) {
window.location.href = url;
}
</script>
<style>
.custom-flash {
border: 2px solid #e60000; /* 赤い枠 */
background-color: #ffe6e6; /* 薄いピンク背景 */
color: #900; /* 赤系文字色 */
padding: 12px 16px;
border-radius: 4px;
margin-bottom: 10px;
font-weight: bold;
}
</style>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
public function getTemplateName()
{
return "@SDream/Product/list.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 880 => 478, 877 => 477, 873 => 475, 871 => 474, 859 => 467, 855 => 466, 849 => 463, 845 => 462, 838 => 457, 824 => 456, 820 => 454, 812 => 448, 808 => 446, 805 => 445, 796 => 439, 790 => 438, 783 => 434, 777 => 431, 773 => 430, 768 => 429, 765 => 428, 759 => 425, 755 => 424, 752 => 423, 750 => 422, 745 => 420, 741 => 419, 738 => 418, 736 => 417, 726 => 415, 723 => 414, 716 => 410, 708 => 409, 703 => 407, 700 => 406, 697 => 405, 695 => 404, 691 => 401, 687 => 399, 679 => 397, 673 => 395, 670 => 394, 663 => 390, 660 => 389, 652 => 387, 646 => 385, 643 => 384, 640 => 383, 638 => 382, 635 => 380, 629 => 378, 627 => 377, 623 => 376, 620 => 375, 614 => 370, 602 => 368, 600 => 367, 597 => 366, 593 => 364, 591 => 363, 588 => 362, 586 => 361, 581 => 358, 578 => 357, 576 => 356, 557 => 355, 553 => 353, 551 => 352, 546 => 349, 539 => 345, 535 => 344, 531 => 342, 529 => 341, 526 => 340, 520 => 338, 514 => 336, 512 => 335, 506 => 331, 501 => 329, 498 => 328, 495 => 327, 492 => 326, 476 => 323, 470 => 319, 468 => 318, 462 => 314, 460 => 313, 455 => 310, 453 => 309, 448 => 306, 446 => 305, 438 => 299, 436 => 298, 426 => 290, 424 => 289, 415 => 287, 409 => 286, 404 => 283, 387 => 282, 384 => 281, 382 => 280, 375 => 278, 370 => 275, 327 => 183, 324 => 182, 318 => 181, 309 => 177, 303 => 176, 300 => 175, 297 => 174, 292 => 173, 290 => 172, 287 => 171, 279 => 169, 277 => 168, 272 => 165, 260 => 163, 256 => 162, 251 => 161, 247 => 160, 243 => 158, 237 => 155, 234 => 154, 232 => 153, 229 => 152, 226 => 103, 224 => 102, 221 => 101, 211 => 100, 184 => 82, 174 => 75, 143 => 47, 115 => 21, 101 => 20, 93 => 19, 76 => 18, 72 => 16, 62 => 15, 51 => 11, 49 => 13, 36 => 11,);
}
public function getSourceContext()
{
return new Source("{#
This file is part of EC-CUBE
Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
http://www.ec-cube.co.jp/
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% extends 'default_frame.twig' %}
{% set body_class = 'product_page' %}
{% block javascript %}
<script>
eccube.productsClassCategories = {
{% for Product in pagination %}
\"{{ Product.id|escape('js') }}\": {{ class_categories_as_json(Product)|raw }}{% if loop.last == false %}, {% endif %}
{% endfor %}
};
\$(function() {
// 表示件数を変更
\$('.disp-number').change(function() {
var dispNumber = \$(this).val();
\$('#disp_number').val(dispNumber);
\$('#pageno').val(1);
\$(\"#form1\").submit();
});
// 並び順を変更
\$('.order-by').change(function() {
var orderBy = \$(this).val();
\$('#orderby').val(orderBy);
\$('#pageno').val(1);
\$(\"#form1\").submit();
});
\$('.add-cart').on('click', function(e) {
var \$form = \$(this).parents('li').find('form');
// 個数フォームのチェック
var \$quantity = \$form.parent().find('.quantity');
if (\$quantity.val() < 1) {
\$quantity[0].setCustomValidity('{{ '1以上で入力してください。'|trans }}');
setTimeout(function() {
loadingOverlay('hide');
}, 100);
return true;
} else {
\$quantity[0].setCustomValidity('');
}
e.preventDefault();
\$.ajax({
url: \$form.attr('action'),
type: \$form.attr('method'),
data: \$form.serialize(),
dataType: 'json',
beforeSend: function(xhr, settings) {
// Buttonを無効にする
\$('.add-cart').prop('disabled', true);
}
}).done(function(data) {
// レスポンス内のメッセージをalertで表示
\$.each(data.messages, function() {
\$('#ec-modal-header').text(this);
});
\$('.ec-modal').show()
// カートブロックを更新する
\$.ajax({
url: '{{ url('block_cart') }}',
type: 'GET',
dataType: 'html'
}).done(function(html) {
\$('.ec-headerRole__cart').html(html);
});
}).fail(function(data) {
alert('{{ 'カートへの追加に失敗しました。'|trans }}');
}).always(function(data) {
// Buttonを有効にする
\$('.add-cart').prop('disabled', false);
});
});
});
\$('.ec-modal-wrap').on('click', function(e) {
// モーダル内の処理は外側にバブリングさせない
e.stopPropagation();
});
\$('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function() {
\$('.ec-modal').hide()
});
</script>
{% endblock %}
{% block main %}
{% set current_category = null %}
{#
<div>
{{CategorySelf.id}} {{CategorySelf.name}} {{CategorySelf.category_picfilename}}
{% for cat in CategoryList %}
<div class=\"catinfo\">
{{cat.id}} {{cat.name}} {{cat.category_picfilename}}
</div>
{% endfor %}
</div>
#}
{#
カテゴリを一覧で一気に表示する
{% if Category !=null and Category.id != null and Category.id == '21' %}
<div>
{% for product in Category21Products %}
{% if current_category != product.category_name %}
{% set current_category = product.category_name %}
<div class=\"category-header\">
<a href=\"{{ url('product_list') }}?category_id={{ product.category_id }}\">{{ current_category }}</a>
</div>
{% endif %}
<div class=\"product-item\">
・<a href=\"{{ url('product_detail', {'id': product.product_id}) }}\">
{{ product.product_name }}
</a>
</div>
{% endfor %}
</div>
{% endif %}
<style>
.category-header {
width: 100%;
border: 1px solid #000; /* 線の色とスタイルを指定 */
padding: 10px; /* 内側の余白を指定 */
box-sizing: border-box; /* ボックスのサイズを含む */
background-color: #f8f8f8; /* 背景色を指定(任意) */
font-weight: bold; /* フォントを太字にする(任意) */
margin-bottom: 10px; /* 下部の余白を指定(任意) */
}
.product-item {
margin-left: 20px; /* 商品名を少しインデントする(任意) */
}
</style>
#}
{% if search_form.category_id.vars.errors|length > 0 %}
<div class=\"ec-searchnavRole\">
<p class=\"errormsg text-danger\">{{ 'ご指定のカテゴリは存在しません'|trans }}</p>
</div>
{% else %}
<div class=\"ec-searchnavRole\">
<form name=\"form1\" id=\"form1\" method=\"get\" action=\"?\">
{% for item in search_form %}
<input type=\"hidden\" id=\"{{ item.vars.id }}\"
name=\"{{ item.vars.full_name }}\"
{% if item.vars.value is not empty %}value=\"{{ item.vars.value }}\" {% endif %}/>
{% endfor %}
</form>
<div class=\"catimgself\">
{% if CategorySelf is not empty and CategorySelf.category_picfilename is not empty %}
<img src=\"{{ asset(CategorySelf.category_picfilename) }}\" alt=\"{{ CategorySelf.category_picalt }}\" />
{% endif %}
<div class=\"catimgchild-container\">
{% if CategoryList is not empty %}
{% for cat in CategoryList %}
{% if cat is not empty and cat.category_minipicfilename is not empty and (cat.category_enable is empty or cat.category_enable != '1') %}
<div class=\"catimgchild\">
<a href=\"{{ url('product_list') }}?category_id={{ cat.id }}\">
<img src=\"{{ asset(cat.category_minipicfilename) }}\" alt=\"{{ cat.category_picalt }}\" />
</a>
</div>
{% endif %}
{% endfor %}
{% endif %}
</div>
</div>
<style>
.catimgself {
display: flex;
flex-direction: column;
align-items: center;
}
.catimgself img {
max-width: 100%;
height: auto;
}
.catimgchild-container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin: 0; /* 親コンテナのマージンをリセット */
}
.catimgchild {
flex: 1 0 33.33%; /* 子要素を3列に分けるために幅を調整 */
max-width: 33.33%; /* 子要素の最大幅を設定 */
text-align: center;
margin: 0; /* 子要素間の間隔をなくす */
box-sizing: border-box; /* パディングとボーダーを含めて要素のサイズを計算 */
}
.catimgchild img {
width: 100%;
height: auto;
}
</style>
{#
{% if Category is not null %}
{% for Path in Category.path %}
{% if loop.last %}
{% if Path.id=='21' %}
<div class=\"selectedmenu\"><img src=\"{{ asset('/img/category/cornerbanner/21.jpg') }}\" /></div>
{% elseif Path.id=='22' %}
<div class=\"selectedmenu\"><img src=\"{{ asset('/img/category/cornerbanner/22.jpg') }}\" /></div>
{% elseif Path.id=='24' %}
<div class=\"selectedmenu\"><img src=\"{{ asset('/img/category/cornerbanner/24.jpg') }}\" /></div>
{% elseif Path.id=='25' %}
<div class=\"selectedmenu\"><img src=\"{{ asset('/img/category/cornerbanner/25.jpg') }}\" /></div>
{% elseif Path.id=='26' %}
<div class=\"selectedmenu\"><img src=\"{{ asset('/img/category/cornerbanner/26.jpg') }}\" /></div>
{% elseif Path.id=='27' %}
<div class=\"selectedmenu\"><img src=\"{{ asset('/img/category/cornerbanner/27.jpg') }}\" /></div>
{% elseif Path.id=='28' %}
<div class=\"selectedmenu\"><img src=\"{{ asset('/img/category/cornerbanner/28.jpg') }}\" /></div>
{% elseif Path.id=='76' or Path.id=='77' or Path.id=='78' or Path.id=='79' or Path.id=='81' or Path.id=='80' or Path.id=='83' or Path.id=='86' %}
<div class=\"selectedmenu\">「 お米の産地別 」を選択中</div>
{% elseif Path.id=='66' or Path.id=='67' or Path.id=='68' or Path.id=='69' or Path.id=='70' or Path.id=='71' %}
<div class=\"selectedmenu\">「 お米の銘柄別 」を選択中</div>
{% elseif Path.id=='41' or Path.id=='42' or Path.id=='43' %}
<div class=\"selectedmenu\">「 価格帯ごと 」を選択中</div>
{% elseif Path.id=='58' or Path.id=='59' or Path.id=='60' %}
<div class=\"selectedmenu\">「 粒サイズ 」を選択中</div>
{% elseif Path.id=='49' or Path.id=='50' or Path.id=='51' or Path.id=='52' %}
<div class=\"selectedmenu\">「 ロットサイズ 」を選択中</div>
{% elseif Path.id=='116' or Path.id=='117' or Path.id=='117' %}
<div class=\"selectedmenu\">「 精米レベル 」を選択中</div>
{% elseif Path.id=='10' %}
<div class=\"selectedmenu\">「 産直品コーナー 」を選択中</div>
{% elseif Path.id=='12' %}
<div class=\"selectedmenu\">「 産直 畜産品市場 」を選択中</div>
{% elseif Path.id=='13' %}
<div class=\"selectedmenu\">「 産直 水産市場 」を選択中</div>
{% elseif Path.id=='14' %}
<div class=\"selectedmenu\">「 産直 農産品市場 」を選択中</div>
{% elseif Path.id=='15' %}
<div class=\"selectedmenu\">「 産直 加工食品市場 」を選択中</div>
{% elseif Path.id=='19' %}
<div class=\"selectedmenu\">「 産直 訳アリB級品 」を選択中</div>
{% else %}
<div class=\"selectedmenu\">「 {{ Path.name }} 」を選択中</div>
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
#}
<div class=\"ec-searchnavRole__topicpath\">
<ol class=\"ec-topicpath\">
<li class=\"ec-topicpath__item\"><a href=\"{{ url('product_list') }}\">{{ '全て'|trans }}</a>
</li>
{% if Category is not null %}
{% for Path in Category.path %}
<li class=\"ec-topicpath__divider\">|</li>
<li class=\"ec-topicpath__item{% if loop.last %}--active{% endif %}\">
<a href=\"{{ url('product_list') }}?category_id={{ Path.id }}\">{{ Path.name }}</a>
{% if Path.name == '産地で選ぶ' %}
|<a href=\"/products/list?category_id=76\">北海道</a>
|<a href=\"/products/list?category_id=77\">東北</a>
|<a href=\"/products/list?category_id=78\">関東</a>
|<a href=\"/products/list?category_id=79\">信越</a>
|<a href=\"/products/list?category_id=81\">北陸</a>
|<a href=\"/products/list?category_id=80\">中部</a>
|<a href=\"/products/list?category_id=83\">西日本</a>
|<a href=\"/products/list?category_id=86\">国内</a>
{% elseif Path.name == '銘柄で選ぶ' %}
|<a href=\"/products/list?category_id=66\">コシヒカリ</a>
|<a href=\"/products/list?category_id=67\">ひとめぼれ</a>
|<a href=\"/products/list?category_id=68\">あきたこまち</a>
|<a href=\"/products/list?category_id=69\">各他の銘柄</a>
|<a href=\"/products/list?category_id=70\">逸品米</a>
|<a href=\"/products/list?category_id=71\">無洗米</a>
{% elseif Path.name == '価格帯で選ぶ' %}
|<a href=\"/products/list?category_id=41\">299円以下</a>
|<a href=\"/products/list?category_id=42\">239円以下</a>
|<a href=\"/products/list?category_id=43\">329円以上</a>
{% elseif Path.name == '粒サイズで選ぶ' %}
|<a href=\"/products/list?category_id=58\">通常</a>
|<a href=\"/products/list?category_id=59\">やや小粒</a>
|<a href=\"/products/list?category_id=60\">ブレンド</a>
{% elseif Path.name == 'ロットサイズで選ぶ' %}
|<a href=\"/products/list?category_id=49\">小ロット</a>
<a href=\"/products/list?category_id=50\">業務用</a>
|<a href=\"/products/list?category_id=51\">大口割引</a>
|<a href=\"/products/list?category_id=52\">激安</a>
{% elseif Path.name == '精米方法で選ぶ' %}
|<a href=\"/products/list?category_id=116\">上白精米</a>
|<a href=\"/products/list?category_id=117\">精白米</a>
|<a href=\"/products/list?category_id=118\">玄米</a>
{% endif %}
</li>
{% endfor %}
{% endif %}
{% if search_form.vars.value and search_form.vars.value.name %}
<li class=\"ec-topicpath__divider\">|</li>
<li class=\"ec-topicpath__item\">{{ '「%name%」の検索結果'|trans({ '%name%': search_form.vars.value.name }) }}</li>
{% endif %}
</ol>
</div>
<div class=\"ec-searchnavRole__infos\">
<div class=\"ec-searchnavRole__counter\">
{% if pagination.totalItemCount > 0 %}
{{ '<span class=\"ec-font-bold\">%count%件</span><span>の商品が見つかりました</span>'|trans({ '%count%': pagination.totalItemCount })|raw }}
{% else %}
<span>{{ 'お探しの商品は見つかりませんでした'|trans }}</span>
{% endif %}
</div>
{% if pagination.totalItemCount > 0 %}
<div class=\"ec-searchnavRole__actions\">
<div class=\"ec-select\">
{{ form_widget(search_form.disp_number, {'id': '', 'attr': {'class': 'disp-number'}}) }}
{{ form_widget(search_form.orderby, {'id': '', 'attr': {'class': 'order-by'}}) }}
</div>
</div>
{% endif %}
</div>
</div>
<div id=\"flash-area\"></div>
{% if pagination.totalItemCount > 0 %}
<div class=\"ec-shelfRole\">
<ul class=\"ec-shelfGrid\">
{% for Product in pagination %}
{% if Product.limited_ids == '' %}
<li class=\"ec-shelfGrid__item\">
<a href=\"{{ url('product_detail', {'id': Product.id}) }}\">
<p class=\"ec-shelfGrid__item-image\">
{# === SDR === #}
{% if eccube_config.app_mode != 'display' %}
{% set image_url = asset(Product.main_list_image, 'save_image') %}
{% elseif Product.mainDisplayImage %}
{% set image_url = eccube_config.img_folder ~ Product.mainDisplayImage.fileName %}
{% endif %}
{% if image_url is defined %}
<img src=\"{{ image_url }}\" alt=\"{{ Product.name }}\" {% if loop.index > 5 %}loading=\"lazy\"{% endif %}>
{% else %}
<div class=\"ec-shelfGrid__item-noimage\">
★画像準備中
</div>
{% endif %}
{# === SDR === #}
</p>
<p>{{ Product.name }}</p>
{% if Product.description_list %}
<p>{{ Product.description_list|raw|nl2br }}</p>
{% endif %}
<p class=\"price02-default\">
{# === SDR === #}
{% if eccube_config.app_mode != 'display' %}
{% if Product.hasProductClass %}
{% if Product.getPrice02IncTaxMin == Product.getPrice02IncTaxMax %}
{{ Product.getPrice02IncTaxMin|price }}
{% else %}
{{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}
{% endif %}
{% else %}
{{ Product.getPrice02IncTaxMin|price }}
{% endif %}
{% else %}
{#規格あり・規格なしに関係なく、表示対象の ProductClass から価格を取得#}
{% if Product.getPriceSellerInTaxMin == Product.getPriceSellerInTaxMax %}
{{ Product.getPriceSellerInTaxMin|price }}
{% else %}
{{ Product.getPriceSellerInTaxMin|price }} ~ {{ Product.getPriceSellerInTaxMax|price }}
{% endif %}
{% endif %}
</p>
</a>
{# === SDR === #}
{% if eccube_config.app_mode != 'display' %}
{% if Product.stock_find %}
{% if Product.locked_ids is not empty %}
<br>
<button type=\"button\" class=\"ec-blockBtn--action add-cart\" data-cartid=\"{{ Product.id }}\" onclick=\"submitFormAndRedirect('{{ Product.id }}', '{{ url('product_detail', {'id': Product.id}) }}')\">
{{ '詳細表示'|trans }}
</button>
{% else %}
{% set form = forms[Product.id] %}
<form name=\"form{{ Product.id }}\" id=\"productForm{{ Product.id }}\" action=\"{{ url('product_add_cart', {id:Product.id}) }}\" method=\"post\">
<div class=\"ec-productRole__actions\">
{% if form.classcategory_id1 is defined %}
<div class=\"ec-select\">
{{ form_widget(form.classcategory_id1) }}
{{ form_errors(form.classcategory_id1) }}
</div>
{% if form.classcategory_id2 is defined %}
<div class=\"ec-select\">
{{ form_widget(form.classcategory_id2) }}
{{ form_errors(form.classcategory_id2) }}
</div>
{% endif %}
{% endif %}
<div class=\"ec-numberInput\"><span>{{ '数量'|trans }}</span>
{{ form_widget(form.quantity, {'attr': {'class': 'quantity'}}) }}
{{ form_errors(form.quantity) }}
</div>
</div>
{{ form_rest(form) }}
</form>
<div class=\"ec-productRole__btn\">
<button type=\"submit\" class=\"ec-blockBtn--action add-cart\" data-cartid=\"{{ Product.id }}\" form=\"productForm{{ Product.id }}\">
{{ 'カートに入れる'|trans }}
</button>
</div>
{% endif %}
{% else %}
<div class=\"ec-productRole__btn\">
<button type=\"button\" class=\"ec-blockBtn--action\" disabled=\"disabled\">
{{ 'ただいま品切れ中です。'|trans }}
</button>
</div>
{% endif %}
{% endif %}
{# === SDR === #}
</li>
{% endif %}
{% endfor %}
</ul>
</div>
<div class=\"ec-modal\">
<div class=\"ec-modal-overlay\">
<div class=\"ec-modal-wrap\">
<span class=\"ec-modal-close\"><span class=\"ec-icon\"><img src=\"{{ asset('assets/icon/cross-dark.svg') }}\" alt=\"\"/></span></span>
<div id=\"ec-modal-header\" class=\"text-center\">{{ 'カートに追加しました。'|trans }}</div>
<div class=\"ec-modal-box\">
<div class=\"ec-role\">
<span class=\"ec-inlineBtn--cancel\">{{ 'お買い物を続ける'|trans }}</span>
<a href=\"{{ url('cart') }}\" class=\"ec-inlineBtn--action\">{{ 'カートへ進む'|trans }}</a>
</div>
</div>
</div>
</div>
</div>
<div class=\"ec-pagerRole\">
{% include \"pager.twig\" with {'pages': pagination.paginationData} %}
</div>
{% endif %}
{% endif %}
<style>
.selectedmenu {
height: 35px;
margin: 20px;
border: 0px solid;
background-color: #F0FFF0;
display: flex;
align-items: center;
justify-content: center; /* 水平方向にも中央揃えする場合 */
}
.selectedmenu img {
/*height: 50%;*/
}
</style>
<script>
function submitFormAndRedirect(productId, url) {
window.location.href = url;
}
</script>
<style>
.custom-flash {
border: 2px solid #e60000; /* 赤い枠 */
background-color: #ffe6e6; /* 薄いピンク背景 */
color: #900; /* 赤系文字色 */
padding: 12px 16px;
border-radius: 4px;
margin-bottom: 10px;
font-weight: bold;
}
</style>
{% endblock %}", "@SDream/Product/list.twig", "/home/xs262729/sandrea.net/public_html/display.sandrea.net/app/Plugin/SDream/Resource/template/Product/list.twig");
}
}