Snakes68 Posted October 1, 2016 Share Posted October 1, 2016 Bonjours, l’alerte produit disponible ne fonctionne pas sur mon site, je peux rentrée le mails si je suis pas connecté par contre au moment de cliquer sur "Prévenez-moi lorsque le produit est disponible" aucune réaction j’ai remarquer quelque chose de bizarre avec l’outil développer de firefox la "fonction href" <a id="mailalert_link" href="#" title="Prévenez-moi lorsque le produit est disponible" id="mailalert_link" rel="nofollow"> Prévenez-moi lorsque le produit est disponible</a> quelqu’un a une idée pour résoudre mon problème ? Link to comment Share on other sites More sharing options...
Eolia Posted October 1, 2016 Share Posted October 1, 2016 Il n'y a rien de bizarre le href ne sert à rien ici (d'où le # ) car la validation se fait en javascript. Vous devez donc avoir un souci de ce côté. Aucune alerte en rouge dans votre console ? Link to comment Share on other sites More sharing options...
Snakes68 Posted October 1, 2016 Author Share Posted October 1, 2016 non aucun message d'erreur , jais essayer une désinstallation, et réinstallation ainsi qu'une réinitialisation rien ne change Link to comment Share on other sites More sharing options...
Eolia Posted October 1, 2016 Share Posted October 1, 2016 Bon des erreurs vous en avez 3 en console... Failed to load resource: the server responded with a status of 404 (Not Found) https://writer.smartlook.com/rec/write?rid=57efc20ade599e42780eaed3&index=0…rverHost=s2.getsmartlook.com&group=10d&pid=57ed45f1673eec1b3d8b4567&data=1 Failed to load resource: the server responded with a status of 503 (Service Unavailable: Back-end server is at capacity) 1174-ares-amoeba-008-efcs.html#:1 XMLHttpRequest cannot load https://writer.smartlook.com/rec/write?rid=57efc20ade599e42780eaed3&index=0…rverHost=s2.getsmartlook.com&group=10d&pid=57ed45f1673eec1b3d8b4567&data=1. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://as-df.fr' is therefore not allowed access. The response had HTTP status code 503. Et aucun js de chargé pour ce module, donc il y a un souci... Link to comment Share on other sites More sharing options...
Snakes68 Posted October 1, 2016 Author Share Posted October 1, 2016 une idée pour résoudre le problème ? Link to comment Share on other sites More sharing options...
Eolia Posted October 1, 2016 Share Posted October 1, 2016 Regarder le code pour voir si le js est appelé et s'il est présent sur le serveur Link to comment Share on other sites More sharing options...
Snakes68 Posted October 1, 2016 Author Share Posted October 1, 2016 j'aurais besoin d’être unpeu plus aiguiller si possible Link to comment Share on other sites More sharing options...
Eolia Posted October 1, 2016 Share Posted October 1, 2016 Dans le module, le js est intégré au tpl /modules/mailalerts/views/templates/hook/product.tpl Suivant votre thème le js est soit dans le tpl du module, soit dans le fichier mailalert.js A vérifier dans /themes/votre_theme/js/modules/mailalerts/mailalerts.js ou /themes/votre_theme/modules/mailalerts/views/templates/hook/product.tpl Link to comment Share on other sites More sharing options...
Snakes68 Posted October 1, 2016 Author Share Posted October 1, 2016 Voici le code "/themes/votre_theme/modules/mailalerts/views/templates/hook/product.tpl" {* * 2007-2014 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2014 PrestaShop SA * @version Release: $Revision$ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} <!-- MODULE MailAlerts --> {if isset($email) AND $email} <p class="form-group"> <input type="text" id="oos_customer_email" name="customer_email" size="20" value="{l s='[email protected]' mod='mailalerts'}" class="mailalerts_oos_email form-control" /> </p> {/if} <a href="#" title="{l s='Notify me when available' mod='mailalerts'}" id="mailalert_link" rel="nofollow">{l s='Notify me when available' mod='mailalerts'}</a> <span id="oos_customer_email_result" style="display:none; display: block;"></span> {strip} {addJsDef oosHookJsCodeFunctions=array('oosHookJsCodeMailAlert')} {addJsDef mailalerts_url_check=$link->getModuleLink('mailalerts', 'actions', ['process' => 'check'])} {addJsDef mailalerts_url_add=$link->getModuleLink('mailalerts', 'actions', ['process' => 'add'])} {addJsDefL name='mailalerts_placeholder'}{l s='[email protected]' mod='mailalerts' js=1}{/addJsDefL} {addJsDefL name='mailalerts_registered'}{l s='Request notification registered' mod='mailalerts' js=1}{/addJsDefL} {addJsDefL name='mailalerts_already'}{l s='You already have an alert for this product' mod='mailalerts' js=1}{/addJsDefL} {addJsDefL name='mailalerts_invalid'}{l s='Your e-mail address is invalid' mod='mailalerts' js=1}{/addJsDefL} {/strip} <!-- END : MODULE MailAlerts --> Link to comment Share on other sites More sharing options...
Eolia Posted October 1, 2016 Share Posted October 1, 2016 Ok, donc vous devez avoir le js associé dans /themes/votre_theme/js/modules/mailalerts/mailalerts.js Link to comment Share on other sites More sharing options...
Snakes68 Posted October 1, 2016 Author Share Posted October 1, 2016 voila : /** 2007-2014 PrestaShop** NOTICE OF LICENSE** This source file is subject to the Academic Free License (AFL 3.0)* that is bundled with this package in the file LICENSE.txt.* It is also available through the world-wide-web at this URL:* http://opensource.org/licenses/afl-3.0.php* If you did not receive a copy of the license and are unable to* obtain it through the world-wide-web, please send an email* to [email protected] so we can send you a copy immediately.** DISCLAIMER** Do not edit or add to this file if you wish to upgrade PrestaShop to newer* versions in the future. If you wish to customize PrestaShop for your* needs please refer to http://www.prestashop.com for more information.** @author PrestaShop SA <[email protected]>* @copyright 2007-2014 PrestaShop SA* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)* International Registered Trademark & Property of PrestaShop SA*/$(document).ready(function() { oosHookJsCodeMailAlert(); $(document).on('keypress', '#oos_customer_email', function(e){ if(e.keyCode == 13) { e.preventDefault(); addNotification(); } }); $(document).on('click', '#oos_customer_email', function(e){ clearText(); }); $(document).on('click', '#mailalert_link', function(e){ e.preventDefault(); addNotification(); }); $(document).on('click', 'i[rel^=ajax_id_mailalert_]', function(e) { var ids = $(this).attr('rel').replace('ajax_id_mailalert_', ''); ids = ids.split('_'); var id_product_mail_alert = parseInt(ids[0]); var id_product_attribute_mail_alert = parseInt(ids[1]); var parent = $(this).parents('li'); if (typeof mailalerts_url_remove == 'undefined') return; $.ajax({ url: mailalerts_url_remove, type: "POST", data: { 'id_product': id_product_mail_alert, 'id_product_attribute': id_product_attribute_mail_alert }, success: function(result) { if (result == '0') { parent.fadeOut("normal", function() { if (parent.siblings().length == 0) $("#mailalerts_block_account_warning").removeClass('hidden'); parent.remove(); }); } } }); });});function clearText(){ if ($('#oos_customer_email').val() == mailalerts_placeholder) $('#oos_customer_email').val('');}function oosHookJsCodeMailAlert(){ if (typeof mailalerts_url_check == 'undefined') return; $.ajax({ type: 'POST', url: mailalerts_url_check, data: 'id_product=' + id_product + '&id_product_attribute=' + $('#idCombination').val(), success: function (msg) { if (msg == '0') { $('#mailalert_link').show(); $('#oos_customer_email').show(); } else { $('#mailalert_link').hide(); $('#oos_customer_email').hide(); } } });}function addNotification(){ if ($('#oos_customer_email').val() == mailalerts_placeholder || (typeof mailalerts_url_add == 'undefined')) return; $.ajax({ type: 'POST', url: mailalerts_url_add, data: 'id_product=' + id_product + '&id_product_attribute='+$('#idCombination').val()+'&customer_email='+$('#oos_customer_email').val()+'', success: function (msg) { if (msg == '1') { $('#mailalert_link').hide(); $('#oos_customer_email').hide(); $('#oos_customer_email_result').html(mailalerts_registered); $('#oos_customer_email_result').css('color', 'green').show(); } else if (msg == '2' ) { $('#oos_customer_email_result').html(mailalerts_already); $('#oos_customer_email_result').css('color', 'red').show(); } else { $('#oos_customer_email_result').html(mailalerts_invalid); $('#oos_customer_email_result').css('color', 'red').show(); } } });} Link to comment Share on other sites More sharing options...
Eolia Posted October 1, 2016 Share Posted October 1, 2016 Bah vous devez avoir un conflit dans vos js car ce fichier n'est jamais appelé sur votre page... le module appelle les 2 fichiers dans le header public function hookDisplayHeader() { $this->page_name = Dispatcher::getInstance()->getController(); if (in_array($this->page_name, array('product', 'account'))) { $this->context->controller->addJS($this->_path.'js/mailalerts.js'); $this->context->controller->addCSS($this->_path.'css/mailalerts.css', 'all'); } } Or chez vous, seul le css est présent en front Essayez de copier le js du module du thème dans le js du module lui-même (qui doit être vide) Link to comment Share on other sites More sharing options...
Snakes68 Posted October 1, 2016 Author Share Posted October 1, 2016 Fait , le js était bien vide par contre , je ne vois pas d’amélioration. Link to comment Share on other sites More sharing options...
Eolia Posted October 1, 2016 Share Posted October 1, 2016 Très space^^ Votre fichier est bien chargé cette fois-ci mais il ne contient que la licence /** * 2007-2015 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2015 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ http://as-df.fr/modules/mailalerts/js/mailalerts.js Donc vous avez dû louper un truc Link to comment Share on other sites More sharing options...
Snakes68 Posted October 1, 2016 Author Share Posted October 1, 2016 le fichier en ligne lui par contre est complet Link to comment Share on other sites More sharing options...
Eolia Posted October 1, 2016 Share Posted October 1, 2016 Euh... ce n'est pas possible ça, ou votre fichier est vérolé. Le lien http://as-df.fr/modules/mailalerts/js/mailalerts.js affiche le contenu sans l’interpréter donc on devrait le voir Link to comment Share on other sites More sharing options...
Snakes68 Posted October 1, 2016 Author Share Posted October 1, 2016 quand je le telecharge du ftp il est bien complet Link to comment Share on other sites More sharing options...
Eolia Posted October 1, 2016 Share Posted October 1, 2016 Bah il doit y avoir un caractère parasite ou autre chose Vous l'avez édité avec quoi ? Je vous recommande Notepad++, le seul qui ne modifie pas les fichiers sans vous le dire et respecte les encodages. Link to comment Share on other sites More sharing options...
Snakes68 Posted October 1, 2016 Author Share Posted October 1, 2016 j’utilise bien Notepad++ Link to comment Share on other sites More sharing options...
Eolia Posted October 1, 2016 Share Posted October 1, 2016 A priori vous n'avez pas mis le fichier au bon endroit car on le trouve ici : http://as-df.fr/modules/mailalerts/mailalerts.js Vous avez oublié le répertoire /js/ entre les 2^^ Link to comment Share on other sites More sharing options...
Snakes68 Posted October 1, 2016 Author Share Posted October 1, 2016 Ah ben oui ^^ sa marche beaucoup mieux comme sa un très grand merci a vous pour le coups de main !!!! Link to comment Share on other sites More sharing options...
Eolia Posted October 1, 2016 Share Posted October 1, 2016 (edited) Bon, vous avez du faire une mise à jour récemment du thème ou du module et le problème vient du php qui dit $this->context->controller->addJS($this->_path.'js/mailalerts.js'); alors que le sous-répertoire /js/ n'existe pas dans le theme default^^ Edited October 1, 2016 by Eolia (see edit history) Link to comment Share on other sites More sharing options...
Snakes68 Posted October 1, 2016 Author Share Posted October 1, 2016 je vais essayer de jeter un œil dans les prochain jours mais au moin le module est fonctionnels en attendant Link to comment Share on other sites More sharing options...
Eolia Posted October 1, 2016 Share Posted October 1, 2016 Jeter un oeil ? Pourquoi faire ? C'est un bug du module, on l'a contourné, point barre. Link to comment Share on other sites More sharing options...
Snakes68 Posted October 1, 2016 Author Share Posted October 1, 2016 sa me vas encore merci 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