Olivier Bennegent Posted April 18 Share Posted April 18 Bonjour, Je souhaite ajouter le script suivant sur mes pages produits : <div id="LBE-widget-plus" data-brandid="164" data-clientref=xxxx data-lang="fr"></div> J'ai donc ajouté cette ligne à l'endroit souhaité de mon fichier product.tpl. Cela fonctionne en prenant une référence produit en exemple pour le champ data-clientref="xxxxx" mais je ne sais pas comment ajouter des variables dynamiques pour utiliser la référence de mes produits selon la page avec {$product.reference}. Même chose pour la langue utilisé, par défaut fr mais nous avons aussi l'anglais. Merci pour votre aide. Link to comment Share on other sites More sharing options...
Prestashop Addict Posted April 18 Share Posted April 18 If faut ajouter du code javascript dans le fichier custom.js de votre thème. Link to comment Share on other sites More sharing options...
Olivier Bennegent Posted April 18 Author Share Posted April 18 Pouvez-vous m'en dire plus svp ? Link to comment Share on other sites More sharing options...
Knowband Plugins Posted April 18 Share Posted April 18 Essayez ceci. <div id="LBE-widget-plus" data-brandid="164" data-clientref="{$product.reference}" data-lang="{$language.iso_code}"></div> Link to comment Share on other sites More sharing options...
Olivier Bennegent Posted April 18 Author Share Posted April 18 J'ai essayé votre proposition mais cela casse mon affichage : Link to comment Share on other sites More sharing options...
Knowband Plugins Posted April 18 Share Posted April 18 Quelle est la version PS ? Si vous utilisez la PS 8, utilisez la version suivante. <div id="LBE-widget-plus" data-brandid="164" data-clientref="{$product.reference_to_display}" data-lang="{$language.iso_code}"></div> Link to comment Share on other sites More sharing options...
Olivier Bennegent Posted April 18 Author Share Posted April 18 Malheureusement nous utilisons une vieille version de Prestashop, nous sommes en 1.6.1.11 Link to comment Share on other sites More sharing options...
Knowband Plugins Posted April 18 Share Posted April 18 PS1.6. Cela devrait fonctionner. <div id="LBE-widget-plus" data-brandid="164" data-clientref="{$product.reference}" data-lang="{$lang_iso}"></div> Link to comment Share on other sites More sharing options...
Olivier Bennegent Posted April 18 Author Share Posted April 18 J'ai bien essayé cette dernière version mais notre affichage est cassé... Link to comment Share on other sites More sharing options...
Knowband Plugins Posted April 18 Share Posted April 18 Activez le mode débogage et partagez l'erreur. Link to comment Share on other sites More sharing options...
Olivier Bennegent Posted April 18 Author Share Posted April 18 Link to comment Share on other sites More sharing options...
Prestashop Addict Posted April 18 Share Posted April 18 You have an error in your override of class Product.php nothing to do with template! Link to comment Share on other sites More sharing options...
Knowband Plugins Posted April 18 Share Posted April 18 Cette erreur ne provient pas du script dans le fichier product.tpl. L'erreur provient du contrôleur de produit lui-même. Cette erreur n'est pas présente si le script n'est pas ajouté ? Link to comment Share on other sites More sharing options...
Olivier Bennegent Posted April 18 Author Share Posted April 18 Et bien non étonnamment, les fiches produits s'affichent correctement sans le script ajouté... Link to comment Share on other sites More sharing options...
WEB-FUSION Posted April 23 Share Posted April 23 Bonjour, est-ce que votre fiche produit fonctionne toujours après avoir vidé le cache en mode production ? Link to comment Share on other sites More sharing options...
Prestashop Addict Posted April 23 Share Posted April 23 (edited) En PS 1.6 les variables smarty sont des objets et pas des tableaux. Donc voici le code <div id="LBE-widget-plus" data-brandid="164" data-clientref="{$product->reference}" data-lang="{$lang_iso}"></div> ou <div id="LBE-widget-plus" data-brandid="164" data-clientref="{$product->reference}" data-lang="{Context::getContext()->language->iso_code}"></div> Edited April 23 by Prestashop Addict (see edit history) Link to comment Share on other sites More sharing options...
Knowband Plugins Posted April 23 Share Posted April 23 (edited) 29 minutes ago, Prestashop Addict said: $lang_iso variable. So here is the code $lang_iso existe dans la PS1.6 https://github.com/PrestaShop/PrestaShop/blob/1.6.1.2/themes/default-bootstrap/product.tpl Edited April 23 by Knowband Plugins (see edit history) Link to comment Share on other sites More sharing options...
Olivier Bennegent Posted April 23 Author Share Posted April 23 Bonjour, Merci @Prestashop Addict, ce correctif fonctionne bien sur notre site 1.6 👍 Il me reste simplement à essayer de corriger l'affichage lorsque je clique sur "En savoir plus" car notre bandeau de menu se superpose sur la fenêtre intégrée qui s'ouvre. - https://www.molinel.com/565-tablier-de-service-dan-88-noir.html 33 minutes ago, Prestashop Addict said: En PS 1.6 les variables smarty sont des objets et pas des tableaux, et il n'y a pas de variable $lang_iso. Donc voici le code <div id="LBE-widget-plus" data-brandid="164" data-clientref="{$product->reference}" data-lang="{Context::getContext()->language->iso_code}"></div> Link to comment Share on other sites More sharing options...
Prestashop Addict Posted April 23 Share Posted April 23 il y a 22 minutes, Knowband Plugins a dit : $lang_iso existe dans la PS1.6 Effectivement, c'était donc juste le fait de ne pas utiliser la variable en mode objet 😉 Link to comment Share on other sites More sharing options...
Olivier Bennegent Posted April 23 Author Share Posted April 23 Nous avons également le chevauchement du bloc fixe pour l'ajout au panier lorsque l'on clique sur "En savoir plus". Savez-vous comment nous pouvons fixe l'affichage de cette fenêtre intégrée ? - https://www.molinel.com/shop/106-combinaison-pro-dynamium-acier-marine.html Link to comment Share on other sites More sharing options...
Mediacom87 Posted April 23 Share Posted April 23 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now