<?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/Product/Show/_image_mobile.html.twig */
class __TwigTemplate_3dd13d0a648028236699746ee51d23d3 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/Product/Show/_image_mobile.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/Product/Show/_image_mobile.html.twig"));
// line 1
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.', 1, $this->source); })()), "images", [], "any", false, false, false, 1)) > 1)) {
// line 2
echo " ";
// line 3
echo " ";
echo $this->extensions['Sylius\Bundle\UiBundle\Twig\TemplateEventExtension']->render("sylius.shop.product.show.before_thumbnails", ["product" => (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 3, $this->source); })())]);
echo "
<div>
<div id=\"gallery-right-images-mobile\">
";
// line 6
$context["imageCount"] = 0;
// line 7
echo " ";
$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.', 7, $this->source); })()), "images", [], "any", false, false, false, 7));
$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["image"]) {
// line 8
echo " ";
if (((isset($context["imageCount"]) || array_key_exists("imageCount", $context) ? $context["imageCount"] : (function () { throw new RuntimeError('Variable "imageCount" does not exist.', 8, $this->source); })()) < 4)) {
// line 9
echo " ";
$context["path"] = (( !(null === twig_get_attribute($this->env, $this->source, $context["image"], "path", [], "any", false, false, false, 9))) ? ($this->extensions['Sylius\Bundle\CoreBundle\Twig\FilterExtension']->filter(twig_get_attribute($this->env, $this->source, $context["image"], "path", [], "any", false, false, false, 9), "sylius_shop_product_large_thumbnail")) : ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/shop/img/200x200.png")));
// line 10
echo " <div id=\"card-product-show-right-mobile\">
";
// line 11
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.', 11, $this->source); })()), "isConfigurable", [], "method", false, false, false, 11) && (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.', 11, $this->source); })()), "enabledVariants", [], "any", false, false, false, 11)) > 0))) {
// line 12
echo " ";
$this->loadTemplate("@SyliusShop/Product/Show/_imageVariants.html.twig", "@SyliusShop/Product/Show/_image_mobile.html.twig", 12)->display($context);
// line 13
echo " ";
}
// line 14
echo " <a href=\"";
echo twig_escape_filter($this->env, $this->extensions['Sylius\Bundle\CoreBundle\Twig\FilterExtension']->filter(twig_get_attribute($this->env, $this->source, $context["image"], "path", [], "any", false, false, false, 14), "sylius_shop_product_original"), "html", null, true);
echo "\" data-lightbox=\"sylius-product-image\">
<img src=\"";
// line 15
echo twig_escape_filter($this->env, (isset($context["path"]) || array_key_exists("path", $context) ? $context["path"] : (function () { throw new RuntimeError('Variable "path" does not exist.', 15, $this->source); })()), "html", null, true);
echo "\" data-large-thumbnail=\"";
echo twig_escape_filter($this->env, $this->extensions['Sylius\Bundle\CoreBundle\Twig\FilterExtension']->filter(twig_get_attribute($this->env, $this->source, $context["image"], "path", [], "any", false, false, false, 15), "sylius_shop_product_large_thumbnail"), "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.', 15, $this->source); })()), "name", [], "any", false, false, false, 15), "html", null, true);
echo "\" />
</a>
</div>
";
// line 18
$context["imageCount"] = ((isset($context["imageCount"]) || array_key_exists("imageCount", $context) ? $context["imageCount"] : (function () { throw new RuntimeError('Variable "imageCount" does not exist.', 18, $this->source); })()) + 1);
// line 19
echo " ";
}
// line 20
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['image'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 21
echo " </div>
<div class=\"points-last-article\">
";
// line 23
$context["imageCount"] = 0;
// line 24
echo " <span class=\"point active\" onclick=\"changeImage(1)\"></span>
";
// line 25
$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.', 25, $this->source); })()), "images", [], "any", false, false, false, 25));
$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["image"]) {
// line 26
echo " ";
if (((twig_get_attribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 26) > 1) && ((isset($context["imageCount"]) || array_key_exists("imageCount", $context) ? $context["imageCount"] : (function () { throw new RuntimeError('Variable "imageCount" does not exist.', 26, $this->source); })()) < 4))) {
// line 28
echo " <span class=\"point\" onclick=\"changeImage(";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 28), "html", null, true);
echo ")\"></span>
";
// line 29
$context["imageCount"] = ((isset($context["imageCount"]) || array_key_exists("imageCount", $context) ? $context["imageCount"] : (function () { throw new RuntimeError('Variable "imageCount" does not exist.', 29, $this->source); })()) + 1);
// line 30
echo " ";
}
// line 31
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['image'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 32
echo "
</div>
</div>
<div class=\"inventory-product-mobile\">
";
// line 36
$this->loadTemplate("@SyliusShop/Product/Show/_inventory.html.twig", "@SyliusShop/Product/Show/_image_mobile.html.twig", 36)->display($context);
// line 37
echo " </div>
";
}
// line 39
echo "
<script>
function changeImage(index) {
// Récupérer toutes les images de la galerie
var images = document.querySelectorAll('#gallery-right-images-mobile #card-product-show-right-mobile');
// Réinitialiser la classe \"active\" pour tous les points
var points = document.querySelectorAll('.point');
points.forEach(function(point) {
point.classList.remove('active');
});
// Cacher toutes les images de la galerie
images.forEach(function(image) {
image.style.display = 'none';
});
// Afficher l'image correspondante à l'index spécifié
images[index - 1].style.display = 'block';
// Ajouter la classe \"active\" au point correspondant à l'index spécifié
points[index - 1].classList.add('active');
}
</script>
";
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
public function getTemplateName()
{
return "@SyliusShop/Product/Show/_image_mobile.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 190 => 39, 186 => 37, 184 => 36, 178 => 32, 164 => 31, 161 => 30, 159 => 29, 154 => 28, 151 => 26, 134 => 25, 131 => 24, 129 => 23, 125 => 21, 111 => 20, 108 => 19, 106 => 18, 96 => 15, 91 => 14, 88 => 13, 85 => 12, 83 => 11, 80 => 10, 77 => 9, 74 => 8, 56 => 7, 54 => 6, 47 => 3, 45 => 2, 43 => 1,);
}
public function getSourceContext()
{
return new Source("{% if product.images|length > 1 %}
{# <div class=\"ui divider\"></div> #}
{{ sylius_template_event('sylius.shop.product.show.before_thumbnails', {'product': product}) }}
<div>
<div id=\"gallery-right-images-mobile\">
{% set imageCount = 0 %}
{% for image in product.images %}
{% if imageCount < 4 %}
{% set path = image.path is not null ? image.path|imagine_filter('sylius_shop_product_large_thumbnail') : asset('assets/shop/img/200x200.png') %}
<div id=\"card-product-show-right-mobile\">
{% if product.isConfigurable() and product.enabledVariants|length > 0 %}
{% include '@SyliusShop/Product/Show/_imageVariants.html.twig' %}
{% endif %}
<a href=\"{{ image.path|imagine_filter('sylius_shop_product_original') }}\" data-lightbox=\"sylius-product-image\">
<img src=\"{{ path }}\" data-large-thumbnail=\"{{ image.path|imagine_filter('sylius_shop_product_large_thumbnail') }}\" alt=\"{{ product.name }}\" />
</a>
</div>
{% set imageCount = imageCount + 1 %}
{% endif %}
{% endfor %}
</div>
<div class=\"points-last-article\">
{% set imageCount = 0 %}
<span class=\"point active\" onclick=\"changeImage(1)\"></span>
{% for image in product.images %}
{% if loop.index > 1 and imageCount < 4 %}
{# {{ dump(loop.index) }}#}
<span class=\"point\" onclick=\"changeImage({{ loop.index}})\"></span>
{% set imageCount = imageCount + 1 %}
{% endif %}
{% endfor %}
</div>
</div>
<div class=\"inventory-product-mobile\">
{% include '@SyliusShop/Product/Show/_inventory.html.twig' %}
</div>
{% endif %}
<script>
function changeImage(index) {
// Récupérer toutes les images de la galerie
var images = document.querySelectorAll('#gallery-right-images-mobile #card-product-show-right-mobile');
// Réinitialiser la classe \"active\" pour tous les points
var points = document.querySelectorAll('.point');
points.forEach(function(point) {
point.classList.remove('active');
});
// Cacher toutes les images de la galerie
images.forEach(function(image) {
image.style.display = 'none';
});
// Afficher l'image correspondante à l'index spécifié
images[index - 1].style.display = 'block';
// Ajouter la classe \"active\" au point correspondant à l'index spécifié
points[index - 1].classList.add('active');
}
</script>
", "@SyliusShop/Product/Show/_image_mobile.html.twig", "/var/www/Bikers/templates/bundles/SyliusShopBundle/Product/Show/_image_mobile.html.twig");
}
}