<?php
use Twig\Environment;
use function Shopware\Core\Framework\Adapter\Twig\sw_get_attribute;
use function Shopware\Core\Framework\Adapter\Twig\sw_escape_filter;
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;
/* @fourtwosixAttributeBadges/storefront/page/product-detail/index.html.twig */
class __TwigTemplate_eb491cce8cd60577e0a668aa0c4929e2 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'page_product_detail_media' => [$this, 'block_page_product_detail_media'],
'fourtwosixAttributeBadges_product_detail_media' => [$this, 'block_fourtwosixAttributeBadges_product_detail_media'],
];
}
protected function doGetParent(array $context)
{
// line 2
return "@zenitPlatformStratus/storefront/page/product-detail/index.html.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@fourtwosixAttributeBadges/storefront/page/product-detail/index.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@fourtwosixAttributeBadges/storefront/page/product-detail/index.html.twig"));
$this->parent = $this->loadTemplate("@zenitPlatformStratus/storefront/page/product-detail/index.html.twig", "@fourtwosixAttributeBadges/storefront/page/product-detail/index.html.twig", 2);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 3
public function block_page_product_detail_media($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "page_product_detail_media"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "page_product_detail_media"));
// line 4
echo "\t<div class=\"col-lg-7 product-detail-media\">
\t\t";
// line 5
$this->displayBlock('fourtwosixAttributeBadges_product_detail_media', $context, $blocks);
// line 76
echo "\t</div>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 5
public function block_fourtwosixAttributeBadges_product_detail_media($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "fourtwosixAttributeBadges_product_detail_media"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "fourtwosixAttributeBadges_product_detail_media"));
// line 6
echo "\t\t\t";
if (sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, ($context["page"] ?? null), "product", [], "any", false, false, false, 6), "media", [], "any", false, false, false, 6)) {
// line 7
echo "\t\t\t\t";
$this->loadTemplate("@zenitPlatformStratus/storefront/element/cms-element-image-gallery.html.twig", "@fourtwosixAttributeBadges/storefront/page/product-detail/index.html.twig", 7)->display(twig_array_merge($context, ["mediaItems" => // line 8
($context["mediaItems"] ?? null), "zoom" => true, "zoomModal" => true, "displayMode" => "contain", "gutter" => 5, "minHeight" => "430px", "navigationArrows" => "inside", "navigationDots" => "inside", "galleryPosition" => "left", "isProduct" => true, "fallbackImageTitle" => sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, // line 18
($context["page"] ?? null), "product", [], "any", false, false, false, 18), "translated", [], "any", false, false, false, 18), "name", [], "any", false, false, false, 18), "startIndexThumbnails" => 1, "startIndexSlider" => 1, "keepAspectRatioOnZoom" => false]));
// line 23
echo "\t\t\t";
}
// line 24
echo "
\t\t\t<div class=\"d-flex justify-content-center fourtwosix-badges\">
\t\t\t\t";
// line 26
$context["badgesMediaIds"] = [];
// line 27
echo "\t\t\t\t";
$context["propertiesBadge"] = [];
// line 28
echo "\t\t\t\t";
$context["configDefaultMedia"] = $this->extensions['Shopware\Storefront\Framework\Twig\Extension\ConfigExtension']->config($context, "fourtwosixAttributeBadges.config.defaultMedia");
// line 29
echo "
\t\t\t\t";
// line 31
echo "\t\t\t\t";
if ((sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, ($context["page"] ?? null), "product", [], "any", false, false, false, 31), "sortedProperties", [], "any", false, false, false, 31) != null)) {
// line 32
echo "\t\t\t\t\t";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable($this->extensions['Swag\Security\Fixes\NEXT24667\SecurityExtension']->filter(sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, ($context["page"] ?? null), "product", [], "any", false, false, false, 32), "sortedProperties", [], "any", false, false, false, 32), function ($__x__) use ($context, $macros) { $context["x"] = $__x__; return (sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, $context["x"], "translated", [], "any", false, false, false, 32), "customFields", [], "any", false, false, false, 32), "attribute_badges", [], "any", false, false, false, 32) == true); }));
foreach ($context['_seq'] as $context["_key"] => $context["x"]) {
// line 33
$context["propertiesBadge"] = twig_array_merge(($context["propertiesBadge"] ?? null), sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, $context["x"], "options", [], "any", false, false, false, 33), "elements", [], "any", false, false, false, 33));
// line 34
echo "\t\t\t\t\t";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['x'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 35
echo "
\t\t\t\t\t";
// line 36
if (($context["propertiesBadge"] ?? null)) {
// line 37
echo "\t\t\t\t\t\t";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(($context["propertiesBadge"] ?? null));
foreach ($context['_seq'] as $context["_key"] => $context["badge"]) {
// line 38
echo "\t\t\t\t\t\t\t";
if ((sw_get_attribute($this->env, $this->source, $context["badge"], "mediaId", [], "any", false, false, false, 38) != null)) {
// line 39
echo "\t\t\t\t\t\t\t\t";
$context["badgesMediaIds"] = twig_array_merge(($context["badgesMediaIds"] ?? null), [0 => sw_get_attribute($this->env, $this->source, $context["badge"], "mediaId", [], "any", false, false, false, 39)]);
// line 40
echo "\t\t\t\t\t\t\t";
} else {
// line 41
echo "\t\t\t\t\t\t\t\t";
$context["badgesMediaIds"] = twig_array_merge(($context["badgesMediaIds"] ?? null), [0 => ($context["configDefaultMedia"] ?? null)]);
// line 42
echo "\t\t\t\t\t\t\t";
}
// line 43
echo "\t\t\t\t\t\t";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['badge'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 44
echo "
\t\t\t\t\t\t";
// line 45
$context["mediaCollection"] = $this->extensions['Shopware\Core\Framework\Adapter\Twig\Extension\MediaExtension']->searchMedia(($context["badgesMediaIds"] ?? null), sw_get_attribute($this->env, $this->source, ($context["context"] ?? null), "context", [], "any", false, false, false, 45));
// line 46
echo "
\t\t\t\t\t\t";
// line 47
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_slice($this->env, $this->extensions['Swag\Security\Fixes\NEXT24667\SecurityExtension']->sort(($context["propertiesBadge"] ?? null), function ($__a__, $__b__) use ($context, $macros) { $context["a"] = $__a__; $context["b"] = $__b__; return (sw_get_attribute($this->env, $this->source, ($context["a"] ?? null), "position", [], "any", false, false, false, 47) <=> sw_get_attribute($this->env, $this->source, ($context["b"] ?? null), "position", [], "any", false, false, false, 47)); }), 0, 8));
$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["badge"]) {
// line 48
echo "\t\t\t\t\t\t\t";
if ((sw_get_attribute($this->env, $this->source, $context["badge"], "mediaId", [], "any", false, false, false, 48) != null)) {
// line 49
echo "\t\t\t\t\t\t\t\t";
$context["badgeMedia"] = sw_get_attribute($this->env, $this->source, ($context["mediaCollection"] ?? null), "get", [0 => sw_get_attribute($this->env, $this->source, $context["badge"], "mediaId", [], "any", false, false, false, 49)], "method", false, false, false, 49);
// line 50
echo "
\t\t\t\t\t\t\t\t";
// line 51
((function () use ($context, $blocks) {
$finder = $this->env->getExtension('Shopware\Core\Framework\Adapter\Twig\Extension\NodeExtension')->getFinder();
$includeTemplate = $finder->find("@Storefront/storefront/utilities/thumbnail.html.twig");
return $this->loadTemplate($includeTemplate ?? null, "@fourtwosixAttributeBadges/storefront/page/product-detail/index.html.twig", 51);
})())->display(twig_array_merge($context, ["media" => // line 52
($context["badgeMedia"] ?? null), "attributes" => ["class" => "img-fluid badgeImg", "data-toggle" => "tooltip", "title" => sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, // line 56
$context["badge"], "translated", [], "any", false, false, false, 56), "name", [], "any", false, false, false, 56)], "name" => "product-detail-badge-thumbnails"]));
// line 59
echo "\t\t\t\t\t\t\t";
} else {
// line 60
echo "\t\t\t\t\t\t\t\t";
$context["badgeMedia"] = sw_get_attribute($this->env, $this->source, ($context["mediaCollection"] ?? null), "get", [0 => ($context["configDefaultMedia"] ?? null)], "method", false, false, false, 60);
// line 61
echo "
\t\t\t\t\t\t\t\t";
// line 62
((function () use ($context, $blocks) {
$finder = $this->env->getExtension('Shopware\Core\Framework\Adapter\Twig\Extension\NodeExtension')->getFinder();
$includeTemplate = $finder->find("@Storefront/storefront/utilities/thumbnail.html.twig");
return $this->loadTemplate($includeTemplate ?? null, "@fourtwosixAttributeBadges/storefront/page/product-detail/index.html.twig", 62);
})())->display(twig_array_merge($context, ["media" => // line 63
($context["badgeMedia"] ?? null), "attributes" => ["class" => "img-fluid badgeImg", "data-toggle" => "tooltip", "title" => sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, // line 67
$context["badge"], "translated", [], "any", false, false, false, 67), "name", [], "any", false, false, false, 67)], "name" => "product-detail-badge-thumbnails"]));
// line 70
echo "\t\t\t\t\t\t\t";
}
// line 71
echo "\t\t\t\t\t\t";
++$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['badge'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 72
echo "\t\t\t\t\t";
}
// line 73
echo "\t\t\t\t";
}
// line 74
echo "\t\t\t</div>
\t\t";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
public function getTemplateName()
{
return "@fourtwosixAttributeBadges/storefront/page/product-detail/index.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 254 => 74, 251 => 73, 248 => 72, 234 => 71, 231 => 70, 229 => 67, 228 => 63, 221 => 62, 218 => 61, 215 => 60, 212 => 59, 210 => 56, 209 => 52, 202 => 51, 199 => 50, 196 => 49, 193 => 48, 176 => 47, 173 => 46, 171 => 45, 168 => 44, 162 => 43, 159 => 42, 156 => 41, 153 => 40, 150 => 39, 147 => 38, 142 => 37, 140 => 36, 137 => 35, 131 => 34, 129 => 33, 124 => 32, 121 => 31, 118 => 29, 115 => 28, 112 => 27, 110 => 26, 106 => 24, 103 => 23, 101 => 18, 100 => 8, 98 => 7, 95 => 6, 85 => 5, 74 => 76, 72 => 5, 69 => 4, 59 => 3, 36 => 2,);
}
public function getSourceContext()
{
return new Source("{% sw_extends '@Storefront/storefront/page/product-detail/index.html.twig' %}
{% block page_product_detail_media %}
\t<div class=\"col-lg-7 product-detail-media\">
\t\t{% block fourtwosixAttributeBadges_product_detail_media %}
\t\t\t{% if page.product.media %}
\t\t\t\t{% sw_include '@Storefront/storefront/element/cms-element-image-gallery.html.twig' with {
\t\t\t\t\t'mediaItems': mediaItems,
\t\t\t\t\t'zoom': true,
\t\t\t\t\t'zoomModal': true,
\t\t\t\t\t'displayMode': 'contain',
\t\t\t\t\t'gutter': 5,
\t\t\t\t\t'minHeight': '430px',
\t\t\t\t\t'navigationArrows': 'inside',
\t\t\t\t\t'navigationDots': 'inside',
\t\t\t\t\t'galleryPosition': 'left',
\t\t\t\t\t'isProduct': true,
\t\t\t\t\t'fallbackImageTitle': page.product.translated.name,
\t\t\t\t\t'startIndexThumbnails': 1,
\t\t\t\t\t'startIndexSlider': 1,
\t\t\t\t\t'keepAspectRatioOnZoom': false
\t\t\t\t} %}
\t\t\t{% endif %}
\t\t\t<div class=\"d-flex justify-content-center fourtwosix-badges\">
\t\t\t\t{% set badgesMediaIds = [] %}
\t\t\t\t{% set propertiesBadge = [] %}
\t\t\t\t{% set configDefaultMedia = config('fourtwosixAttributeBadges.config.defaultMedia') %}
\t\t\t\t{# checks whether the property group has a customField attribute_badge #}
\t\t\t\t{% if page.product.sortedProperties != null %}
\t\t\t\t\t{% for x in page.product.sortedProperties|filter(x => x.translated.customFields.attribute_badges == true) -%}
\t\t\t\t\t\t{% set propertiesBadge = propertiesBadge|merge(x.options.elements) %}
\t\t\t\t\t{% endfor %}
\t\t\t\t\t{% if propertiesBadge %}
\t\t\t\t\t\t{% for badge in propertiesBadge %}
\t\t\t\t\t\t\t{% if badge.mediaId != null %}
\t\t\t\t\t\t\t\t{% set badgesMediaIds = badgesMediaIds|merge([badge.mediaId]) %}
\t\t\t\t\t\t\t{% else %}
\t\t\t\t\t\t\t\t{% set badgesMediaIds = badgesMediaIds|merge([configDefaultMedia]) %}
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t{% endfor %}
\t\t\t\t\t\t{% set mediaCollection = searchMedia(badgesMediaIds, context.context) %}
\t\t\t\t\t\t{% for badge in propertiesBadge|sort((a, b) => a.position <=> b.position)|slice(0,8) %}
\t\t\t\t\t\t\t{% if badge.mediaId != null %}
\t\t\t\t\t\t\t\t{% set badgeMedia = mediaCollection.get(badge.mediaId) %}
\t\t\t\t\t\t\t\t{% sw_thumbnails 'product-detail-badge-thumbnails' with {
\t\t\t\t\t\t\t\t\tmedia: badgeMedia,
\t\t\t\t\t\t\t\t\tattributes: {
\t\t\t\t\t\t\t\t\t\t'class': 'img-fluid badgeImg',
\t\t\t\t\t\t\t\t\t\t'data-toggle' : 'tooltip',
\t\t\t\t\t\t\t\t\t\t'title': badge.translated.name
\t\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t} %}
\t\t\t\t\t\t\t{% else %}
\t\t\t\t\t\t\t\t{% set badgeMedia = mediaCollection.get(configDefaultMedia) %}
\t\t\t\t\t\t\t\t{% sw_thumbnails 'product-detail-badge-thumbnails' with {
\t\t\t\t\t\t\t\t\tmedia: badgeMedia,
\t\t\t\t\t\t\t\t\tattributes: {
\t\t\t\t\t\t\t\t\t\t'class': 'img-fluid badgeImg',
\t\t\t\t\t\t\t\t\t\t'data-toggle' : 'tooltip',
\t\t\t\t\t\t\t\t\t\t'title': badge.translated.name
\t\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t} %}
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t{% endfor %}
\t\t\t\t\t{% endif %}
\t\t\t\t{% endif %}
\t\t\t</div>
\t\t{% endblock %}
\t</div>
{% endblock %}
", "@fourtwosixAttributeBadges/storefront/page/product-detail/index.html.twig", "/var/www/dev.artecon.426.agency/custom/plugins/fourtwosixAttributeBadges/src/Resources/views/storefront/page/product-detail/index.html.twig");
}
}