WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Bakery Shop => Topic started by: elarifr on October 11, 2011, 09:16:30 PM

Title: user state request bug & Fr translation to change
Post by: elarifr on October 11, 2011, 09:16:30 PM
hello
seems bakery 1.5.7 has a bug in customer state

when editing customer adress with french state i have an error :

25 n'est pas un nom de région valide.
74 n'est pas un nom de région valide.

Veuillez vérifier les données saisie!



i have to remove state in page setting to go ahead

and in fr translation page setting it shows
Formulaire d'Adresse:    Afficher le Champ Information
which means : Show Information Field

I presume it should mean : Request State Field
that can be translated by : Demander la région


i had opened a threat in french support but i think it's better to report here
br
elarifr
Title: Re: user state request bug & Fr translation to change
Post by: freeSbee on October 12, 2011, 12:59:54 PM
Hi elarifr

Since France uses numbers as state codes (Régions), Bakery verifies them as invalid.
A quick fix would be (view.php, about line 501):
Code: [Select]
if (!ereg("^[A-Za-z.".$add_chars." -]{1,50}$",$value)) {change to
Code: [Select]
if (!ereg("^[A-Za-z0-9.".$add_chars." -]{1,50}$",$value)) {
Regards Christoph
Title: Re: user state request bug & Fr translation to change
Post by: elarifr on October 13, 2011, 08:32:23 AM
thanks
i will check tomorrow.

but maybe should be more accurate to check if in array $MOD_BAKERY['TXT_STATE_CODE'][] ?
for existing language/country/state and regex for other country ?

also for FR translation
$MOD_BAKERY['TXT_SHOW_STATE_FIEL D'] = 'Afficher le Champ Région';


do you plan to add a customer management ?
something outside the wb users backend. it should be a mod_bakery_user table with login/password/adress management for returning customers so that we should populate adress from a $_session customer_id instead of $_Session user_Id as for instance mod_bakery_customer is a mix of customer and order
maybe a separate module bakery_customer can be added to manage customer info, provide a login box, manage order... bakery itself would just have to be updated to check if module is loaded to populate the customer form instead of using user_id. at first view this way should have very little side effect for existing & running bakery website. hope it will have some sense for you 

br
elarifr