<?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;
/* Block/recommend_product_block.twig */
class __TwigTemplate_e8ceb37c98a92531508dcdb6dfbcc3b2417e71d813def938c769ff2369ef1bf0 extends \Eccube\Twig\Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
}
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", "Block/recommend_product_block.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Block/recommend_product_block.twig"));
// line 9
echo "<div class=\"topBlocks\">
<div class=\"titleBlock\">
<div class=\"titleBlock__name\">
<img class=\"titleBlock__name__icon\" src=\"";
// line 12
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/top/recommend.svg"), "html", null, true);
echo "\" alt=\"注目商品\" width=\"32\" height=\"27\" loading=\"lazy\">
<h2 class=\"titleBlock__name__title\">注目商品</h2>
</div>
<a href=\"";
// line 15
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_recommend");
echo "?orderby=4\" class=\"titleBlock__link\">もっとみる</a>
</div>
<div class=\"topBlocks__scroll\">
";
// line 18
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["Products"]) || array_key_exists("Products", $context) ? $context["Products"] : (function () { throw new RuntimeError('Variable "Products" does not exist.', 18, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["RecommendProduct"]) {
// line 19
echo " ";
$context["Product"] = twig_get_attribute($this->env, $this->source, $context["RecommendProduct"], "Product", [], "any", false, false, false, 19);
// line 20
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.', 20, $this->source); })()), twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 20, $this->source); })()), "id", [], "any", false, false, false, 20), [], "array", false, false, false, 20);
// line 21
echo " <div class=\"topBlocks__item popular-item\">
";
// line 22
$context["default"] = 0;
// line 23
echo " ";
if (twig_get_attribute($this->env, $this->source, ($context["recommendItemInCart"] ?? null), twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 23, $this->source); })()), "id", [], "any", false, false, false, 23), [], "array", true, true, false, 23)) {
// line 24
echo " ";
$context["default"] = twig_get_attribute($this->env, $this->source, (isset($context["recommendItemInCart"]) || array_key_exists("recommendItemInCart", $context) ? $context["recommendItemInCart"] : (function () { throw new RuntimeError('Variable "recommendItemInCart" does not exist.', 24, $this->source); })()), twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 24, $this->source); })()), "id", [], "any", false, false, false, 24), [], "array", false, false, false, 24);
// line 25
echo " ";
}
// line 26
echo " ";
$context["disabled"] = false;
// line 27
echo " ";
if ( !twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 27, $this->source); })()), "isStockDiscontinued", [], "any", false, false, false, 27)) {
// line 28
echo " <input type=\"hidden\" name=\"stock\" class=\"stock\" value=\"999999999999\">
";
} else {
// line 30
echo " ";
if ((twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 30, $this->source); })()), "getStockMin", [], "any", false, false, false, 30) <= (isset($context["default"]) || array_key_exists("default", $context) ? $context["default"] : (function () { throw new RuntimeError('Variable "default" does not exist.', 30, $this->source); })()))) {
// line 31
echo " ";
$context["disabled"] = true;
// line 32
echo " ";
}
// line 33
echo " <input type=\"hidden\" name=\"stock\" class=\"stock\" value=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 33, $this->source); })()), "getStockMin", [], "any", false, false, false, 33), "html", null, true);
echo "\">
";
}
// line 35
echo " <div class=\"topBlocks__form\">
<a href=\"";
// line 36
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_detail", ["id" => twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 36, $this->source); })()), "id", [], "any", false, false, false, 36)]), "html", null, true);
echo "\" role=\"group\" >
<div class=\"topBlocks__item__image\">
<img src=\"";
// line 38
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, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 38, $this->source); })()), "main_list_image", [], "any", false, false, false, 38)), "save_image"), "html", null, true);
echo "\" alt=\" ";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 38, $this->source); })()), "name", [], "any", false, false, false, 38), "html", null, true);
echo "\">
";
// line 39
if ((twig_length_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 39, $this->source); })()), "Tags", [], "any", false, false, false, 39)) > 0)) {
// line 40
echo " <ul class=\"topBlocks__item__image__tags\">
";
// line 41
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 41, $this->source); })()), "Tags", [], "any", false, false, false, 41));
foreach ($context['_seq'] as $context["_key"] => $context["Tag"]) {
// line 42
echo " <li class=\"topBlocks__item__image__tags__tag tag_";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Tag"], "id", [], "any", false, false, false, 42), "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 44
echo " </ul>
";
}
// line 46
echo " </div>
<p class=\"topBlocks__item__name\">
";
// line 48
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 48, $this->source); })()), "name", [], "any", false, false, false, 48), "html", null, true);
echo "
</p>
";
// line 50
if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_USER")) {
// line 51
echo " <div class=\"topBlocks__item__flex\">
<div class=\"topBlocks__item__price\">
";
// line 53
if (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 53, $this->source); })()), "isInSale", [], "any", false, false, false, 53)) {
// line 54
echo " <p class=\"topBlocks__item__price__sale\">セール商品</p>
";
}
// line 56
echo " ";
if (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 56, $this->source); })()), "hasProductClass", [], "any", false, false, false, 56)) {
// line 57
echo " ";
if ((twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 57, $this->source); })()), "getPrice02Min", [], "any", false, false, false, 57) == twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 57, $this->source); })()), "getPrice02Max", [], "any", false, false, false, 57))) {
// line 58
echo " ";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 58, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, false, 58)), "html", null, true);
echo "(税込)
";
} else {
// line 60
echo " ";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 60, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, false, 60)), "html", null, true);
echo " ~ <span>";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 60, $this->source); })()), "getPrice02IncTaxMax", [], "any", false, false, false, 60)), "html", null, true);
echo "(税込)</span>
";
}
// line 62
echo " ";
} else {
// line 63
echo " ";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 63, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, false, 63)), "html", null, true);
echo "(税込)
";
}
// line 65
echo " </div>
<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 69
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, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 69, $this->source); })()), "id", [], "any", false, false, false, 69)]), "html", null, true);
echo "\" id=\"favorite\" class=\"";
if ((twig_get_attribute($this->env, $this->source, ($context["isRecommendFavorite"] ?? null), twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 69, $this->source); })()), "id", [], "any", false, false, false, 69), [], "array", true, true, false, 69) && (twig_get_attribute($this->env, $this->source, (isset($context["isRecommendFavorite"]) || array_key_exists("isRecommendFavorite", $context) ? $context["isRecommendFavorite"] : (function () { throw new RuntimeError('Variable "isRecommendFavorite" does not exist.', 69, $this->source); })()), twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 69, $this->source); })()), "id", [], "any", false, false, false, 69), [], "array", false, false, false, 69) == true))) {
echo " d-none ";
}
echo " topBlocks__item__favorite ec-blockFavoriteBtn ec-blockBtn--cancel ec-shelfGrid__item-flex__favorite__btn\">
<img src=\"";
// line 70
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 72
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, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 72, $this->source); })()), "id", [], "any", false, false, false, 72)]), "html", null, true);
echo "\" id=\"favorite\" class=\"";
if ((twig_get_attribute($this->env, $this->source, ($context["isRecommendFavorite"] ?? null), twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 72, $this->source); })()), "id", [], "any", false, false, false, 72), [], "array", true, true, false, 72) && (twig_get_attribute($this->env, $this->source, (isset($context["isRecommendFavorite"]) || array_key_exists("isRecommendFavorite", $context) ? $context["isRecommendFavorite"] : (function () { throw new RuntimeError('Variable "isRecommendFavorite" does not exist.', 72, $this->source); })()), twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 72, $this->source); })()), "id", [], "any", false, false, false, 72), [], "array", false, false, false, 72) == false))) {
echo " d-none ";
}
echo " topBlocks__item__favorite ec-blockFavoriteBtnDisable ec-blockBtn--cancel ec-shelfGrid__item-flex__favorite__btn\">
<img src=\"";
// line 73
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>
</div>
";
}
// line 80
echo " </a>
";
// line 81
if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_USER")) {
// line 82
echo " <form class=\"topBlocks__form\" name=\"form";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 82, $this->source); })()), "id", [], "any", false, false, false, 82), "html", null, true);
echo "\" id=\"recommendProductForm";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 82, $this->source); })()), "id", [], "any", false, false, false, 82), "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, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 82, $this->source); })()), "id", [], "any", false, false, false, 82)]), "html", null, true);
echo "\" method=\"post\">
";
// line 83
if ((( !twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 83, $this->source); })()), "getStockUnlimitedMin", [], "any", false, false, false, 83) && (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 83, $this->source); })()), "getStockMin", [], "any", false, false, false, 83) <= 0)) && twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 83, $this->source); })()), "isStockDiscontinued", [], "any", false, false, false, 83))) {
// line 84
echo " <div class=\"ec-productRole__btn\">
<button type=\"button\" class=\"ec-disabled__btn\" disabled=\"disabled\">
";
// line 86
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("在庫なし"), "html", null, true);
echo "
</button>
</div>
";
} else {
// line 90
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 91
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.', 91, $this->source); })()), "quantity", [], "any", false, false, false, 91), 'widget', ["attr" => ["class" => "quantity"]]);
echo "
";
// line 92
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.', 92, $this->source); })()), "quantity", [], "any", false, false, false, 92), 'errors');
echo "
</div>
<div class=\"d-none\">
";
// line 95
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.', 95, $this->source); })()), 'rest');
echo "
</div>
<div class=\"ec-productRole__btn--group ec-productRole__btn ";
// line 97
if (twig_get_attribute($this->env, $this->source, ($context["recommendItemInCart"] ?? null), twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 97, $this->source); })()), "id", [], "any", false, false, false, 97), [], "array", true, true, false, 97)) {
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 99
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 99, $this->source); })()), "id", [], "any", false, false, false, 99), "html", null, true);
echo "\" form=\"productForm";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 99, $this->source); })()), "id", [], "any", false, false, false, 99), "html", null, true);
echo "\">
<span>−</span>
</button>
<span class=\"quantity_label quantity_label_";
// line 102
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 102, $this->source); })()), "id", [], "any", false, false, false, 102), "html", null, true);
echo "\">";
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.', 102, $this->source); })()), "html", null, true);
echo "</span>
<button class=\"plus__btn\" data-cartid=\"";
// line 103
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 103, $this->source); })()), "id", [], "any", false, false, false, 103), "html", null, true);
echo "\" form=\"productForm";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 103, $this->source); })()), "id", [], "any", false, false, false, 103), "html", null, true);
echo "\" ";
if ((isset($context["disabled"]) || array_key_exists("disabled", $context) ? $context["disabled"] : (function () { throw new RuntimeError('Variable "disabled" does not exist.', 103, $this->source); })())) {
echo "disabled";
}
echo ">
<span>+</span>
</button>
</div>
</div>
<div class=\"ec-productRole__btn--only ec-productRole__btn ";
// line 108
if (twig_get_attribute($this->env, $this->source, ($context["recommendItemInCart"] ?? null), twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 108, $this->source); })()), "id", [], "any", false, false, false, 108), [], "array", true, true, false, 108)) {
echo " d-none ";
} else {
echo " d-block ";
}
echo "\">
<button type=\"submit\" class=\"ec-regular__btn add-recommend-cart\" data-cartid=\"";
// line 109
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 109, $this->source); })()), "id", [], "any", false, false, false, 109), "html", null, true);
echo "\" form=\"productForm";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 109, $this->source); })()), "id", [], "any", false, false, false, 109), "html", null, true);
echo "\">
";
// line 110
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートに入れる"), "html", null, true);
echo "
</button>
</div>
";
}
// line 114
echo " </form>
";
}
// line 116
echo " </div>
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['RecommendProduct'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 119
echo " <div class=\"ec-modal ec-recommend-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 125
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 129
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートに追加しました。"), "html", null, true);
echo "</div>
</div>
</div>
</div>
</div>
</div>
<script>
\$('.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()
});
var modalTimer;
\$('.add-recommend-cart').on('click', function(e) {
var self = \$(this);
onAddCart(e, \$(this), 1, function() {
checkRenderButton();
window.clearTimeout(modalTimer);
\$('.ec-modal.ec-recommend-modal').show()
modalTimer = window.setTimeout(function() {
\$('.ec-modal').hide();
}, 1500)
});
});
\$(document).on('click', '.minus__btn', function(e) {
e.preventDefault();
e.stopPropagation();
onAddCart(e, \$(this), -1);
})
\$('.plus__btn').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
onAddCart(e, \$(this), 1);
});
</script>
";
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
}
public function getTemplateName()
{
return "Block/recommend_product_block.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 366 => 129, 359 => 125, 351 => 119, 343 => 116, 339 => 114, 332 => 110, 326 => 109, 318 => 108, 304 => 103, 298 => 102, 290 => 99, 281 => 97, 276 => 95, 270 => 92, 266 => 91, 261 => 90, 254 => 86, 250 => 84, 248 => 83, 239 => 82, 237 => 81, 234 => 80, 224 => 73, 216 => 72, 211 => 70, 203 => 69, 197 => 65, 191 => 63, 188 => 62, 180 => 60, 174 => 58, 171 => 57, 168 => 56, 164 => 54, 162 => 53, 158 => 51, 156 => 50, 151 => 48, 147 => 46, 143 => 44, 132 => 42, 128 => 41, 125 => 40, 123 => 39, 117 => 38, 112 => 36, 109 => 35, 103 => 33, 100 => 32, 97 => 31, 94 => 30, 90 => 28, 87 => 27, 84 => 26, 81 => 25, 78 => 24, 75 => 23, 73 => 22, 70 => 21, 67 => 20, 64 => 19, 60 => 18, 54 => 15, 48 => 12, 43 => 9,);
}
public function getSourceContext()
{
return new Source("{#
* This file is part of the Recommend Product plugin
*
* Copyright (C) EC-CUBE CO.,LTD. All Rights Reserved.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
#}
<div class=\"topBlocks\">
<div class=\"titleBlock\">
<div class=\"titleBlock__name\">
<img class=\"titleBlock__name__icon\" src=\"{{ asset('assets/img/top/recommend.svg') }}\" alt=\"注目商品\" width=\"32\" height=\"27\" loading=\"lazy\">
<h2 class=\"titleBlock__name__title\">注目商品</h2>
</div>
<a href=\"{{ url('product_recommend') }}?orderby=4\" class=\"titleBlock__link\">もっとみる</a>
</div>
<div class=\"topBlocks__scroll\">
{% for RecommendProduct in Products %}
{% set Product = RecommendProduct.Product %}
{% set form = forms[Product.id] %}
<div class=\"topBlocks__item popular-item\">
{% set default = 0 %}
{% if recommendItemInCart[Product.id] is defined %}
{% set default = recommendItemInCart[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=\"topBlocks__form\">
<a href=\"{{ url('product_detail', {'id': Product.id}) }}\" role=\"group\" >
<div class=\"topBlocks__item__image\">
<img src=\"{{ asset(Product.main_list_image|no_image_product, 'save_image') }}\" alt=\" {{Product.name}}\">
{% if Product.Tags|length > 0 %}
<ul class=\"topBlocks__item__image__tags\">
{% for Tag in Product.Tags %}
<li class=\"topBlocks__item__image__tags__tag tag_{{ Tag.id }}\">{{ Tag }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
<p class=\"topBlocks__item__name\">
{{Product.name}}
</p>
{% if is_granted('ROLE_USER') %}
<div class=\"topBlocks__item__flex\">
<div class=\"topBlocks__item__price\">
{% if Product.isInSale %}
<p class=\"topBlocks__item__price__sale\">セール商品</p>
{% endif %}
{% if Product.hasProductClass %}
{% if Product.getPrice02Min == Product.getPrice02Max %}
{{ Product.getPrice02IncTaxMin|price }}(税込)
{% else %}
{{ Product.getPrice02IncTaxMin|price }} ~ <span>{{ Product.getPrice02IncTaxMax|price }}(税込)</span>
{% endif %}
{% else %}
{{ Product.getPrice02IncTaxMin|price }}(税込)
{% endif %}
</div>
<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 isRecommendFavorite[Product.id] is defined and isRecommendFavorite[Product.id] == true %} d-none {% endif %} topBlocks__item__favorite 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 isRecommendFavorite[Product.id] is defined and isRecommendFavorite[Product.id] == false %} d-none {% endif %} topBlocks__item__favorite 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>
</div>
{% endif %}
</a>
{% if is_granted('ROLE_USER') %}
<form class=\"topBlocks__form\" name=\"form{{ Product.id }}\" id=\"recommendProductForm{{ Product.id }}\" action=\"{{ url('product_add_cart', {id:Product.id}) }}\" method=\"post\">
{% 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 %}
<div class=\"ec-numberInput d-none\"><span>{{ '数量'|trans }}</span>
{{ form_widget(form.quantity, {'attr': {'class': 'quantity'}} ) }}
{{ form_errors(form.quantity) }}
</div>
<div class=\"d-none\">
{{ form_rest(form) }}
</div>
<div class=\"ec-productRole__btn--group ec-productRole__btn {% if recommendItemInCart[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 quantity_label_{{ Product.id }}\">{{ 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 recommendItemInCart[Product.id] is defined %} d-none {% else %} d-block {% endif %}\">
<button type=\"submit\" class=\"ec-regular__btn add-recommend-cart\" data-cartid=\"{{ Product.id }}\" form=\"productForm{{ Product.id }}\">
{{ 'カートに入れる'|trans }}
</button>
</div>
{% endif %}
</form>
{% endif %}
</div>
</div>
{% endfor %}
<div class=\"ec-modal ec-recommend-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>
</div>
</div>
<script>
\$('.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()
});
var modalTimer;
\$('.add-recommend-cart').on('click', function(e) {
var self = \$(this);
onAddCart(e, \$(this), 1, function() {
checkRenderButton();
window.clearTimeout(modalTimer);
\$('.ec-modal.ec-recommend-modal').show()
modalTimer = window.setTimeout(function() {
\$('.ec-modal').hide();
}, 1500)
});
});
\$(document).on('click', '.minus__btn', function(e) {
e.preventDefault();
e.stopPropagation();
onAddCart(e, \$(this), -1);
})
\$('.plus__btn').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
onAddCart(e, \$(this), 1);
});
</script>
", "Block/recommend_product_block.twig", "/home/bravers/bravers.xbiz.jp/public_html/app/template/bravers/Block/recommend_product_block.twig");
}
}