From 3cd85c966c4a5317db883e989d879d7ca608bdc4 Mon Sep 17 00:00:00 2001 From: Olivier Legat Date: Tue, 24 Jan 2023 10:13:33 +0100 Subject: [PATCH] inject pictogrammes into produits page --- content/themes/regalette/src/js/main.js | 3 ++- content/themes/regalette/template-produits.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/content/themes/regalette/src/js/main.js b/content/themes/regalette/src/js/main.js index 1f627fd..621f06a 100644 --- a/content/themes/regalette/src/js/main.js +++ b/content/themes/regalette/src/js/main.js @@ -273,7 +273,8 @@ $(document).ready(function() { $('.p-advices-' + taxId).html(itemProd['advices']); $('.p-ing-' + taxId).html(itemProd['ing']); $('.img-prod-' + taxId).attr('src', itemProd['image']); - $('.picto-prod-' + taxId).each(function(index) { + $('.picto-prod-' + taxId).each(function (index) { + $(this).attr('src', ''); $(this).attr('src', itemProd['pictos'][index]); }); }); diff --git a/content/themes/regalette/template-produits.php b/content/themes/regalette/template-produits.php index 3548b2f..68d5936 100644 --- a/content/themes/regalette/template-produits.php +++ b/content/themes/regalette/template-produits.php @@ -49,7 +49,7 @@ foreach ($terms as $key => $myTerm) { $tabProduct['advices'] = get_field('prod-advices', $myPost->ID); $tabProduct['ing'] = get_field('prod-ing', $myPost->ID); $tabProduct['order'] = $tabGammes[$key]['order'] . get_field('prod-order', $myPost->ID); - $prodAdvices = get_field('pictogrammes'); + $prodAdvices = get_field('pictogrammes', $myPost->ID); $tabProduct['pictos'] = []; if (!empty($prodAdvices)) { foreach ($prodAdvices as $picto) {