Jump to content

Custom fields - smarty.post issue


Recommended Posts

Hy, i followed this tutorial to add some custom fields:

http://www.prestashop.com/forums/topic/166078-solved-how-can-i-add-custom-fields-to-new-user-registration/page__p__1287453#entry1287453

 

I added the Field CNP (Personal numeric code) but i have a problem. For example, in front office, in my account details i have the field CNP displayed. If i fill it with my cnp then press save, the cnp i have entered dissapears. So i looked in identity.tpl at the source code and for firstname, lastname and email, wich are displayed, i have the sintax value="{$smarty.post.firstname}" so i've added my own code:

 

<p class="text">

<label for="referralcode">{l s='CNP'}</label>

<input name="referralcode" type="text" class="text" id="referralcode" value="{$smarty.post.referralcode}" />

</p>

 

But it doesn;t work...stil in my accoount on cnp field, after pressing save, is blank. In back office i can see it... so what am i doing wrong?! Because CNP is numerical value (ex:186011912345) and class is "text" i must replace text with somenthing else?!

 

Pls someone help...

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
Try this it worked for me,

 

<p class="text">

            <label for="referralcode">{l s='Referral code'}</label>

            <input name="referralcode" type="text" class="text" id="referralcode" value="{if isset($smarty.post.referralcode)}{$smarty.post.referralcode}{/if}" />

        </p>

Link to comment
Share on other sites

×
×
  • Create New...