Powerplex Posted March 20, 2013 Share Posted March 20, 2013 Bonjour, Je viens à vous après des semaines de galère à tester différentes solutions pour le problème suivant : - Si je ne suis pas connecté sur mon site en tant que client et que je clique sur "mon compte" ou "inscription", j'apparait sur la page contenant deux formulaires : un pour les non-inscrits (leur demandant leur adresse email ), et un pour les clients inscrits ( demande adresse + mot de passe) Mon problème se situe dans le premier formulaire. Prestashop, afin de poursuivre l'inscription, demande au préalable de renseigner une adresse mail, puis effectue une requête via Ajax dans authentication.tpl. Cette requête ne retourne jamais de success malheureusement, mais je ne trouve pas la cause du problème. Voici la fonction Ajax (via jQuery) dans son intégralité : $.ajax({ type: 'POST', url: baseUri, async: true, cache: false, dataType : "json", data: { controller: 'authentication', SubmitCreate: 1, ajax: true, email_create: $('#email_create').val(), token: token }, success: function(jsonData) { if (jsonData.hasError) { var errors = ''; for(error in jsonData.errors) //IE6 bug fix if(error != 'indexOf') errors += '<li>'+jsonData.errors[error]+'</li>'; $('#create_account_error').html('<ol>'+errors+'</ol>').show(); } else { // adding a div to display a transition $('#center_column').html('<div id="noSlide">'+$('#center_column').html()+'</div>'); $('#noSlide').fadeOut('slow', function(){ $('#noSlide').html(jsonData.page); // update the state (when this file is called from AJAX you still need to update the state) bindStateInputAndUpdate(); }); $('#noSlide').fadeIn('slow'); document.location = '#account-creation'; } }, error: function(XMLHttpRequest, textStatus, errorThrown) { // // todo : bloquer cette erreur lors de la soumission du mail alert("TECHNICAL ERROR: unable to load form.\n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus); } }); Je tombe donc sur l'alerte de la function error. Voici maintenant le formulaire qui demande le mail : <form action="{$link->getPageLink('authentication', true)}" method="post" id="create-account_form" class="std"> <fieldset> <div id="bandeau_vert"></div> <p class="entete_phrase"><span style="color:red;">*</span> Les champs marqu√©s d'un ast√©risque sont obligatoires</p> <h3>{l s='Create your account'}</h3> <div class="form_content clearfix"> <p class="title_block">{l s='Enter your e-mail address to create an account'}.</p> <div class="error" id="create_account_error" style="display:none"></div> <p class="text"> <label for="email_create">{l s='E-mail address'}<span style="color:red; font-size: 1.1em;"> *</span></label> <span><input type="text" id="email_create" name="email_create" value="{if isset($smarty.post.email_create)}{$smarty.post.email_create|stripslashes}{/if}" class="account_input" /></span> </p> <p class="submit"> {if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'htmlall':'UTF-8'}" />{/if} <input type="button" id="SubmitCreate" name="SubmitCreate" class="button_large" value="{l s='Create your account'}" /> <input type="hidden" class="hidden" name="SubmitCreate" value="{l s='Create your account'}" /> </p> </div> </fieldset> </form> Ce formulaire est appelé par un évènement jQuery tout ce qu'il y a de plus classique : $('#SubmitCreate').click(function(){ submitFunction(); }); Pourquoi je crois que c'est un bug ? Parce que je n'ai jamais touché à ces fichiers (ni personne d'autre d'ailleurs) et que j'ai trouvé de nombreux sujets qui en parlaient sans jamais apporter de réponse. Merci d'avance à ceux/celles qui me viendrons en aide Link to comment Share on other sites More sharing options...
Gregory Roussac Posted March 21, 2013 Share Posted March 21, 2013 Hello, Et ça dit quoi dans le alert ? As tu les erreurs display activée ou desactivée ? Une url ? Courage 1 Link to comment Share on other sites More sharing options...
Powerplex Posted March 22, 2013 Author Share Posted March 22, 2013 TECHNICAL ERROR: unable to load form. Details: Error thrown: [object Object] Text status: parsererror Voilà ce que dit l'alert, autrement j'ai le mode debug activé et je n'ai aucune erreur PHP, dans firebug je n'ai pas contre pas d'onglet JSON, ce qui signifie que jsonData est vide (et donc la cause de mon erreur) J'ai trouvé un site sur lequel le formulaire en question fonctionne (si vous essayez le formulaire de gauche avec firebug ouvert vous verrez un onglet JSON que moi je n'ai pas). J'ai constaté que cet onglet JSON contient la même chose que l'onglet RESPONSE mais au format JSON. Donc en gros, ma requête me retourne bien les bonnes données, mais il me manque l'onglet JSON, comment l'avoir ? Voici le contenu de l'onglet RESPONSE que j'obtient : <script></script><script></script>{"hasError":false,"errors":[],"page":"\r\n<!-- Breadcrumb -->\n\n<div class=\"breadcrumb\">\n\t<a href=\"http:\/\/mapurenature.lan:8888\/\" title=\"return to Home\" class=\"return_home\">Ma Pure Nature<\/a>\n\t\t\t<span class=\"navigation-pipe\" >><\/span>\n\t\t\t\t\t<span class=\"navigation_page\">Login<\/span>\n\t\t\t<\/div>\n<!-- \/Breadcrumb -->\r\n\r\n<script type=\"text\/javascript\">\r\n\/\/ <![CDATA[\r\nidSelectedCountry = false;\r\ncountries = new Array();\r\ncountriesNeedIDNumber = new Array();\r\ncountriesNeedZipCode = new Array();\r\n\t\t\t\t\t\t\t\t\t\tcountriesNeedZipCode[8] = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcountriesNeedZipCode[17] = 1;\r\n\t\t\t$(function(){\r\n\t$('.id_state option[value=]').attr('selected', true);\r\n});\r\n\/\/]]>\r\n<\/script>\r\n\r\n<h1>Create your account<\/h1>\r\n\r\n\n\r\n\t<!---->\r\n<form action=\"http:\/\/mapurenature.lan:8888\/en\/authentication\" method=\"post\" id=\"account-creation_form\" class=\"std\">\r\n\t\r\n\t<fieldset class=\"account_creation\">\r\n\t\t<h3>Your personal information<\/h3>\r\n\t\t<p class=\"radio required\">\r\n\t\t\t<span>Title<\/span>\r\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"id_gender\" id=\"id_gender1\" value=\"1\" \/>\r\n\t\t\t\t<label for=\"id_gender1\" class=\"top\">Mr.<\/label>\r\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"id_gender\" id=\"id_gender2\" value=\"2\" \/>\r\n\t\t\t\t<label for=\"id_gender2\" class=\"top\">Ms.<\/label>\r\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"id_gender\" id=\"id_gender3\" value=\"3\" \/>\r\n\t\t\t\t<label for=\"id_gender3\" class=\"top\">Miss<\/label>\r\n\t\t\t\t\t<\/p>\r\n\t\t<p class=\"required text\">\r\n\t\t\t<label for=\"customer_firstname\">First name <sup>*<\/sup><\/label>\r\n\t\t\t<input onkeyup=\"$('#firstname').val(this.value);\" type=\"text\" class=\"text\" id=\"customer_firstname\" name=\"customer_firstname\" value=\"\" \/>\r\n\t\t<\/p>\r\n\t\t<p class=\"required text\">\r\n\t\t\t<label for=\"customer_lastname\">Last name <sup>*<\/sup><\/label>\r\n\t\t\t<input onkeyup=\"$('#lastname').val(this.value);\" type=\"text\" class=\"text\" id=\"customer_lastname\" name=\"customer_lastname\" value=\"\" \/>\r\n\t\t<\/p>\r\n\t\t<p class=\"required text\">\r\n\t\t\t<label for=\"email\">E-mail <sup>*<\/sup><\/label>\r\n\t\t\t<input type=\"text\" class=\"text\" id=\"email\" name=\"email\" value=\"[email protected]\" \/>\r\n\t\t<\/p>\r\n\t\t<p class=\"required password\">\r\n\t\t\t<label for=\"passwd\">Password <sup>*<\/sup><\/label>\r\n\t\t\t<input type=\"password\" class=\"text\" name=\"passwd\" id=\"passwd\" \/>\r\n\t\t\t<span class=\"form_info\">(5 characters min.)<\/span>\r\n\t\t<\/p>\r\n\t\t<p class=\"select\">\r\n\t\t\t<span>Date of Birth<\/span>\r\n\t\t\t<select id=\"days\" name=\"days\">\r\n\t\t\t\t<option value=\"\">-<\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1\" >1 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"2\" >2 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"3\" >3 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"4\" >4 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"5\" >5 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"6\" >6 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"7\" >7 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"8\" >8 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"9\" >9 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"10\" >10 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"11\" >11 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"12\" >12 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"13\" >13 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"14\" >14 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"15\" >15 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"16\" >16 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"17\" >17 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"18\" >18 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"19\" >19 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"20\" >20 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"21\" >21 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"22\" >22 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"23\" >23 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"24\" >24 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"25\" >25 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"26\" >26 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"27\" >27 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"28\" >28 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"29\" >29 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"30\" >30 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"31\" >31 <\/option>\r\n\t\t\t\t\t\t\t<\/select>\r\n\t\t\t\r\n\t\t\t<select id=\"months\" name=\"months\">\r\n\t\t\t\t<option value=\"\">-<\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1\" >January <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"2\" >February <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"3\" >March <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"4\" >April <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"5\" >May <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"6\" >June <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"7\" >July <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"8\" >August <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"9\" >September <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"10\" >October <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"11\" >November <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"12\" >December <\/option>\r\n\t\t\t\t\t\t\t<\/select>\r\n\t\t\t<select id=\"years\" name=\"years\">\r\n\t\t\t\t<option value=\"\">-<\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"2013\" >2013 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"2012\" >2012 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"2011\" >2011 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"2010\" >2010 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"2009\" >2009 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"2008\" >2008 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"2007\" >2007 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"2006\" >2006 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"2005\" >2005 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"2004\" >2004 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"2003\" >2003 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"2002\" >2002 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"2001\" >2001 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"2000\" >2000 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1999\" >1999 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1998\" >1998 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1997\" >1997 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1996\" >1996 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1995\" >1995 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1994\" >1994 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1993\" >1993 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1992\" >1992 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1991\" >1991 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1990\" >1990 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1989\" >1989 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1988\" >1988 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1987\" >1987 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1986\" >1986 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1985\" >1985 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1984\" >1984 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1983\" >1983 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1982\" >1982 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1981\" >1981 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1980\" >1980 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1979\" >1979 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1978\" >1978 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1977\" >1977 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1976\" >1976 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1975\" >1975 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1974\" >1974 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1973\" >1973 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1972\" >1972 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1971\" >1971 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1970\" >1970 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1969\" >1969 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1968\" >1968 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1967\" >1967 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1966\" >1966 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1965\" >1965 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1964\" >1964 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1963\" >1963 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1962\" >1962 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1961\" >1961 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1960\" >1960 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1959\" >1959 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1958\" >1958 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1957\" >1957 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1956\" >1956 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1955\" >1955 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1954\" >1954 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1953\" >1953 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1952\" >1952 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1951\" >1951 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1950\" >1950 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1949\" >1949 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1948\" >1948 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1947\" >1947 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1946\" >1946 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1945\" >1945 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1944\" >1944 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1943\" >1943 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1942\" >1942 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1941\" >1941 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1940\" >1940 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1939\" >1939 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1938\" >1938 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1937\" >1937 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1936\" >1936 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1935\" >1935 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1934\" >1934 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1933\" >1933 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1932\" >1932 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1931\" >1931 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1930\" >1930 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1929\" >1929 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1928\" >1928 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1927\" >1927 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1926\" >1926 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1925\" >1925 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1924\" >1924 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1923\" >1923 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1922\" >1922 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1921\" >1921 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1920\" >1920 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1919\" >1919 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1918\" >1918 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1917\" >1917 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1916\" >1916 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1915\" >1915 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1914\" >1914 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1913\" >1913 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1912\" >1912 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1911\" >1911 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1910\" >1910 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1909\" >1909 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1908\" >1908 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1907\" >1907 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1906\" >1906 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1905\" >1905 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1904\" >1904 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1903\" >1903 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1902\" >1902 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1901\" >1901 <\/option>\r\n\t\t\t\t\t\t\t\t\t<option value=\"1900\" >1900 <\/option>\r\n\t\t\t\t\t\t\t<\/select>\r\n\t\t<\/p>\r\n\t\t\t\t<p class=\"checkbox\" >\r\n\t\t\t<input type=\"checkbox\" name=\"newsletter\" id=\"newsletter\" value=\"1\" \/>\r\n\t\t\t<label for=\"newsletter\">Sign up for our newsletter<\/label>\r\n\t\t<\/p>\r\n\t\t<p class=\"checkbox\" >\r\n\t\t\t<input type=\"checkbox\"name=\"optin\" id=\"optin\" value=\"1\" \/>\r\n\t\t\t<label for=\"optin\">Receive special offers from our partners<\/label>\r\n\t\t<\/p>\r\n\t\t\t<\/fieldset>\r\n\t\t\t<fieldset class=\"account_creation\">\r\n\t\t<h3>Your address<\/h3>\r\n\t\t\t\t\t\t\t\t\t<p class=\"required text\">\r\n\t\t\t\t\t<label for=\"firstname\">First name <sup>*<\/sup><\/label>\r\n\t\t\t\t\t<input type=\"text\" class=\"text\" id=\"firstname\" name=\"firstname\" value=\"\" \/>\r\n\t\t\t\t<\/p>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"required text\">\r\n\t\t\t\t\t<label for=\"lastname\">Last name <sup>*<\/sup><\/label>\r\n\t\t\t\t\t<input type=\"text\" class=\"text\" id=\"lastname\" name=\"lastname\" value=\"\" \/>\r\n\t\t\t\t<\/p>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"text\">\r\n\t\t\t\t\t<label for=\"company\">Company<\/label>\r\n\t\t\t\t\t<input type=\"text\" class=\"text\" id=\"company\" name=\"company\" value=\"\" \/>\r\n\t\t\t\t<\/p>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<div id=\"vat_number\" style=\"display:none;\">\r\n\t\t\t\t\t<p class=\"text\">\r\n\t\t\t\t\t\t<label for=\"vat_number\">VAT number<\/label>\r\n\t\t\t\t\t\t<input type=\"text\" class=\"text\" name=\"vat_number\" value=\"\" \/>\r\n\t\t\t\t\t<\/p>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"required text\">\r\n\t\t\t\t\t<label for=\"address1\">Address <sup>*<\/sup><\/label>\r\n\t\t\t\t\t<input type=\"text\" class=\"text\" name=\"address1\" id=\"address1\" value=\"\" \/>\r\n\t\t\t\t\t<span class=\"inline-infos\">Street address, P.O. box, company name, c\/o<\/span>\r\n\t\t\t\t<\/p>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"text\">\r\n\t\t\t\t\t<label for=\"address2\">Address (Line 2)<\/label>\r\n\t\t\t\t\t<input type=\"text\" class=\"text\" name=\"address2\" id=\"address2\" value=\"\" \/>\r\n\t\t\t\t\t<span class=\"inline-infos\">Apartment, suite, unit, building, floor, etc.<\/span>\r\n\t\t\t\t<\/p>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"required postcode text\">\r\n\t\t\t\t\t<label for=\"postcode\">Zip \/ Postal Code <sup>*<\/sup><\/label>\r\n\t\t\t\t\t<input type=\"text\" class=\"text\" name=\"postcode\" id=\"postcode\" value=\"\" onkeyup=\"$('#postcode').val($('#postcode').val().toUpperCase());\" \/>\r\n\t\t\t\t<\/p>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"required text\">\r\n\t\t\t\t\t<label for=\"city\">City <sup>*<\/sup><\/label>\r\n\t\t\t\t\t<input type=\"text\" class=\"text\" name=\"city\" id=\"city\" value=\"\" \/>\r\n\t\t\t\t<\/p>\r\n\t\t\t\t<!--\r\n\t\t\t\t\tif customer hasn't update his layout address, country has to be verified\r\n\t\t\t\t\tbut it's deprecated\r\n\t\t\t\t-->\r\n\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"required select\">\r\n\t\t\t\t\t<label for=\"id_country\">Country <sup>*<\/sup><\/label>\r\n\t\t\t\t\t<select name=\"id_country\" id=\"id_country\">\r\n\t\t\t\t\t\t<option value=\"\">-<\/option>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"8\" selected=\"selected\">France<\/option>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"17\" >United Kingdom<\/option>\r\n\t\t\t\t\t\t\t\t\t\t\t<\/select>\r\n\t\t\t\t<\/p>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"required id_state select\">\r\n\t\t\t\t\t<label for=\"id_state\">State <sup>*<\/sup><\/label>\r\n\t\t\t\t\t<select name=\"id_state\" id=\"id_state\">\r\n\t\t\t\t\t\t<option value=\"\">-<\/option>\r\n\t\t\t\t\t<\/select>\r\n\t\t\t\t<\/p>\r\n\t\t\t\t\t\t\t\t\t<p class=\"textarea\">\r\n\t\t\t<label for=\"other\">Additional information<\/label>\r\n\t\t\t<textarea name=\"other\" id=\"other\" cols=\"26\" rows=\"3\"><\/textarea>\r\n\t\t<\/p>\r\n\t\t\t\t\t<p class=\"inline-infos\">You must register at least one phone number<\/p>\r\n\t\t\t\t<p class=\"text\">\r\n\t\t\t<label for=\"phone\">Home phone<\/label>\r\n\t\t\t<input type=\"text\" class=\"text\" name=\"phone\" id=\"phone\" value=\"\" \/>\r\n\t\t<\/p>\r\n\t\t<p class=\"text\">\r\n\t\t\t<label for=\"phone_mobile\">Mobile phone <sup>*<\/sup><\/label>\r\n\t\t\t<input type=\"text\" class=\"text\" name=\"phone_mobile\" id=\"phone_mobile\" value=\"\" \/>\r\n\t\t<\/p>\r\n\t\t<p class=\"required text\" id=\"address_alias\">\r\n\t\t\t<label for=\"alias\">Assign an address alias for future reference <sup>*<\/sup><\/label>\r\n\t\t\t<input type=\"text\" class=\"text\" name=\"alias\" id=\"alias\" value=\"My address\" \/>\r\n\t\t<\/p>\r\n\t<\/fieldset>\r\n\t<fieldset class=\"account_creation dni\">\r\n\t\t<h3>Tax identification<\/h3>\r\n\t\t<p class=\"required text\">\r\n\t\t\t<label for=\"dni\">Identification number<\/label>\r\n\t\t\t<input type=\"text\" class=\"text\" name=\"dni\" id=\"dni\" value=\"\" \/>\r\n\t\t\t<span class=\"form_info\">DNI \/ NIF \/ NIE<\/span>\r\n\t\t<\/p>\r\n\t<\/fieldset>\r\n\t\t\r\n\t<p class=\"cart_navigation required submit\">\r\n\t\t<input type=\"hidden\" name=\"email_create\" value=\"1\" \/>\r\n\t\t<input type=\"hidden\" name=\"is_new_customer\" value=\"1\" \/>\r\n\t\t\t\t<input type=\"submit\" name=\"submitAccount\" id=\"submitAccount\" value=\"Register\" class=\"exclusive\" \/>\r\n\t\t<span><sup>*<\/sup>Required field<\/span>\r\n\t<\/p>\r\n<\/form>\r\n","token":"485d03cca450087c8a4eb35420e925de"} Pas d'erreur donc dans ma Response qui pourrait bloquer la fin de la requête... Merci d'avance aux âmes charitables XD Link to comment Share on other sites More sharing options...
Powerplex Posted March 22, 2013 Author Share Posted March 22, 2013 (edited) Tadaaaaaam ! J'ai trouvé et c'était simple sans l'être ! Apparemment et au vu des nombreux topics sur le sujet, Prestashop 1.5.2 et 1.5.3 ont souvent ce problème de JSON qui n'est pas accessible à l'inscription. Pour contourner le problème, il suffit de modifier l'appel Ajax dans Authentication.tpl : 1 - Remplacer le datatype 'json' par 'html'. 2 - Remplacer les occurences de jsonData par 'data'. Ainsi, on rentre dans la fonction success (il devait y avoir un problème d'encodage ou un script bloquant dans le JSON) En gros voici la requête Ajax qu'il faut : $.ajax({ type: 'POST', url: baseUri, async: true, cache: false, dataType : "html", data: { controller: 'authentication', SubmitCreate: 1, ajax: true, email_create: $('#email_create').val(), token: token }, success: function(data) { if (data.hasError) { var errors = ''; for(error in data.errors) //IE6 bug fix if(error != 'indexOf') errors += '<li>'+data.errors[error]+'</li>'; $('#create_account_error').html('<ol>'+errors+'</ol>').show(); } else { // adding a div to display a transition $('#center_column').html('<div id="noSlide">'+$('#center_column').html()+'</div>'); $('#noSlide').fadeOut('slow', function(){ $('#noSlide').html(data); // update the state (when this file is called from AJAX you still need to update the state) bindStateInputAndUpdate(); }); $('#noSlide').fadeIn('slow'); document.location = '#account-creation'; } }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: unable to load form.\n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus); } }); Voilà voilà, j'éspère que ce topic servira à ceux qui ont bloqué dessus comme moi. EDIT : J'ai oublié autre chose, il faut commenter une ligne dans AuthController.php sinon vous aurez une page blanche... La ligne se trouve dans la fonction initContent vers la toute fin (ligne 155 pour moi). die(Tools::jsonEncode($return)); ==> Une fois cette ligne commentée et la requête modifiée tout est OK Edited March 22, 2013 by Powerplex (see edit history) 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