<?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;
/* @SyliusShop/Taxon/verticalMenu.html.twig */
class __TwigTemplate_24be4b03932eaa6419f85b10bba41ba4 extends \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_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@SyliusShop/Taxon/verticalMenu.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@SyliusShop/Taxon/verticalMenu.html.twig"));
// line 1
$context["registerProductsLink"] = $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("sylius_shop_login");
// line 2
if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_USER")) {
// line 3
echo " ";
if ((((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["app"] ?? null), "user", [], "any", false, true, false, 3), "customer", [], "any", false, true, false, 3), "organization", [], "any", false, true, false, 3), "vendor", [], "any", true, true, false, 3)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["app"] ?? null), "user", [], "any", false, true, false, 3), "customer", [], "any", false, true, false, 3), "organization", [], "any", false, true, false, 3), "vendor", [], "any", false, false, false, 3), null)) : (null)) == null)) {
// line 4
echo " ";
$context["registerProductsLink"] = $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("open_marketplace_vendor_register_form");
// line 5
echo " ";
} else {
// line 6
echo " ";
$context["registerProductsLink"] = $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("open_marketplace_vendor_product_listings_index");
// line 7
echo " ";
}
}
// line 28
echo "
";
// line 29
$macros["macros"] = $this->macros["macros"] = $this;
// line 30
echo "
";
// line 31
if ((twig_length_filter($this->env, (isset($context["taxons"]) || array_key_exists("taxons", $context) ? $context["taxons"] : (function () { throw new RuntimeError('Variable "taxons" does not exist.', 31, $this->source); })())) > 0)) {
// line 32
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["taxons"]) || array_key_exists("taxons", $context) ? $context["taxons"] : (function () { throw new RuntimeError('Variable "taxons" does not exist.', 32, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["taxon"]) {
// line 33
echo " ";
echo twig_call_macro($macros["macros"], "macro_item", [$context["taxon"]], 33, $context, $this->getSourceContext());
echo "
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['taxon'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 35
echo " ";
echo $this->env->getRuntime('Symfony\Bridge\Twig\Extension\HttpKernelRuntime')->renderFragment($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("open_marketplace_shop_render_country_menu", ["template" => "@SyliusShop/Layout/Sidebar/Menu/country.html.twig"]));
echo "
<a href=\"";
// line 36
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("open_marketplace_shop_vendor_index");
echo "\" class=\"accordion-link item font-bold\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("app.ui.brands"), "html", null, true);
echo "</a>
";
// line 37
echo $this->env->getRuntime('Symfony\Bridge\Twig\Extension\HttpKernelRuntime')->renderFragment($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("open_marketplace_shop_render_use_case_menu", ["template" => "@SyliusShop/Layout/Sidebar/Menu/useCase.html.twig"]));
echo "
<a href=\"";
// line 38
echo twig_escape_filter($this->env, (isset($context["registerProductsLink"]) || array_key_exists("registerProductsLink", $context) ? $context["registerProductsLink"] : (function () { throw new RuntimeError('Variable "registerProductsLink" does not exist.', 38, $this->source); })()), "html", null, true);
echo "\" class=\"accordion-link item font-bold\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("app.ui.register_products"), "html", null, true);
echo "</a>
";
}
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 9
public function macro_item($__taxon__ = null, ...$__varargs__)
{
$macros = $this->macros;
$context = $this->env->mergeGlobals([
"taxon" => $__taxon__,
"varargs" => $__varargs__,
]);
$blocks = [];
ob_start();
try {
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "item"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "item"));
// line 10
echo " ";
$macros["macros"] = $this;
// line 11
echo " ";
$context["children"] = twig_get_attribute($this->env, $this->source, (isset($context["taxon"]) || array_key_exists("taxon", $context) ? $context["taxon"] : (function () { throw new RuntimeError('Variable "taxon" does not exist.', 11, $this->source); })()), "getEnabledChildrenByTranslationName", [0 => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["taxon"]) || array_key_exists("taxon", $context) ? $context["taxon"] : (function () { throw new RuntimeError('Variable "taxon" does not exist.', 11, $this->source); })()), "translation", [], "any", false, false, false, 11), "locale", [], "any", false, false, false, 11)], "method", false, false, false, 11);
// line 12
echo " ";
if ((twig_length_filter($this->env, (isset($context["children"]) || array_key_exists("children", $context) ? $context["children"] : (function () { throw new RuntimeError('Variable "children" does not exist.', 12, $this->source); })())) > 0)) {
// line 13
echo " <div class=\"accordion transition visible\">
<div class=\"title\">
";
// line 15
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["taxon"]) || array_key_exists("taxon", $context) ? $context["taxon"] : (function () { throw new RuntimeError('Variable "taxon" does not exist.', 15, $this->source); })()), "name", [], "any", false, false, false, 15), "html", null, true);
echo "
<span class=\"material-symbols-outlined\">expand_more</span>
</div>
<div class=\"content\">
";
// line 19
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["children"]) || array_key_exists("children", $context) ? $context["children"] : (function () { throw new RuntimeError('Variable "children" does not exist.', 19, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["childTaxon"]) {
// line 20
echo " ";
echo twig_call_macro($macros["macros"], "macro_item", [$context["childTaxon"]], 20, $context, $this->getSourceContext());
echo "
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['childTaxon'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 22
echo " </div>
</div>
";
} else {
// line 25
echo " <a href=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("bitbag_sylius_elasticsearch_plugin_shop_list_products", ["slug" => twig_get_attribute($this->env, $this->source, (isset($context["taxon"]) || array_key_exists("taxon", $context) ? $context["taxon"] : (function () { throw new RuntimeError('Variable "taxon" does not exist.', 25, $this->source); })()), "slug", [], "any", false, false, false, 25), "_locale" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["taxon"]) || array_key_exists("taxon", $context) ? $context["taxon"] : (function () { throw new RuntimeError('Variable "taxon" does not exist.', 25, $this->source); })()), "translation", [], "any", false, false, false, 25), "locale", [], "any", false, false, false, 25)]), "html", null, true);
echo "\" class=\"accordion-link item font-bold\">";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["taxon"]) || array_key_exists("taxon", $context) ? $context["taxon"] : (function () { throw new RuntimeError('Variable "taxon" does not exist.', 25, $this->source); })()), "name", [], "any", false, false, false, 25), "html", null, true);
echo "</a>
";
}
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
return ('' === $tmp = ob_get_contents()) ? '' : new Markup($tmp, $this->env->getCharset());
} finally {
ob_end_clean();
}
}
public function getTemplateName()
{
return "@SyliusShop/Taxon/verticalMenu.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 174 => 25, 169 => 22, 160 => 20, 156 => 19, 149 => 15, 145 => 13, 142 => 12, 139 => 11, 136 => 10, 117 => 9, 102 => 38, 98 => 37, 92 => 36, 87 => 35, 78 => 33, 73 => 32, 71 => 31, 68 => 30, 66 => 29, 63 => 28, 59 => 7, 56 => 6, 53 => 5, 50 => 4, 47 => 3, 45 => 2, 43 => 1,);
}
public function getSourceContext()
{
return new Source("{% set registerProductsLink = url('sylius_shop_login') %}
{% if is_granted('ROLE_USER') %}
{% if app.user.customer.organization.vendor|default(null) == null %}
{% set registerProductsLink = url('open_marketplace_vendor_register_form') %}
{% else %}
{% set registerProductsLink = url('open_marketplace_vendor_product_listings_index') %}
{% endif %}
{% endif %}
{% macro item(taxon) %}
{% import _self as macros %}
{% set children = taxon.getEnabledChildrenByTranslationName(taxon.translation.locale) %}
{% if children|length > 0 %}
<div class=\"accordion transition visible\">
<div class=\"title\">
{{ taxon.name }}
<span class=\"material-symbols-outlined\">expand_more</span>
</div>
<div class=\"content\">
{% for childTaxon in children %}
{{ macros.item(childTaxon) }}
{% endfor %}
</div>
</div>
{% else %}
<a href=\"{{ path('bitbag_sylius_elasticsearch_plugin_shop_list_products', {'slug': taxon.slug, '_locale': taxon.translation.locale}) }}\" class=\"accordion-link item font-bold\">{{ taxon.name }}</a>
{% endif %}
{% endmacro %}
{% import _self as macros %}
{% if taxons|length > 0 %}
{% for taxon in taxons %}
{{ macros.item(taxon) }}
{% endfor %}
{{ render(path('open_marketplace_shop_render_country_menu', {'template': '@SyliusShop/Layout/Sidebar/Menu/country.html.twig'})) }}
<a href=\"{{ path('open_marketplace_shop_vendor_index') }}\" class=\"accordion-link item font-bold\">{{ 'app.ui.brands'|trans }}</a>
{{ render(path('open_marketplace_shop_render_use_case_menu', {'template': '@SyliusShop/Layout/Sidebar/Menu/useCase.html.twig'})) }}
<a href=\"{{ registerProductsLink }}\" class=\"accordion-link item font-bold\">{{ 'app.ui.register_products'|trans }}</a>
{% endif %}
", "@SyliusShop/Taxon/verticalMenu.html.twig", "/srv/open_marketplace/templates/bundles/SyliusShopBundle/Taxon/verticalMenu.html.twig");
}
}