<?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/current_weekly_recommend_product.twig */
class __TwigTemplate_e7a30c23925eaa1ac089ab5aedc05142 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 = [
];
$this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension');
$this->checkSecurity();
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Block/current_weekly_recommend_product.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Block/current_weekly_recommend_product.twig"));
// line 1
$context["recommend_products"] = twig_get_attribute($this->env, $this->source, $this->env->getFunction('repository')->getCallable()("Plugin\\Recommend42\\Entity\\RecommendProduct"), "getRecommendProduct", [], "any", false, false, true, 1);
// line 2
echo "<!-- ▼item_list▼ -->
<div class=\"block_outer\">
<div class=\"ec-shelfRole current-month__recommendation\" id=\"ranking_area\">
<h2 class=\"illust-title\"><img src=\"";
// line 5
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/icon/icon_book_green.png", "user_data"), "html", null, true);
echo "\" alt=\"今週のオススメ\" class=\"aligncenter\" />今週のおすすめ</h2>
<div class=\"block_body\">
<ul class=\"ec-shelfGrid flex\">
";
// line 8
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["recommend_products"]) || array_key_exists("recommend_products", $context) ? $context["recommend_products"] : (function () { throw new RuntimeError('Variable "recommend_products" does not exist.', 8, $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["RecommendProducts"]) {
// line 9
echo " ";
// line 10
echo " ";
$context["newTag"] = false;
// line 11
echo " ";
if ( !(null === twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["RecommendProducts"], "Product", [], "any", false, false, true, 11), "Tags", [], "any", false, false, true, 11))) {
// line 12
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["RecommendProducts"], "Product", [], "any", false, false, true, 12), "Tags", [], "any", false, false, true, 12));
foreach ($context['_seq'] as $context["_key"] => $context["tag"]) {
// line 13
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["tag"], "id", [], "any", false, false, true, 13) == 1)) {
// line 14
echo " ";
$context["newTag"] = true;
// line 15
echo " ";
}
// line 16
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['tag'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 17
echo " ";
}
// line 18
echo " <li class=\"ec-shelfGrid__item rank-item flex";
if ((isset($context["newTag"]) || array_key_exists("newTag", $context) ? $context["newTag"] : (function () { throw new RuntimeError('Variable "newTag" does not exist.', 18, $this->source); })())) {
echo " newtag";
}
echo "\" id=\"rank";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, true, 18), 18, $this->source), "html", null, true);
echo "\">
<a href=\"";
// line 19
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_detail", ["id" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["RecommendProducts"], "Product", [], "any", false, false, true, 19), "id", [], "any", false, false, true, 19)]), "html", null, true);
echo "\">
";
// line 21
echo " <div class=\"productImage\"><img class=\"rankpicture\" src=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["RecommendProducts"], "Product", [], "any", false, false, true, 21), "mainFileName", [], "any", false, false, true, 21), 21, $this->source)), "save_image"), "html", null, true);
echo "\"></div>
";
// line 23
echo " <div class=\"productContents\">
<p class=\"product-subname\">";
// line 24
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["RecommendProducts"], "Product", [], "any", false, false, true, 24), "SubNameUp", [], "any", false, false, true, 24), 24, $this->source), "html", null, true);
echo "</p>
<h3>";
// line 25
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["RecommendProducts"], "Product", [], "any", false, false, true, 25), "name", [], "any", false, false, true, 25), 25, $this->source), "html", null, true);
echo "</h3>
<p class=\"product-subname\">";
// line 26
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["RecommendProducts"], "Product", [], "any", false, false, true, 26), "SubNameDown", [], "any", false, false, true, 26), 26, $this->source), "html", null, true);
echo "</p>
";
// line 27
if ((twig_get_attribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, true, 27) == 1)) {
// line 28
echo "\t\t\t\t\t\t<p class=\"productPrice\">定価:
<span class=\"sale_price\">
";
// line 30
if (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["RecommendProducts"], "Product", [], "any", false, false, true, 30), "hasProductClass", [], "any", false, false, true, 30)) {
// line 31
echo " ";
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["RecommendProducts"], "Product", [], "any", false, false, true, 31), "getPrice02Min", [], "any", false, false, true, 31) == twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["RecommendProducts"], "Product", [], "any", false, false, true, 31), "getPrice02Max", [], "any", false, false, true, 31))) {
// line 32
echo " ";
echo twig_escape_filter($this->env, twig_number_format_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["RecommendProducts"], "Product", [], "any", false, false, true, 32), "getPrice02IncTaxMin", [], "any", false, false, true, 32), 32, $this->source)), "html", null, true);
echo "円
";
} else {
// line 34
echo " ";
echo twig_escape_filter($this->env, twig_number_format_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["RecommendProducts"], "Product", [], "any", false, false, true, 34), "getPrice02IncTaxMin", [], "any", false, false, true, 34), 34, $this->source)), "html", null, true);
echo "円 ~ ";
echo twig_escape_filter($this->env, twig_number_format_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["RecommendProducts"], "Product", [], "any", false, false, true, 34), "getPrice02IncTaxMax", [], "any", false, false, true, 34), 34, $this->source)), "html", null, true);
echo "円
";
}
// line 36
echo " ";
} else {
// line 37
echo " ";
echo twig_escape_filter($this->env, twig_number_format_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["RecommendProducts"], "Product", [], "any", false, false, true, 37), "getPrice02IncTaxMin", [], "any", false, false, true, 37), 37, $this->source)), "html", null, true);
echo "円
";
}
// line 39
echo " </span>
</p>
";
}
// line 42
echo " </div>
</a>
</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['RecommendProducts'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 46
echo " </ul>
</div>
</div>
</div>
<!-- ▲item_list▲ -->";
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
public function getTemplateName()
{
return "Block/current_weekly_recommend_product.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 195 => 46, 178 => 42, 173 => 39, 167 => 37, 164 => 36, 156 => 34, 150 => 32, 147 => 31, 145 => 30, 141 => 28, 139 => 27, 135 => 26, 131 => 25, 127 => 24, 124 => 23, 119 => 21, 115 => 19, 106 => 18, 103 => 17, 97 => 16, 94 => 15, 91 => 14, 88 => 13, 83 => 12, 80 => 11, 77 => 10, 75 => 9, 58 => 8, 52 => 5, 47 => 2, 45 => 1,);
}
public function getSourceContext()
{
return new Source("{% set recommend_products = repository('Plugin\\\\Recommend42\\\\Entity\\\\RecommendProduct').getRecommendProduct %}
<!-- ▼item_list▼ -->
<div class=\"block_outer\">
<div class=\"ec-shelfRole current-month__recommendation\" id=\"ranking_area\">
<h2 class=\"illust-title\"><img src=\"{{ asset('assets/img/icon/icon_book_green.png', 'user_data') }}\" alt=\"今週のオススメ\" class=\"aligncenter\" />今週のおすすめ</h2>
<div class=\"block_body\">
<ul class=\"ec-shelfGrid flex\">
{% for RecommendProducts in recommend_products %}
{# タグ #}
{% set newTag = false %}
{% if RecommendProducts.Product.Tags is not null %}
{% for tag in RecommendProducts.Product.Tags %}
{% if tag.id == 1 %}
{% set newTag = true %}
{% endif %}
{% endfor %}
{% endif %}
<li class=\"ec-shelfGrid__item rank-item flex{% if newTag %} newtag{% endif %}\" id=\"rank{{ loop.index }}\">
<a href=\"{{ url('product_detail', {'id': RecommendProducts.Product.id}) }}\">
{# 画像 #}
<div class=\"productImage\"><img class=\"rankpicture\" src=\"{{ asset(RecommendProducts.Product.mainFileName|no_image_product, \"save_image\") }}\"></div>
{# その他 #}
<div class=\"productContents\">
<p class=\"product-subname\">{{ RecommendProducts.Product.SubNameUp }}</p>
<h3>{{ RecommendProducts.Product.name }}</h3>
<p class=\"product-subname\">{{ RecommendProducts.Product.SubNameDown }}</p>
{% if loop.index == 1 %}
\t\t\t\t\t\t<p class=\"productPrice\">定価:
<span class=\"sale_price\">
{% if RecommendProducts.Product.hasProductClass %}
{% if RecommendProducts.Product.getPrice02Min == RecommendProducts.Product.getPrice02Max %}
{{ RecommendProducts.Product.getPrice02IncTaxMin|number_format }}円
{% else %}
{{ RecommendProducts.Product.getPrice02IncTaxMin|number_format }}円 ~ {{ RecommendProducts.Product.getPrice02IncTaxMax|number_format }}円
{% endif %}
{% else %}
{{ RecommendProducts.Product.getPrice02IncTaxMin|number_format }}円
{% endif %}
</span>
</p>
{% endif %}
</div>
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
<!-- ▲item_list▲ -->", "Block/current_weekly_recommend_product.twig", "/home/higashiyamashobo/www/higashiyamashobo.jpn.org/ec-cube/app/template/default/Block/current_weekly_recommend_product.twig");
}
public function checkSecurity()
{
static $tags = array("set" => 1, "for" => 8, "if" => 11);
static $filters = array("escape" => 5, "no_image_product" => 21, "number_format" => 32);
static $functions = array("repository" => 1, "asset" => 5, "url" => 19);
try {
$this->sandbox->checkSecurity(
['set', 'for', 'if'],
['escape', 'no_image_product', 'number_format'],
['repository', 'asset', 'url']
);
} catch (SecurityError $e) {
$e->setSourceContext($this->source);
if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
$e->setTemplateLine($tags[$e->getTagName()]);
} elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
$e->setTemplateLine($filters[$e->getFilterName()]);
} elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
$e->setTemplateLine($functions[$e->getFunctionName()]);
}
throw $e;
}
}
}