var/cache/dev/twig/bc/bcc85f05e9548bdfdceb8f142b6f87c7.php line 184

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* @SyliusShop/Product/Show/_image_mobile.html.twig */
  14. class __TwigTemplate_3dd13d0a648028236699746ee51d23d3 extends \Twig\Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->parent false;
  23.         $this->blocks = [
  24.         ];
  25.     }
  26.     protected function doDisplay(array $context, array $blocks = [])
  27.     {
  28.         $macros $this->macros;
  29.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  30.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@SyliusShop/Product/Show/_image_mobile.html.twig"));
  31.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  32.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@SyliusShop/Product/Show/_image_mobile.html.twig"));
  33.         // line 1
  34.         if ((twig_length_filter($this->envtwig_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"falsefalsefalse1)) > 1)) {
  35.             // line 2
  36.             echo "    ";
  37.             // line 3
  38.             echo "    ";
  39.             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); })())]);
  40.             echo "
  41.    <div>
  42.        <div id=\"gallery-right-images-mobile\">
  43.            ";
  44.             // line 6
  45.             $context["imageCount"] = 0;
  46.             // line 7
  47.             echo "           ";
  48.             $context['_parent'] = $context;
  49.             $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"falsefalsefalse7));
  50.             $context['loop'] = [
  51.               'parent' => $context['_parent'],
  52.               'index0' => 0,
  53.               'index'  => 1,
  54.               'first'  => true,
  55.             ];
  56.             if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  57.                 $length count($context['_seq']);
  58.                 $context['loop']['revindex0'] = $length 1;
  59.                 $context['loop']['revindex'] = $length;
  60.                 $context['loop']['length'] = $length;
  61.                 $context['loop']['last'] = === $length;
  62.             }
  63.             foreach ($context['_seq'] as $context["_key"] => $context["image"]) {
  64.                 // line 8
  65.                 echo "               ";
  66.                 if (((isset($context["imageCount"]) || array_key_exists("imageCount"$context) ? $context["imageCount"] : (function () { throw new RuntimeError('Variable "imageCount" does not exist.'8$this->source); })()) < 4)) {
  67.                     // line 9
  68.                     echo "                   ";
  69.                     $context["path"] = (( !(null === twig_get_attribute($this->env$this->source$context["image"], "path", [], "any"falsefalsefalse9))) ? ($this->extensions['Sylius\Bundle\CoreBundle\Twig\FilterExtension']->filter(twig_get_attribute($this->env$this->source$context["image"], "path", [], "any"falsefalsefalse9), "sylius_shop_product_large_thumbnail")) : ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/shop/img/200x200.png")));
  70.                     // line 10
  71.                     echo "                   <div id=\"card-product-show-right-mobile\">
  72.                        ";
  73.                     // line 11
  74.                     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"falsefalsefalse11) && (twig_length_filter($this->envtwig_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"falsefalsefalse11)) > 0))) {
  75.                         // line 12
  76.                         echo "                           ";
  77.                         $this->loadTemplate("@SyliusShop/Product/Show/_imageVariants.html.twig""@SyliusShop/Product/Show/_image_mobile.html.twig"12)->display($context);
  78.                         // line 13
  79.                         echo "                       ";
  80.                     }
  81.                     // line 14
  82.                     echo "                       <a href=\"";
  83.                     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"falsefalsefalse14), "sylius_shop_product_original"), "html"nulltrue);
  84.                     echo "\" data-lightbox=\"sylius-product-image\">
  85.                            <img src=\"";
  86.                     // line 15
  87.                     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"nulltrue);
  88.                     echo "\" data-large-thumbnail=\"";
  89.                     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"falsefalsefalse15), "sylius_shop_product_large_thumbnail"), "html"nulltrue);
  90.                     echo "\" alt=\"";
  91.                     echo twig_escape_filter($this->envtwig_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"falsefalsefalse15), "html"nulltrue);
  92.                     echo "\" />
  93.                        </a>
  94.                    </div>
  95.                    ";
  96.                     // line 18
  97.                     $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);
  98.                     // line 19
  99.                     echo "               ";
  100.                 }
  101.                 // line 20
  102.                 echo "           ";
  103.                 ++$context['loop']['index0'];
  104.                 ++$context['loop']['index'];
  105.                 $context['loop']['first'] = false;
  106.                 if (isset($context['loop']['length'])) {
  107.                     --$context['loop']['revindex0'];
  108.                     --$context['loop']['revindex'];
  109.                     $context['loop']['last'] = === $context['loop']['revindex0'];
  110.                 }
  111.             }
  112.             $_parent $context['_parent'];
  113.             unset($context['_seq'], $context['_iterated'], $context['_key'], $context['image'], $context['_parent'], $context['loop']);
  114.             $context array_intersect_key($context$_parent) + $_parent;
  115.             // line 21
  116.             echo "       </div>
  117.        <div class=\"points-last-article\">
  118.            ";
  119.             // line 23
  120.             $context["imageCount"] = 0;
  121.             // line 24
  122.             echo "           <span class=\"point active\" onclick=\"changeImage(1)\"></span>
  123.            ";
  124.             // line 25
  125.             $context['_parent'] = $context;
  126.             $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"falsefalsefalse25));
  127.             $context['loop'] = [
  128.               'parent' => $context['_parent'],
  129.               'index0' => 0,
  130.               'index'  => 1,
  131.               'first'  => true,
  132.             ];
  133.             if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  134.                 $length count($context['_seq']);
  135.                 $context['loop']['revindex0'] = $length 1;
  136.                 $context['loop']['revindex'] = $length;
  137.                 $context['loop']['length'] = $length;
  138.                 $context['loop']['last'] = === $length;
  139.             }
  140.             foreach ($context['_seq'] as $context["_key"] => $context["image"]) {
  141.                 // line 26
  142.                 echo "               ";
  143.                 if (((twig_get_attribute($this->env$this->source$context["loop"], "index", [], "any"falsefalsefalse26) > 1) && ((isset($context["imageCount"]) || array_key_exists("imageCount"$context) ? $context["imageCount"] : (function () { throw new RuntimeError('Variable "imageCount" does not exist.'26$this->source); })()) < 4))) {
  144.                     // line 28
  145.                     echo "                   <span class=\"point\" onclick=\"changeImage(";
  146.                     echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["loop"], "index", [], "any"falsefalsefalse28), "html"nulltrue);
  147.                     echo ")\"></span>
  148.                    ";
  149.                     // line 29
  150.                     $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);
  151.                     // line 30
  152.                     echo "               ";
  153.                 }
  154.                 // line 31
  155.                 echo "           ";
  156.                 ++$context['loop']['index0'];
  157.                 ++$context['loop']['index'];
  158.                 $context['loop']['first'] = false;
  159.                 if (isset($context['loop']['length'])) {
  160.                     --$context['loop']['revindex0'];
  161.                     --$context['loop']['revindex'];
  162.                     $context['loop']['last'] = === $context['loop']['revindex0'];
  163.                 }
  164.             }
  165.             $_parent $context['_parent'];
  166.             unset($context['_seq'], $context['_iterated'], $context['_key'], $context['image'], $context['_parent'], $context['loop']);
  167.             $context array_intersect_key($context$_parent) + $_parent;
  168.             // line 32
  169.             echo "
  170.        </div>
  171.    </div>
  172.     <div class=\"inventory-product-mobile\">
  173.         ";
  174.             // line 36
  175.             $this->loadTemplate("@SyliusShop/Product/Show/_inventory.html.twig""@SyliusShop/Product/Show/_image_mobile.html.twig"36)->display($context);
  176.             // line 37
  177.             echo "    </div>
  178. ";
  179.         }
  180.         // line 39
  181.         echo "
  182. <script>
  183.   function changeImage(index) {
  184.     // Récupérer toutes les images de la galerie
  185.     var images = document.querySelectorAll('#gallery-right-images-mobile #card-product-show-right-mobile');
  186.     // Réinitialiser la classe \"active\" pour tous les points
  187.     var points = document.querySelectorAll('.point');
  188.     points.forEach(function(point) {
  189.       point.classList.remove('active');
  190.     });
  191.     // Cacher toutes les images de la galerie
  192.     images.forEach(function(image) {
  193.       image.style.display = 'none';
  194.     });
  195.     // Afficher l'image correspondante à l'index spécifié
  196.     images[index - 1].style.display = 'block';
  197.     // Ajouter la classe \"active\" au point correspondant à l'index spécifié
  198.     points[index - 1].classList.add('active');
  199.   }
  200. </script>
  201. ";
  202.         
  203.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  204.         
  205.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  206.     }
  207.     public function getTemplateName()
  208.     {
  209.         return "@SyliusShop/Product/Show/_image_mobile.html.twig";
  210.     }
  211.     public function isTraitable()
  212.     {
  213.         return false;
  214.     }
  215.     public function getDebugInfo()
  216.     {
  217.         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,);
  218.     }
  219.     public function getSourceContext()
  220.     {
  221.         return new Source("{% if product.images|length > 1 %}
  222.     {# <div class=\"ui divider\"></div> #}
  223.     {{ sylius_template_event('sylius.shop.product.show.before_thumbnails', {'product': product}) }}
  224.    <div>
  225.        <div id=\"gallery-right-images-mobile\">
  226.            {% set imageCount = 0 %}
  227.            {% for image in product.images %}
  228.                {% if imageCount < 4 %}
  229.                    {% set path = image.path is not null ? image.path|imagine_filter('sylius_shop_product_large_thumbnail') : asset('assets/shop/img/200x200.png') %}
  230.                    <div id=\"card-product-show-right-mobile\">
  231.                        {% if product.isConfigurable() and product.enabledVariants|length > 0 %}
  232.                            {% include '@SyliusShop/Product/Show/_imageVariants.html.twig' %}
  233.                        {% endif %}
  234.                        <a href=\"{{ image.path|imagine_filter('sylius_shop_product_original') }}\" data-lightbox=\"sylius-product-image\">
  235.                            <img src=\"{{ path }}\" data-large-thumbnail=\"{{ image.path|imagine_filter('sylius_shop_product_large_thumbnail') }}\" alt=\"{{ product.name }}\" />
  236.                        </a>
  237.                    </div>
  238.                    {% set imageCount = imageCount + 1 %}
  239.                {% endif %}
  240.            {% endfor %}
  241.        </div>
  242.        <div class=\"points-last-article\">
  243.            {% set imageCount = 0 %}
  244.            <span class=\"point active\" onclick=\"changeImage(1)\"></span>
  245.            {% for image in product.images %}
  246.                {% if loop.index > 1 and imageCount < 4 %}
  247. {#                   {{ dump(loop.index) }}#}
  248.                    <span class=\"point\" onclick=\"changeImage({{ loop.index}})\"></span>
  249.                    {% set imageCount = imageCount + 1 %}
  250.                {% endif %}
  251.            {% endfor %}
  252.        </div>
  253.    </div>
  254.     <div class=\"inventory-product-mobile\">
  255.         {% include '@SyliusShop/Product/Show/_inventory.html.twig' %}
  256.     </div>
  257. {% endif %}
  258. <script>
  259.   function changeImage(index) {
  260.     // Récupérer toutes les images de la galerie
  261.     var images = document.querySelectorAll('#gallery-right-images-mobile #card-product-show-right-mobile');
  262.     // Réinitialiser la classe \"active\" pour tous les points
  263.     var points = document.querySelectorAll('.point');
  264.     points.forEach(function(point) {
  265.       point.classList.remove('active');
  266.     });
  267.     // Cacher toutes les images de la galerie
  268.     images.forEach(function(image) {
  269.       image.style.display = 'none';
  270.     });
  271.     // Afficher l'image correspondante à l'index spécifié
  272.     images[index - 1].style.display = 'block';
  273.     // Ajouter la classe \"active\" au point correspondant à l'index spécifié
  274.     points[index - 1].classList.add('active');
  275.   }
  276. </script>
  277. ""@SyliusShop/Product/Show/_image_mobile.html.twig""/var/www/Bikers/templates/bundles/SyliusShopBundle/Product/Show/_image_mobile.html.twig");
  278.     }
  279. }