<?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/_associations.html.twig */
class __TwigTemplate_fe813e6c298f38156e17853f1c4383d4 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/_associations.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/_associations.html.twig"));
// line 1
echo "<div class=\"association-box\">
<div class=\"container-h\">
";
// line 3
$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.', 3, $this->source); })()), "associations", [], "any", false, false, false, 3));
$context['_iterated'] = false;
foreach ($context['_seq'] as $context["_key"] => $context["association"]) {
// line 4
echo " ";
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", false, false, false, 4), "id" => twig_get_attribute($this->env, $this->source, $context["association"], "id", [], "any", false, false, false, 4), "template" => "@SyliusShop/Product/Show/_association.html.twig"]));
echo "
";
$context['_iterated'] = true;
}
if (!$context['_iterated']) {
// line 6
echo " <h4 id=\"similary-product\">Produits Similaires</h4>
";
// line 7
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"]));
echo "
<div class=\"points-association\">
<span class=\"point-last-product-association active\" onclick=\"changeImageAssociation(1)\"></span>
<span class=\"point-last-product-association\" onclick=\"changeImageAssociation(2)\"></span>
<span class=\"point-last-product-association\" onclick=\"changeImageAssociation(3)\"></span>
<span class=\"point-last-product-association\" onclick=\"changeImageAssociation(4)\"></span>
</div>
<script>
function changeImageAssociation(index) {
// Récupérer toutes les images de la galerie
var images = document.querySelectorAll('#box-product-card');
// Réinitialiser la classe \"active\" pour tous les points
var points = document.querySelectorAll('.point-last-product-association');
points.forEach(function(point) {
point.classList.remove('active');
});
// Cacher toutes les images de la galerie
images.forEach(function(image) {
image.style.display = 'none';
});
console.log(images[index - 1])
// Afficher l'image correspondante à l'index spécifié
images[index - 1].style.display = 'block';
console.log(images[index - 1]);
// Ajouter la classe \"active\" au point correspondant à l'index spécifié
points[index - 1].classList.add('active');
}
</script>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['association'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 42
echo " </div>
</div>
";
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
public function getTemplateName()
{
return "@SyliusShop/Product/Show/_associations.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 104 => 42, 63 => 7, 60 => 6, 52 => 4, 47 => 3, 43 => 1,);
}
public function getSourceContext()
{
return new Source("<div class=\"association-box\">
<div class=\"container-h\">
{% for association in product.associations %}
{{ render(url('sylius_shop_partial_product_association_show', {'productId': product.id, 'id': association.id, 'template': '@SyliusShop/Product/Show/_association.html.twig'})) }}
{% else %}
<h4 id=\"similary-product\">Produits Similaires</h4>
{{ render(url('sylius_shop_partial_product_index_latest', {'count': 4, 'template': '@SyliusShop/Product/_horizontalList.html.twig'})) }}
<div class=\"points-association\">
<span class=\"point-last-product-association active\" onclick=\"changeImageAssociation(1)\"></span>
<span class=\"point-last-product-association\" onclick=\"changeImageAssociation(2)\"></span>
<span class=\"point-last-product-association\" onclick=\"changeImageAssociation(3)\"></span>
<span class=\"point-last-product-association\" onclick=\"changeImageAssociation(4)\"></span>
</div>
<script>
function changeImageAssociation(index) {
// Récupérer toutes les images de la galerie
var images = document.querySelectorAll('#box-product-card');
// Réinitialiser la classe \"active\" pour tous les points
var points = document.querySelectorAll('.point-last-product-association');
points.forEach(function(point) {
point.classList.remove('active');
});
// Cacher toutes les images de la galerie
images.forEach(function(image) {
image.style.display = 'none';
});
console.log(images[index - 1])
// Afficher l'image correspondante à l'index spécifié
images[index - 1].style.display = 'block';
console.log(images[index - 1]);
// Ajouter la classe \"active\" au point correspondant à l'index spécifié
points[index - 1].classList.add('active');
}
</script>
{% endfor %}
</div>
</div>
", "@SyliusShop/Product/Show/_associations.html.twig", "/var/www/Bikers/templates/bundles/SyliusShopBundle/Product/Show/_associations.html.twig");
}
}