PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

 

Mobile phone number is a MUST during registration

28 replies to this topic
#1
fitgura

    PrestaShop Apprentice

  • Members
  • PipPip
  • 203 posts
Hi guys!

First of all, I would say a great thanks for the prestaTeam about this product!

And I have an issue what can't solve alone:

I could need to modify the registration form, to show that the mobile number is a required field during the registration!!!

Can I do this somehow??? Could help me somebody where and how to proceed this????????

Thanks for your help

:)

ps: I use ps 1.1.0.5 version
The road to success always Under Construction!

#2
Floobynooby

    PrestaShop Apprentice

  • Members
  • PipPip
  • 57 posts
So what about potential customers who don't have a mobile phone? (not everyone has one) Are you going to turn them away?
The code for this may help though its validating the phone for the contact page, which I guess may be kind of similar.
http://www.prestasho...he_contact_form

#3
rocky

    PrestaShop Superstar

  • US Moderators
  • 9988 posts
I'm using v1.2, but this should work on v1.1 too. You need to modify line 80 of classes/Address.php. Change it from:


protected $fieldsRequired = array('id_country', 'alias', 'lastname', 'firstname', 'address1', 'postcode', 'city');


to:


protected $fieldsRequired = array('id_country', 'alias', 'lastname', 'firstname', 'address1', 'postcode', 'city', 'phone_mobile');


You then need to find each line like the following in address.tpl and authentication.tpl:


<input type="text" id="phone_mobile" name="phone_mobile" value="{if isset($smarty.post.phone_mobile)}{$smarty.post.phone_mobile}{else}{$address->phone_mobile|escape:'htmlall':'UTF-8'}{/if}" />


then add the following after:

*


to add a red star after the mobile text fields so the user knows they are required.
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.

#4
fitgura

    PrestaShop Apprentice

  • Members
  • PipPip
  • 203 posts
A big thanx for all of you!!!

I did it!!! yes it is working and I'm really happy right now!!!

Thanks Rocky

To Floobynooby: I think in 2009 who use an internet for buying, that person deffenetly has a cellphone (I hope so) !! because we will need to call the customers back to filtering the fake orders!!!

Anyway it could be an idea for the next ps revision, to take parts of the registration form optional switchable , because the registation is the most important part of the shop!!!
The road to success always Under Construction!

#5
benofino

    PrestaShop Newbie

  • Members
  • Pip
  • 16 posts
Hi did this modification, working well. However the little * is grey instead of red...

#6
MikeG

    PrestaShop Apprentice

  • Members
  • PipPip
  • 41 posts

From 1255037329:

Hi did this modification, working well. However the little * is grey instead of red...


You also need to change this :




into :



in the address.tpl and authentication.tpl files

#7
benofino

    PrestaShop Newbie

  • Members
  • Pip
  • 16 posts
Merci man. Ça marche maintenant.

#8
amandloren

    PrestaShop Apprentice

  • Members
  • PipPip
  • 53 posts
;-) super merci !
ça marche !
Type d’install : nouvelle en cours de modif
Version de PS : Version 1.2.5.0
Thème : défaut modifié
Code : original + qqs modifs
Hébergement : 1&1;en serveur dédié
Version de PHP : actuel 4.4.9 pour OSC mais .htaccess pour PS
Version de MySQL : actuel 4 pour OSC mais 5 pour PS
Navigateur utilisé : quelle question, Mozilla Firefox 3.5.5

#9
alphaZ

    PrestaShop Newbie

  • Members
  • Pip
  • 5 posts
this modification sucks it doesn't work for me

#10
alphaZ

    PrestaShop Newbie

  • Members
  • Pip
  • 5 posts
solved

should set var $compile_check = true in Smarty.class.php

now its workin...

#11
Klixin

    PrestaShop Newbie

  • Members
  • Pip
  • 11 posts
I did this mod, now when i go as a customer and click update address or add address i get a blank inner screen. nothing loads up.

anyone get this?

#12
deepee

    PrestaShop Apprentice

  • Members
  • PipPip
  • 121 posts
It works fine for me.
Check your punctuation for errors, extra spaces etc.

#13
Klixin

    PrestaShop Newbie

  • Members
  • Pip
  • 11 posts
Ok i found out what the problem was.

First thing I did was the same as what this fella did

http://www.prestasho...pdate_addresses

and then just re-modded it, and it worked fine.. so yeah i stuffed up somewhere.

But then i went to put in a mobile number and hit save it came up with this hack attempt
Hack attempt (Address -> phone_mobile is empty)

So i went into phpmyadmin and placed a whole bunch of 000000's in phone_mobile in everyones ps_address that didnt put in a mobile number from the start (because it wasnt required back then).

If they put in a mobile number from the start it didnt make a hack attempt.

So this just means when they decide to go in an update their mobile numbers it wont come up with a hack attempt.


many thanks.

#14
ToXo

    PrestaShop Apprentice

  • Members
  • PipPip
  • 28 posts
Hi Rocky, where can I find those authentication.tpl ?
I found only authentication.php and there are no such lines as you mentioned, please help me with this
Thanks

#15
rocky

    PrestaShop Superstar

  • US Moderators
  • 9988 posts
They are in your theme's directory.
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.

#16
lafondadebaco

    PrestaShop Apprentice

  • Members
  • PipPip
  • 54 posts

From 1279244672:

Ok i found out what the problem was.....

So i went into phpmyadmin and placed a whole bunch of 000000's in phone_mobile in everyones ps_address that didnt put in a mobile number from the start (because it wasnt required back then).

....
.


Thanks Klixin! your solution works excellent for me after hours of burning my eyes. THANKS!!!

#17
Nondo

    PrestaShop Apprentice

  • Members
  • PipPip
  • 189 posts

From 1294171650:

From 1279244672:

Ok i found out what the problem was.....

So i went into phpmyadmin and placed a whole bunch of 000000's in phone_mobile in everyones ps_address that didnt put in a mobile number from the start (because it wasnt required back then).

....
.


Thanks Klixin! your solution works excellent for me after hours of burning my eyes. THANKS!!!

I tried to do the same, but when I open phpmyadmin -> ps_address it only comes up with two customers - the default John Doe and STEVE JOBS...

Am I looking the wrong place?

#18
rocky

    PrestaShop Superstar

  • US Moderators
  • 9988 posts
Perhaps you are looking at the wrong prefix? Do you have multiple PrestaShops installed in the same database?
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.

#19
lafondadebaco

    PrestaShop Apprentice

  • Members
  • PipPip
  • 54 posts
Yes, that is the right place.

Have you followed all steps as rocky described? What error are you getting?

#20
Nondo

    PrestaShop Apprentice

  • Members
  • PipPip
  • 189 posts

From 1294233582:

Perhaps you are looking at the wrong prefix? Do you have multiple PrestaShops installed in the same database?


Found it - they were located under "ps_nondoaddress" ...

EDIT: By the way, can I safely delete customers (like test registrations and such) individually under phpmyadmin? I know I can delete them in BO, but they're not completely deleted as the same e-mail address can not be used again.