var/cache/dev/twig/c4/c45202e5f9752c850c2e16cc646bab7b.php line 33

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/_associations.html.twig */
  14. class __TwigTemplate_fe813e6c298f38156e17853f1c4383d4 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/_associations.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/_associations.html.twig"));
  33.         // line 1
  34.         echo "<div class=\"association-box\">
  35.     <div class=\"container-h\">
  36.         ";
  37.         // line 3
  38.         $context['_parent'] = $context;
  39.         $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.'3$this->source); })()), "associations", [], "any"falsefalsefalse3));
  40.         $context['_iterated'] = false;
  41.         foreach ($context['_seq'] as $context["_key"] => $context["association"]) {
  42.             // line 4
  43.             echo "            ";
  44.             echo $this->env->getRuntime('Symfony\Bridge\Twig\Extension\HttpKernelRuntime')->renderFragment($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("sylius_shop_partial_product_association_show", ["productId" => 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.'4$this->source); })()), "id", [], "any"falsefalsefalse4), "id" => twig_get_attribute($this->env$this->source$context["association"], "id", [], "any"falsefalsefalse4), "template" => "@SyliusShop/Product/Show/_association.html.twig"]));
  45.             echo "
  46.         ";
  47.             $context['_iterated'] = true;
  48.         }
  49.         if (!$context['_iterated']) {
  50.             // line 6
  51.             echo "            <h4 id=\"similary-product\">Produits Similaires</h4>
  52.             ";
  53.             // line 7
  54.             echo $this->env->getRuntime('Symfony\Bridge\Twig\Extension\HttpKernelRuntime')->renderFragment($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("sylius_shop_partial_product_index_latest", ["count" => 4"template" => "@SyliusShop/Product/_horizontalList.html.twig"]));
  55.             echo "
  56.             <div class=\"points-association\">
  57.                 <span class=\"point-last-product-association active\" onclick=\"changeImageAssociation(1)\"></span>
  58.                 <span class=\"point-last-product-association\" onclick=\"changeImageAssociation(2)\"></span>
  59.                 <span class=\"point-last-product-association\" onclick=\"changeImageAssociation(3)\"></span>
  60.                 <span class=\"point-last-product-association\" onclick=\"changeImageAssociation(4)\"></span>
  61.             </div>
  62.             <script>
  63.               function changeImageAssociation(index) {
  64.                 // Récupérer toutes les images de la galerie
  65.                 var images = document.querySelectorAll('#box-product-card');
  66.                 // Réinitialiser la classe \"active\" pour tous les points
  67.                 var points = document.querySelectorAll('.point-last-product-association');
  68.                 points.forEach(function(point) {
  69.                   point.classList.remove('active');
  70.                 });
  71.                 // Cacher toutes les images de la galerie
  72.                 images.forEach(function(image) {
  73.                   image.style.display = 'none';
  74.                 });
  75.                 console.log(images[index - 1])
  76.                 // Afficher l'image correspondante à l'index spécifié
  77.                 images[index - 1].style.display = 'block';
  78.                 console.log(images[index - 1]);
  79.                 // Ajouter la classe \"active\" au point correspondant à l'index spécifié
  80.                 points[index - 1].classList.add('active');
  81.               }
  82.             </script>
  83.         ";
  84.         }
  85.         $_parent $context['_parent'];
  86.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['association'], $context['_parent'], $context['loop']);
  87.         $context array_intersect_key($context$_parent) + $_parent;
  88.         // line 42
  89.         echo "    </div>
  90. </div>
  91. ";
  92.         
  93.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  94.         
  95.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  96.     }
  97.     public function getTemplateName()
  98.     {
  99.         return "@SyliusShop/Product/Show/_associations.html.twig";
  100.     }
  101.     public function isTraitable()
  102.     {
  103.         return false;
  104.     }
  105.     public function getDebugInfo()
  106.     {
  107.         return array (  104 => 42,  63 => 7,  60 => 6,  52 => 4,  47 => 3,  43 => 1,);
  108.     }
  109.     public function getSourceContext()
  110.     {
  111.         return new Source("<div class=\"association-box\">
  112.     <div class=\"container-h\">
  113.         {% for association in product.associations %}
  114.             {{ render(url('sylius_shop_partial_product_association_show', {'productId': product.id, 'id': association.id, 'template': '@SyliusShop/Product/Show/_association.html.twig'})) }}
  115.         {% else %}
  116.             <h4 id=\"similary-product\">Produits Similaires</h4>
  117.             {{ render(url('sylius_shop_partial_product_index_latest', {'count': 4, 'template': '@SyliusShop/Product/_horizontalList.html.twig'})) }}
  118.             <div class=\"points-association\">
  119.                 <span class=\"point-last-product-association active\" onclick=\"changeImageAssociation(1)\"></span>
  120.                 <span class=\"point-last-product-association\" onclick=\"changeImageAssociation(2)\"></span>
  121.                 <span class=\"point-last-product-association\" onclick=\"changeImageAssociation(3)\"></span>
  122.                 <span class=\"point-last-product-association\" onclick=\"changeImageAssociation(4)\"></span>
  123.             </div>
  124.             <script>
  125.               function changeImageAssociation(index) {
  126.                 // Récupérer toutes les images de la galerie
  127.                 var images = document.querySelectorAll('#box-product-card');
  128.                 // Réinitialiser la classe \"active\" pour tous les points
  129.                 var points = document.querySelectorAll('.point-last-product-association');
  130.                 points.forEach(function(point) {
  131.                   point.classList.remove('active');
  132.                 });
  133.                 // Cacher toutes les images de la galerie
  134.                 images.forEach(function(image) {
  135.                   image.style.display = 'none';
  136.                 });
  137.                 console.log(images[index - 1])
  138.                 // Afficher l'image correspondante à l'index spécifié
  139.                 images[index - 1].style.display = 'block';
  140.                 console.log(images[index - 1]);
  141.                 // Ajouter la classe \"active\" au point correspondant à l'index spécifié
  142.                 points[index - 1].classList.add('active');
  143.               }
  144.             </script>
  145.         {% endfor %}
  146.     </div>
  147. </div>
  148. ""@SyliusShop/Product/Show/_associations.html.twig""/var/www/Bikers/templates/bundles/SyliusShopBundle/Product/Show/_associations.html.twig");
  149.     }
  150. }