forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 plugins => Topic started by: PhilD_UK on January 03, 2014, 11:21:08 pm
-
I am trying to add an option for "Ms." to the registration options for a new user .... (I am also using cpgShop as a plugin), and can't find where to change the code. I have added the option to the language files in cgpShop, but can't find the source code.
Also, I would like to shorten the "country" list as I only deal within europe .... again I can't find the source code.
Can anyone please point me in the right direction?
-
These options are added to registration by the CPGShop plugin...
To adjust the choice of Titles:
Update language file in cpgshop/lang/english.php (as you said you did...) (I just changed the value of 'mrs' from 'Mrs.' to to 'Ms.' but adding is certainly possible) Add whatever additional keys you want...
//profile, register
$lang_cs_profile = array(
'mr' => "Mr.",
'mrs' => "Mrs.",
'ms' ==> "Ms.", // line added as example
'prefix' => "(CPGShop)",
'title' => "Title",
Then update cpgshop/libs/cpgTool.class.php
Find:
//here's the customers title
function profile_title_array(){
return array('mr','mrs');
}
and update accordingly... These would be references to the keys (mr, mrs, ms) and not the values (Mr., Mrs., Ms.)
//here's the customers title
function profile_title_array(){
return array('mr','mrs', 'ms'); // added 'ms' to returned array of titles as example
}
The country list can also be adjusted in cpgshop/libs/cpgTool.class.php
Find:
//create country array
function countries()
{
$countries = array(
"" => "",
"af" => "Afghanistan",
"al" => "Albania",
"dz" => "Algeria",
...
and update as you wish...
I have noted (reported in March 2013 in thread http://forum.coppermine-gallery.net/index.php/topic,67506.0.html ) (http://forum.coppermine-gallery.net/index.php/topic,67506.0.html )) that these additional fields do NOT get saved when filled out during user registration - they have to be updated later...
The update doesn't show in the debug trace, but this plugin appears to use a different method for issuing SQL.
-
Thanks again for your help ....... works a treat (again). :)
I have learnt more about coding in the last 12 hours than I did in the last three weeks.
Regards
Philip
-
You're welcome...
RE: my comment:
I have noted (reported in March 2013 in thread http://forum.coppermine-gallery.net/index.php/topic,67506.0.html ) that these additional fields do NOT get saved when filled out during user registration - they have to be updated later...
The update doesn't show in the debug trace, but this plugin appears to use a different method for issuing SQL.
See the referenced thread for a simple code fix I just posted there...