<?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;
/* @Recommend42/Product/list.twig */
class __TwigTemplate_6dba45cb4f454b178bc7006f464dc8f91c79cc5923d88ae0f2861713ed052e7c 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 2
return "default_frame.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@Recommend42/Product/list.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@Recommend42/Product/list.twig"));
// line 4
$context["body_class"] = "product_page";
// line 2
$this->parent = $this->loadTemplate("default_frame.twig", "@Recommend42/Product/list.twig", 2);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
}
// line 6
public function block_javascript($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascript"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascript"));
// line 7
echo " <script>
eccube.productsClassCategories = {
";
// line 9
$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.', 9, $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 10
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, 10), "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, 10) == false)) {
echo ", ";
}
// line 11
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 12
echo " };
\$(function() {
\$('.ec-blockFavoriteBtn').on(\"click\", function(e) {
e.stopImmediatePropagation();
e.preventDefault();
var \$form = \$(this).parents('form.ec-favoriteForm');
\$form.attr('action', \$(this).attr(\"data-action\"));
\$form.attr('method', \$(this).attr(\"data-method\"));
\$.ajax({
url: \$form.attr('action'),
type: \$form.attr('method'),
dataType: 'json',
}).done(function(data) {
\$(\$form).find(\".ec-blockFavoriteBtnDisable\").removeClass(\"d-none\");
\$(\$form).find(\".ec-blockFavoriteBtn\").addClass(\"d-none\");
}).fail(function(data) {
alert('";
// line 29
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("お気に入りの追加に失敗しました。"), "html", null, true);
echo "');
});
})
\$('.ec-blockFavoriteBtnDisable').on(\"click\", function(e) {
e.stopImmediatePropagation();
e.preventDefault();
var \$form = \$(this).parents('form.ec-favoriteForm');
\$form.attr('action', \$(this).attr(\"data-action\"));
\$form.attr('method', \$(this).attr(\"data-method\"));
\$.ajax({
url: \$form.attr('action'),
type: \$form.attr('method'),
dataType: 'json',
}).done(function(data) {
\$(\$form).find(\".ec-blockFavoriteBtnDisable\").addClass(\"d-none\");
\$(\$form).find(\".ec-blockFavoriteBtn\").removeClass(\"d-none\");
}).fail(function(data) {
alert('";
// line 46
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("お気に入りの追加に失敗しました。"), "html", null, true);
echo "');
});
})
// 表示件数を変更
\$('.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();
});
var modalTimer;
\$('.add-cart').on('click', function(e) {
var self = \$(this);
onAddCart(e, \$(this), 1, function() {
var \$form = self.parents('li');
\$form.find(\".ec-productRole__btn--only\").addClass(\"d-none\");
\$form.find(\".ec-productRole__btn--group\").removeClass(\"d-none\");
window.clearTimeout(modalTimer);
\$('.ec-modal').show()
modalTimer = window.setTimeout(function() {
\$('.ec-modal').hide();
}, 1500)
});
});
\$('.minus__btn').on('click', function(e) {
onAddCart(e, \$(this), -1);
})
\$('.plus__btn').on('click', function(e) {
onAddCart(e, \$(this));
})
function onAddCart(e, self, quantity = 1, callback) {
var \$form = \$(self).parents('li').find('form.productForm');
// 個数フォームのチェック
\$form.parent().find('.quantity').val(quantity);
e.preventDefault();
\$.ajax({
url: \$form.attr('action'),
type: \$form.attr('method'),
data: \$form.serialize(),
dataType: 'json',
beforeSend: function(xhr, settings) {
// Buttonを無効にする
\$(self).prop('disabled', true);
}
}).done(function(data) {
// レスポンス内のメッセージをalertで表示
\$.each(data.messages, function() {
\$('#ec-modal-header').text(this);
});
var \$quantityLabelEl = \$(self).parents('li').find('.quantity_label');
\$quantityLabelEl.text(\$quantityLabelEl.text() * 1 + quantity * 1);
if(callback) {
callback();
}
// カートブロックを更新する
\$.ajax({
url: '";
// line 117
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 124
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートへの追加に失敗しました。"), "html", null, true);
echo "');
\$(self).prop('disabled', false);
}).always(function(data) {
var \$parent = \$(self).parents('li');
let stockVal = \$parent.find('.stock').val() * 1;
var \$quantityLabelEl = \$parent.find('.quantity_label');
var _quantity = \$quantityLabelEl.text() * 1;
if(_quantity == 0) {
// enable minus button
\$(self).prop('disabled', false);
\$parent.find(\".ec-productRole__btn--only\").removeClass(\"d-none\");
\$parent.find(\".ec-productRole__btn--group\").addClass(\"d-none\");
}
if(_quantity > 0 && _quantity < stockVal) {
// Buttonを有効にする
\$(self).prop('disabled', false);
\$parent.find('.plus__btn').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_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 159
public function block_main($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "main"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "main"));
// line 160
echo " <ul class=\"breadcrumb w-p\">
<li class=\"breadcrumb__item\">
<a href=\"";
// line 162
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("homepage");
echo "\" class=\"breadcrumb__item__link\">
ホーム
</a>
</li>
<li class=\"breadcrumb__item\">
<p class=\"breadcrumb__item__arrow\">></p>
</li>
<li class=\"breadcrumb__item\">
<p class=\"breadcrumb__item__text\">注目商品一覧</p>
</li>
</ul>
<div class=\"ec-pageHeader contentHeader\">
<h1>";
// line 174
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("注目商品一覧"), "html", null, true);
echo "</h1>
</div>
";
// line 176
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.', 176, $this->source); })()), "category_id", [], "any", false, false, false, 176), "vars", [], "any", false, false, false, 176), "errors", [], "any", false, false, false, 176)) > 0)) {
// line 177
echo " <div class=\"ec-searchnavRole\">
<p class=\"errormsg text-danger\">";
// line 178
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ご指定のカテゴリは存在しません"), "html", null, true);
echo "</p>
</div>
";
} else {
// line 181
echo " <div class=\"ec-searchnavRole\">
<form name=\"form1\" id=\"form1\" method=\"get\" action=\"?\">
";
// line 183
$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.', 183, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
// line 184
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, 184), "id", [], "any", false, false, false, 184), "html", null, true);
echo "\"
name=\"";
// line 185
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, 185), "full_name", [], "any", false, false, false, 185), "html", null, true);
echo "\"
";
// line 186
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, 186), "value", [], "any", false, false, false, 186))) {
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, 186), "value", [], "any", false, false, false, 186), "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 188
echo " </form>
";
// line 207
echo " <div class=\"ec-searchnavRole__infos\">
<div class=\"ec-searchnavRole__counter\">
";
// line 209
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.', 209, $this->source); })()), "totalItemCount", [], "any", false, false, false, 209) > 0)) {
// line 210
echo " <p class=\"ec-searchnavRole__counter__title\">検索結果</p>
";
// line 211
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("<p class=\"ec-searchnavRole__counter__number\">%count%件</p>", ["%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.', 211, $this->source); })()), "totalItemCount", [], "any", false, false, false, 211)]);
echo "
";
} else {
// line 213
echo " <span>";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("お探しの商品は見つかりませんでした"), "html", null, true);
echo "</span>
";
}
// line 215
echo " </div>
";
// line 216
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.', 216, $this->source); })()), "totalItemCount", [], "any", false, false, false, 216) > 0)) {
// line 217
echo " <div class=\"ec-searchnavRole__actions\">
<div class=\"ec-select\">
";
// line 219
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.', 219, $this->source); })()), "disp_number", [], "any", false, false, false, 219), 'widget', ["id" => "", "attr" => ["class" => "disp-number"]]);
echo "
";
// line 220
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.', 220, $this->source); })()), "orderby", [], "any", false, false, false, 220), 'widget', ["id" => "", "attr" => ["class" => "order-by"]]);
echo "
</div>
</div>
";
}
// line 224
echo " </div>
</div>
<ul class=\"stockList\">
<li class=\"stockList__block\">
<p class=\"stockList__block__text\">在庫あり:</p>
<p class=\"stockList__block__mark\">◎</p>
</li>
<li class=\"stockList__block\">
<p class=\"stockList__block__text\">残りわずか:</p>
<p class=\"stockList__block__mark\">○</p>
</li>
<li class=\"stockList__block\">
<p class=\"stockList__block__text\">取り寄せ:</p>
<p class=\"stockList__block__mark\">■</p>
</li>
</ul>
";
// line 240
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.', 240, $this->source); })()), "totalItemCount", [], "any", false, false, false, 240) > 0)) {
// line 241
echo " <div class=\"ec-shelfRole\">
<ul class=\"ec-shelfGrid\">
";
// line 243
$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.', 243, $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 244
echo " <li class=\"ec-shelfGrid__item\">
<a href=\"";
// line 245
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, 245)]), "html", null, true);
echo "\">
<div class=\"ec-shelfGrid__item-image\">
<img src=\"";
// line 247
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, 247)), "save_image"), "html", null, true);
echo "\" alt=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Product"], "name", [], "any", false, false, false, 247), "html", null, true);
echo "\" ";
if ((twig_get_attribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 247) > 5)) {
echo " loading=\"lazy\"";
}
echo ">
";
// line 248
if ((twig_length_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Product"], "Tags", [], "any", false, false, false, 248)) > 0)) {
// line 249
echo " <ul class=\"ec-shelfGrid__item-tags\">
";
// line 250
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["Product"], "Tags", [], "any", false, false, false, 250));
foreach ($context['_seq'] as $context["_key"] => $context["Tag"]) {
// line 251
echo " <li class=\"ec-shelfGrid__item-tags__tag tag_";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Tag"], "id", [], "any", false, false, false, 251), "html", null, true);
echo "\">";
echo twig_escape_filter($this->env, $context["Tag"], "html", null, true);
echo "</li>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Tag'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 253
echo " </ul>
";
}
// line 255
echo " </div>
<p class=\"ec-shelfGrid__item-name\">";
// line 256
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Product"], "name", [], "any", false, false, false, 256), "html", null, true);
echo "</p>
";
// line 257
if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_USER")) {
// line 258
echo "
<div class=\"ec-shelfGrid__item-stock\">
<div class=\"ec-shelfGrid__item-stock__block\">
<p class=\"ec-shelfGrid__item-stock__block__title\">
【発送目安】
</p>
<p class=\"ec-shelfGrid__item-stock__block__detail\">
";
// line 265
if (twig_get_attribute($this->env, $this->source, $context["Product"], "getDeliveryDuration", [], "any", false, false, false, 265)) {
// line 266
echo " ";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["Product"], "getDeliveryDuration", [], "any", false, false, false, 266), "name", [], "any", false, false, false, 266), "html", null, true);
echo "
";
} else {
// line 268
echo " 指定なし
";
}
// line 270
echo " </p>
</div>
<div class=\"ec-shelfGrid__item-stock__block\">
<p class=\"ec-shelfGrid__item-stock__block__title\">
【在庫】
</p>
";
// line 277
echo " <p class=\"ec-shelfGrid__item-stock__block__detail\">
";
// line 278
if ((twig_get_attribute($this->env, $this->source, $context["Product"], "getStockUnlimitedMin", [], "any", false, false, false, 278) || (twig_get_attribute($this->env, $this->source, $context["Product"], "getStockMin", [], "any", false, false, false, 278) >= 10))) {
// line 279
echo " ◎
";
} else {
// line 281
echo " ";
if (((twig_get_attribute($this->env, $this->source, $context["Product"], "getStockMin", [], "any", false, false, false, 281) >= 1) && (twig_get_attribute($this->env, $this->source, $context["Product"], "getStockMin", [], "any", false, false, false, 281) <= 9))) {
// line 282
echo " ○
";
}
// line 284
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["Product"], "getStockMin", [], "any", false, false, false, 284) <= 0)) {
// line 285
echo " ■
";
}
// line 287
echo " ";
}
// line 288
echo " </p>
</div>
</div>
";
// line 296
echo " ";
if (twig_get_attribute($this->env, $this->source, $context["Product"], "description_list", [], "any", false, false, false, 296)) {
// line 297
echo " <p>";
echo twig_nl2br(twig_get_attribute($this->env, $this->source, $context["Product"], "description_list", [], "any", false, false, false, 297));
echo "</p>
";
}
// line 299
echo " <div class=\"ec-shelfGrid__item-flex\">
<p class=\"price02-default ec-shelfGrid__item-price\">
";
// line 301
if (twig_get_attribute($this->env, $this->source, $context["Product"], "hasProductClass", [], "any", false, false, false, 301)) {
// line 302
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02Min", [], "any", false, false, false, 302) == twig_get_attribute($this->env, $this->source, $context["Product"], "getPrice02Max", [], "any", false, false, false, 302))) {
// line 303
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, 303)), "html", null, true);
echo "
";
} else {
// line 305
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, 305)), "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, 305)), "html", null, true);
echo "
";
}
// line 307
echo " ";
} else {
// line 308
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, 308)), "html", null, true);
echo "
";
}
// line 310
echo " </p>
";
// line 311
if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_USER")) {
// line 312
echo " <div class=\"ec-shelfGrid__item-flex__favorite\">
<form class=\"ec-favoriteForm\" action=\"?\" method=\"?\">
<div class=\"ec-productRole__btn\">
<button data-method=\"POST\" data-action=\"";
// line 315
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_add_favorite", ["id" => twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 315)]), "html", null, true);
echo "\" id=\"favorite\" class=\"";
if ((twig_get_attribute($this->env, $this->source, ($context["isFavorite"] ?? null), twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 315), [], "array", true, true, false, 315) && (twig_get_attribute($this->env, $this->source, (isset($context["isFavorite"]) || array_key_exists("isFavorite", $context) ? $context["isFavorite"] : (function () { throw new RuntimeError('Variable "isFavorite" does not exist.', 315, $this->source); })()), twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 315), [], "array", false, false, false, 315) == true))) {
echo " d-none ";
}
echo " ec-blockFavoriteBtn ec-blockBtn--cancel ec-shelfGrid__item-flex__favorite__btn\">
<img src=\"";
// line 316
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/favorite/before.svg"), "html", null, true);
echo "\" alt=\"お気に入り\" width=\"24\" height=\"24\" loading=\"lazy\">
</button>
<button data-method=\"DELETE\" data-action=\"";
// line 318
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_favorite_delete", ["id" => twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 318)]), "html", null, true);
echo "\" id=\"favorite\" class=\"";
if ((twig_get_attribute($this->env, $this->source, ($context["isFavorite"] ?? null), twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 318), [], "array", true, true, false, 318) && (twig_get_attribute($this->env, $this->source, (isset($context["isFavorite"]) || array_key_exists("isFavorite", $context) ? $context["isFavorite"] : (function () { throw new RuntimeError('Variable "isFavorite" does not exist.', 318, $this->source); })()), twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 318), [], "array", false, false, false, 318) == false))) {
echo " d-none ";
}
echo "ec-blockFavoriteBtnDisable ec-blockBtn--cancel ec-shelfGrid__item-flex__favorite__btn\">
<img src=\"";
// line 319
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/favorite/after.svg"), "html", null, true);
echo "\" alt=\"お気に入り\" width=\"24\" height=\"24\" loading=\"lazy\">
</button>
</div>
</form>
</div>
";
}
// line 325
echo " </div>
</a>
";
// line 328
if ((( !twig_get_attribute($this->env, $this->source, $context["Product"], "getStockUnlimitedMin", [], "any", false, false, false, 328) && (twig_get_attribute($this->env, $this->source, $context["Product"], "getStockMin", [], "any", false, false, false, 328) <= 0)) && twig_get_attribute($this->env, $this->source, $context["Product"], "isStockDiscontinued", [], "any", false, false, false, 328))) {
// line 329
echo " <div class=\"ec-productRole__btn\">
<button type=\"button\" class=\"ec-disabled__btn\" disabled=\"disabled\">
";
// line 331
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("在庫なし"), "html", null, true);
echo "
</button>
</div>
";
} else {
// line 335
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.', 335, $this->source); })()), twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 335), [], "array", false, false, false, 335);
// line 336
echo " <form class=\"productForm\" name=\"form";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 336), "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, 336), "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, 336)]), "html", null, true);
echo "\" method=\"post\">
<div class=\"ec-productRole__actions\">
";
// line 338
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id1", [], "any", true, true, false, 338)) {
// line 339
echo " <div class=\"ec-select\">
";
// line 340
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.', 340, $this->source); })()), "classcategory_id1", [], "any", false, false, false, 340), 'widget');
echo "
";
// line 341
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.', 341, $this->source); })()), "classcategory_id1", [], "any", false, false, false, 341), 'errors');
echo "
</div>
";
// line 343
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id2", [], "any", true, true, false, 343)) {
// line 344
echo " <div class=\"ec-select\">
";
// line 345
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.', 345, $this->source); })()), "classcategory_id2", [], "any", false, false, false, 345), 'widget');
echo "
";
// line 346
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.', 346, $this->source); })()), "classcategory_id2", [], "any", false, false, false, 346), 'errors');
echo "
</div>
";
}
// line 349
echo " ";
}
// line 350
echo " <div class=\"ec-numberInput d-none\"><span>";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("数量"), "html", null, true);
echo "</span>
";
// line 351
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.', 351, $this->source); })()), "quantity", [], "any", false, false, false, 351), 'widget', ["attr" => ["class" => "quantity"]]);
echo "
";
// line 352
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.', 352, $this->source); })()), "quantity", [], "any", false, false, false, 352), 'errors');
echo "
</div>
</div>
";
// line 356
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.', 356, $this->source); })()), 'rest');
echo "
</form>
";
// line 358
$context["default"] = 0;
// line 359
echo " ";
if (twig_get_attribute($this->env, $this->source, ($context["itemInCart"] ?? null), twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 359), [], "array", true, true, false, 359)) {
// line 360
echo " ";
$context["default"] = twig_get_attribute($this->env, $this->source, (isset($context["itemInCart"]) || array_key_exists("itemInCart", $context) ? $context["itemInCart"] : (function () { throw new RuntimeError('Variable "itemInCart" does not exist.', 360, $this->source); })()), twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 360), [], "array", false, false, false, 360);
// line 361
echo " ";
}
// line 362
echo " ";
$context["disabled"] = false;
// line 363
echo " ";
if ( !twig_get_attribute($this->env, $this->source, $context["Product"], "isStockDiscontinued", [], "any", false, false, false, 363)) {
// line 364
echo " <input type=\"hidden\" name=\"stock\" class=\"stock\" value=\"999999999999\">
";
} else {
// line 366
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["Product"], "getStockMin", [], "any", false, false, false, 366) <= (isset($context["default"]) || array_key_exists("default", $context) ? $context["default"] : (function () { throw new RuntimeError('Variable "default" does not exist.', 366, $this->source); })()))) {
// line 367
echo " ";
$context["disabled"] = true;
// line 368
echo " ";
}
// line 369
echo " <input type=\"hidden\" name=\"stock\" class=\"stock\" value=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Product"], "getStockMin", [], "any", false, false, false, 369), "html", null, true);
echo "\">
";
}
// line 371
echo " <div class=\"ec-productRole__btn--group ec-productRole__btn ";
if (twig_get_attribute($this->env, $this->source, ($context["itemInCart"] ?? null), twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 371), [], "array", true, true, false, 371)) {
echo " d-block ";
} else {
echo " d-none ";
}
echo "\">
<div class=\"d-flex align-items-center ec-productRole__btn-wrapper\">
<button class=\"minus__btn\" data-cartid=\"";
// line 373
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 373), "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, 373), "html", null, true);
echo "\">
<span>−</span>
</button>
<span class=\"quantity_label\">";
// line 376
echo twig_escape_filter($this->env, (isset($context["default"]) || array_key_exists("default", $context) ? $context["default"] : (function () { throw new RuntimeError('Variable "default" does not exist.', 376, $this->source); })()), "html", null, true);
echo "</span>
<button class=\"plus__btn\" data-cartid=\"";
// line 377
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 377), "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, 377), "html", null, true);
echo "\" ";
if ((isset($context["disabled"]) || array_key_exists("disabled", $context) ? $context["disabled"] : (function () { throw new RuntimeError('Variable "disabled" does not exist.', 377, $this->source); })())) {
echo "disabled";
}
echo ">
<span>+</span>
</button>
</div>
</div>
<div class=\"ec-productRole__btn--only ec-productRole__btn ";
// line 382
if (twig_get_attribute($this->env, $this->source, ($context["itemInCart"] ?? null), twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 382), [], "array", true, true, false, 382)) {
echo " d-none ";
} else {
echo " d-block ";
}
echo "\">
<button type=\"submit\" class=\"ec-regular__btn add-cart\" data-cartid=\"";
// line 383
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Product"], "id", [], "any", false, false, false, 383), "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, 383), "html", null, true);
echo "\">
";
// line 384
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートに入れる"), "html", null, true);
echo "
</button>
</div>
";
}
// line 388
echo " ";
} else {
// line 389
echo " <a href=\"";
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("entry_contact");
echo "\" class=\"ec-blockProductBtn--action\">会員登録はこちら</a>
";
}
// line 391
echo " </li>
";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Product'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 393
echo " </ul>
</div>
<div class=\"ec-modal\">
<div class=\"ec-modal-overlay\">
<div class=\"ec-modal-wrap\">
<div class=\"ec-modal-box\">
<div class=\"ec-role\">
<div class=\"ec-modal-icon\">
<img src=\"";
// line 401
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/icon/icon_cart.png", "user_data"), "html", null, true);
echo "\" alt=\"\">
</div>
</div>
</div>
<div id=\"ec-modal-header\" class=\"text-center\">";
// line 405
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートに追加しました。"), "html", null, true);
echo "</div>
</div>
</div>
</div>
<ul class=\"stockList bottom\">
<li class=\"stockList__block\">
<p class=\"stockList__block__text\">在庫あり:</p>
<p class=\"stockList__block__mark\">◎</p>
</li>
<li class=\"stockList__block\">
<p class=\"stockList__block__text\">残りわずか:</p>
<p class=\"stockList__block__mark\">○</p>
</li>
<li class=\"stockList__block\">
<p class=\"stockList__block__text\">取り寄せ:</p>
<p class=\"stockList__block__mark\">■</p>
</li>
</ul>
<div class=\"ec-pagerRole\">
";
// line 424
$this->loadTemplate("pager.twig", "@Recommend42/Product/list.twig", 424)->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.', 424, $this->source); })()), "paginationData", [], "any", false, false, false, 424)]));
// line 425
echo " </div>
";
}
// line 427
echo " ";
}
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
public function getTemplateName()
{
return "@Recommend42/Product/list.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 878 => 427, 874 => 425, 872 => 424, 850 => 405, 843 => 401, 833 => 393, 818 => 391, 812 => 389, 809 => 388, 802 => 384, 796 => 383, 788 => 382, 774 => 377, 770 => 376, 762 => 373, 752 => 371, 746 => 369, 743 => 368, 740 => 367, 737 => 366, 733 => 364, 730 => 363, 727 => 362, 724 => 361, 721 => 360, 718 => 359, 716 => 358, 711 => 356, 704 => 352, 700 => 351, 695 => 350, 692 => 349, 686 => 346, 682 => 345, 679 => 344, 677 => 343, 672 => 341, 668 => 340, 665 => 339, 663 => 338, 653 => 336, 650 => 335, 643 => 331, 639 => 329, 637 => 328, 632 => 325, 623 => 319, 615 => 318, 610 => 316, 602 => 315, 597 => 312, 595 => 311, 592 => 310, 586 => 308, 583 => 307, 575 => 305, 569 => 303, 566 => 302, 564 => 301, 560 => 299, 554 => 297, 551 => 296, 546 => 288, 543 => 287, 539 => 285, 536 => 284, 532 => 282, 529 => 281, 525 => 279, 523 => 278, 520 => 277, 512 => 270, 508 => 268, 502 => 266, 500 => 265, 491 => 258, 489 => 257, 485 => 256, 482 => 255, 478 => 253, 467 => 251, 463 => 250, 460 => 249, 458 => 248, 448 => 247, 443 => 245, 440 => 244, 423 => 243, 419 => 241, 417 => 240, 399 => 224, 392 => 220, 388 => 219, 384 => 217, 382 => 216, 379 => 215, 373 => 213, 368 => 211, 365 => 210, 363 => 209, 359 => 207, 356 => 188, 344 => 186, 340 => 185, 335 => 184, 331 => 183, 327 => 181, 321 => 178, 318 => 177, 316 => 176, 311 => 174, 296 => 162, 292 => 160, 282 => 159, 238 => 124, 228 => 117, 154 => 46, 134 => 29, 115 => 12, 101 => 11, 93 => 10, 76 => 9, 72 => 7, 62 => 6, 51 => 2, 49 => 4, 36 => 2,);
}
public function getSourceContext()
{
return new Source("
{% 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() {
\$('.ec-blockFavoriteBtn').on(\"click\", function(e) {
e.stopImmediatePropagation();
e.preventDefault();
var \$form = \$(this).parents('form.ec-favoriteForm');
\$form.attr('action', \$(this).attr(\"data-action\"));
\$form.attr('method', \$(this).attr(\"data-method\"));
\$.ajax({
url: \$form.attr('action'),
type: \$form.attr('method'),
dataType: 'json',
}).done(function(data) {
\$(\$form).find(\".ec-blockFavoriteBtnDisable\").removeClass(\"d-none\");
\$(\$form).find(\".ec-blockFavoriteBtn\").addClass(\"d-none\");
}).fail(function(data) {
alert('{{ 'お気に入りの追加に失敗しました。'|trans }}');
});
})
\$('.ec-blockFavoriteBtnDisable').on(\"click\", function(e) {
e.stopImmediatePropagation();
e.preventDefault();
var \$form = \$(this).parents('form.ec-favoriteForm');
\$form.attr('action', \$(this).attr(\"data-action\"));
\$form.attr('method', \$(this).attr(\"data-method\"));
\$.ajax({
url: \$form.attr('action'),
type: \$form.attr('method'),
dataType: 'json',
}).done(function(data) {
\$(\$form).find(\".ec-blockFavoriteBtnDisable\").addClass(\"d-none\");
\$(\$form).find(\".ec-blockFavoriteBtn\").removeClass(\"d-none\");
}).fail(function(data) {
alert('{{ 'お気に入りの追加に失敗しました。'|trans }}');
});
})
// 表示件数を変更
\$('.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();
});
var modalTimer;
\$('.add-cart').on('click', function(e) {
var self = \$(this);
onAddCart(e, \$(this), 1, function() {
var \$form = self.parents('li');
\$form.find(\".ec-productRole__btn--only\").addClass(\"d-none\");
\$form.find(\".ec-productRole__btn--group\").removeClass(\"d-none\");
window.clearTimeout(modalTimer);
\$('.ec-modal').show()
modalTimer = window.setTimeout(function() {
\$('.ec-modal').hide();
}, 1500)
});
});
\$('.minus__btn').on('click', function(e) {
onAddCart(e, \$(this), -1);
})
\$('.plus__btn').on('click', function(e) {
onAddCart(e, \$(this));
})
function onAddCart(e, self, quantity = 1, callback) {
var \$form = \$(self).parents('li').find('form.productForm');
// 個数フォームのチェック
\$form.parent().find('.quantity').val(quantity);
e.preventDefault();
\$.ajax({
url: \$form.attr('action'),
type: \$form.attr('method'),
data: \$form.serialize(),
dataType: 'json',
beforeSend: function(xhr, settings) {
// Buttonを無効にする
\$(self).prop('disabled', true);
}
}).done(function(data) {
// レスポンス内のメッセージをalertで表示
\$.each(data.messages, function() {
\$('#ec-modal-header').text(this);
});
var \$quantityLabelEl = \$(self).parents('li').find('.quantity_label');
\$quantityLabelEl.text(\$quantityLabelEl.text() * 1 + quantity * 1);
if(callback) {
callback();
}
// カートブロックを更新する
\$.ajax({
url: '{{ url('block_cart') }}',
type: 'GET',
dataType: 'html'
}).done(function(html) {
\$('.ec-headerRole__cart').html(html);
});
}).fail(function(data) {
alert('{{ 'カートへの追加に失敗しました。'|trans }}');
\$(self).prop('disabled', false);
}).always(function(data) {
var \$parent = \$(self).parents('li');
let stockVal = \$parent.find('.stock').val() * 1;
var \$quantityLabelEl = \$parent.find('.quantity_label');
var _quantity = \$quantityLabelEl.text() * 1;
if(_quantity == 0) {
// enable minus button
\$(self).prop('disabled', false);
\$parent.find(\".ec-productRole__btn--only\").removeClass(\"d-none\");
\$parent.find(\".ec-productRole__btn--group\").addClass(\"d-none\");
}
if(_quantity > 0 && _quantity < stockVal) {
// Buttonを有効にする
\$(self).prop('disabled', false);
\$parent.find('.plus__btn').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 %}
<ul class=\"breadcrumb w-p\">
<li class=\"breadcrumb__item\">
<a href=\"{{ url('homepage') }}\" class=\"breadcrumb__item__link\">
ホーム
</a>
</li>
<li class=\"breadcrumb__item\">
<p class=\"breadcrumb__item__arrow\">></p>
</li>
<li class=\"breadcrumb__item\">
<p class=\"breadcrumb__item__text\">注目商品一覧</p>
</li>
</ul>
<div class=\"ec-pageHeader contentHeader\">
<h1>{{ '注目商品一覧'|trans }}</h1>
</div>
{% if search_form.category_id.vars.errors|length > 0 %}
<div class=\"ec-searchnavRole\">
<p class=\"errormsg text-danger\">{{ 'ご指定のカテゴリは存在しません'|trans }}</p>
</div>
{% else %}
<div class=\"ec-searchnavRole\">
<form name=\"form1\" id=\"form1\" method=\"get\" action=\"?\">
{% for item in search_form %}
<input type=\"hidden\" id=\"{{ item.vars.id }}\"
name=\"{{ item.vars.full_name }}\"
{% if item.vars.value is not empty %}value=\"{{ item.vars.value }}\" {% endif %}/>
{% endfor %}
</form>
{# <div class=\"ec-searchnavRole__topicpath\">
<ol class=\"ec-topicpath\">
<li class=\"ec-topicpath__item\"><a href=\"{{ url('product_list') }}\">{{ '全て'|trans }}</a>
</li>
{% if Category is not null %}
{% for Path in Category.path %}
<li class=\"ec-topicpath__divider\">|</li>
<li class=\"ec-topicpath__item{% if loop.last %}--active{% endif %}\"><a
href=\"{{ url('product_list') }}?category_id={{ Path.id }}\">{{ Path.name }}</a>
</li>
{% endfor %}
{% endif %}
{% if search_form.vars.value and search_form.vars.value.name %}
<li class=\"ec-topicpath__divider\">|</li>
<li class=\"ec-topicpath__item\">{{ '「%name%」の検索結果'|trans({ '%name%': search_form.vars.value.name }) }}</li>
{% endif %}
</ol>
</div> #}
<div class=\"ec-searchnavRole__infos\">
<div class=\"ec-searchnavRole__counter\">
{% if pagination.totalItemCount > 0 %}
<p class=\"ec-searchnavRole__counter__title\">検索結果</p>
{{ '<p class=\"ec-searchnavRole__counter__number\">%count%件</p>'|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>
<ul class=\"stockList\">
<li class=\"stockList__block\">
<p class=\"stockList__block__text\">在庫あり:</p>
<p class=\"stockList__block__mark\">◎</p>
</li>
<li class=\"stockList__block\">
<p class=\"stockList__block__text\">残りわずか:</p>
<p class=\"stockList__block__mark\">○</p>
</li>
<li class=\"stockList__block\">
<p class=\"stockList__block__text\">取り寄せ:</p>
<p class=\"stockList__block__mark\">■</p>
</li>
</ul>
{% if pagination.totalItemCount > 0 %}
<div class=\"ec-shelfRole\">
<ul class=\"ec-shelfGrid\">
{% for Product in pagination %}
<li class=\"ec-shelfGrid__item\">
<a href=\"{{ url('product_detail', {'id': Product.id}) }}\">
<div class=\"ec-shelfGrid__item-image\">
<img src=\"{{ asset(Product.main_list_image|no_image_product, 'save_image') }}\" alt=\"{{ Product.name }}\" {% if loop.index > 5 %} loading=\"lazy\"{% endif %}>
{% if Product.Tags|length > 0 %}
<ul class=\"ec-shelfGrid__item-tags\">
{% for Tag in Product.Tags %}
<li class=\"ec-shelfGrid__item-tags__tag tag_{{ Tag.id }}\">{{ Tag }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
<p class=\"ec-shelfGrid__item-name\">{{ Product.name }}</p>
{% if is_granted('ROLE_USER') %}
<div class=\"ec-shelfGrid__item-stock\">
<div class=\"ec-shelfGrid__item-stock__block\">
<p class=\"ec-shelfGrid__item-stock__block__title\">
【発送目安】
</p>
<p class=\"ec-shelfGrid__item-stock__block__detail\">
{% if Product.getDeliveryDuration %}
{{Product.getDeliveryDuration.name}}
{% else %}
指定なし
{% endif %}
</p>
</div>
<div class=\"ec-shelfGrid__item-stock__block\">
<p class=\"ec-shelfGrid__item-stock__block__title\">
【在庫】
</p>
{# 在庫をマークで表示何個から何個か◎等はこれから確認 #}
<p class=\"ec-shelfGrid__item-stock__block__detail\">
{% if Product.getStockUnlimitedMin or Product.getStockMin >= 10 %}
◎
{% else %}
{% if Product.getStockMin >= 1 and Product.getStockMin <= 9 %}
○
{% endif %}
{% if Product.getStockMin <= 0 %}
■
{% endif %}
{% endif %}
</p>
</div>
</div>
{# {% if not Product.getStockUnlimitedMin %}
<p>
発送可能{{Product.getStockMin}}個
</p>
{% endif %} #}
{% if Product.description_list %}
<p>{{ Product.description_list|raw|nl2br }}</p>
{% endif %}
<div class=\"ec-shelfGrid__item-flex\">
<p class=\"price02-default ec-shelfGrid__item-price\">
{% if Product.hasProductClass %}
{% if Product.getPrice02Min == Product.getPrice02Max %}
{{ Product.getPrice02IncTaxMin|price }}
{% else %}
{{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}
{% endif %}
{% else %}
{{ Product.getPrice02IncTaxMin|price }}
{% endif %}
</p>
{% if is_granted('ROLE_USER') %}
<div class=\"ec-shelfGrid__item-flex__favorite\">
<form class=\"ec-favoriteForm\" action=\"?\" method=\"?\">
<div class=\"ec-productRole__btn\">
<button data-method=\"POST\" data-action=\"{{ url('product_add_favorite', {id:Product.id}) }}\" id=\"favorite\" class=\"{% if isFavorite[Product.id] is defined and isFavorite[Product.id] == true %} d-none {% endif %} ec-blockFavoriteBtn ec-blockBtn--cancel ec-shelfGrid__item-flex__favorite__btn\">
<img src=\"{{ asset('assets/img/favorite/before.svg') }}\" alt=\"お気に入り\" width=\"24\" height=\"24\" loading=\"lazy\">
</button>
<button data-method=\"DELETE\" data-action=\"{{ url('product_favorite_delete', {id:Product.id}) }}\" id=\"favorite\" class=\"{% if isFavorite[Product.id] is defined and isFavorite[Product.id] == false %} d-none {% endif %}ec-blockFavoriteBtnDisable ec-blockBtn--cancel ec-shelfGrid__item-flex__favorite__btn\">
<img src=\"{{ asset('assets/img/favorite/after.svg') }}\" alt=\"お気に入り\" width=\"24\" height=\"24\" loading=\"lazy\">
</button>
</div>
</form>
</div>
{% endif %}
</div>
</a>
{% if not Product.getStockUnlimitedMin and Product.getStockMin <= 0 and Product.isStockDiscontinued %}
<div class=\"ec-productRole__btn\">
<button type=\"button\" class=\"ec-disabled__btn\" disabled=\"disabled\">
{{ '在庫なし'|trans }}
</button>
</div>
{% else %}
{% set form = forms[Product.id] %}
<form class=\"productForm\" 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 d-none\"><span>{{ '数量'|trans }}</span>
{{ form_widget(form.quantity, {'attr': {'class': 'quantity'}} ) }}
{{ form_errors(form.quantity) }}
</div>
</div>
{{ form_rest(form) }}
</form>
{% set default = 0 %}
{% if itemInCart[Product.id] is defined %}
{% set default = itemInCart[Product.id] %}
{% endif %}
{% set disabled = false %}
{% if not Product.isStockDiscontinued %}
<input type=\"hidden\" name=\"stock\" class=\"stock\" value=\"999999999999\">
{% else %}
{% if Product.getStockMin <= default %}
{% set disabled = true %}
{% endif %}
<input type=\"hidden\" name=\"stock\" class=\"stock\" value=\"{{Product.getStockMin}}\">
{% endif %}
<div class=\"ec-productRole__btn--group ec-productRole__btn {% if itemInCart[Product.id] is defined %} d-block {% else %} d-none {% endif %}\">
<div class=\"d-flex align-items-center ec-productRole__btn-wrapper\">
<button class=\"minus__btn\" data-cartid=\"{{ Product.id }}\" form=\"productForm{{ Product.id }}\">
<span>−</span>
</button>
<span class=\"quantity_label\">{{ default }}</span>
<button class=\"plus__btn\" data-cartid=\"{{ Product.id }}\" form=\"productForm{{ Product.id }}\" {% if disabled %}disabled{% endif %}>
<span>+</span>
</button>
</div>
</div>
<div class=\"ec-productRole__btn--only ec-productRole__btn {% if itemInCart[Product.id] is defined %} d-none {% else %} d-block {% endif %}\">
<button type=\"submit\" class=\"ec-regular__btn add-cart\" data-cartid=\"{{ Product.id }}\" form=\"productForm{{ Product.id }}\">
{{ 'カートに入れる'|trans }}
</button>
</div>
{% endif %}
{% else %}
<a href=\"{{ url('entry_contact') }}\" class=\"ec-blockProductBtn--action\">会員登録はこちら</a>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
<div class=\"ec-modal\">
<div class=\"ec-modal-overlay\">
<div class=\"ec-modal-wrap\">
<div class=\"ec-modal-box\">
<div class=\"ec-role\">
<div class=\"ec-modal-icon\">
<img src=\"{{ asset('assets/img/icon/icon_cart.png', 'user_data') }}\" alt=\"\">
</div>
</div>
</div>
<div id=\"ec-modal-header\" class=\"text-center\">{{ 'カートに追加しました。'|trans }}</div>
</div>
</div>
</div>
<ul class=\"stockList bottom\">
<li class=\"stockList__block\">
<p class=\"stockList__block__text\">在庫あり:</p>
<p class=\"stockList__block__mark\">◎</p>
</li>
<li class=\"stockList__block\">
<p class=\"stockList__block__text\">残りわずか:</p>
<p class=\"stockList__block__mark\">○</p>
</li>
<li class=\"stockList__block\">
<p class=\"stockList__block__text\">取り寄せ:</p>
<p class=\"stockList__block__mark\">■</p>
</li>
</ul>
<div class=\"ec-pagerRole\">
{% include \"pager.twig\" with {'pages': pagination.paginationData} %}
</div>
{% endif %}
{% endif %}
{% endblock %}
", "@Recommend42/Product/list.twig", "/home/bravers/bravers.xbiz.jp/public_html/app/Plugin/Recommend42/Resource/template/Product/list.twig");
}
}