VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: mbarry on January 24, 2014, 06:21:41 AM

Title: Shopper Field Title defaults to Mr instead of blank
Post by: mbarry on January 24, 2014, 06:21:41 AM
VM 2.0.26d
J2.5.17

The sql installation script (install_required_data.sql ) only installs two entries for Shopper Field 'title', these are "Mr" and "Mrs".
As this field in our VM1 site is not mandatory, many users opted not to fill it in. We also had many other 'title' possibilities other than the two mentioned above.     

My solution to the above problem was as follows:
      Edit Configuration -> Shopper Fields
      Field Name = 'title'
     
      Create empty first value leave both the value and title blank. This will trigger the drop down to display "Select an Option" instead of displaying "Mr"
      Create additional Values for 'title' Shopper Field as required

      In my case, when done it should look like this:
      Value     Title
       
      Mr.         Mr
      Mrs.       Mrs
      Miss.      Miss
      Ms.        Ms
      Dr.        Dr
      Prof.      Prof
     
      An interim solution would be to update file install_required_data.sql so that these fields are available from installation.
      A more permanent solution could be to make these language dependent rather than hard-coded.
     
     
     File: administrator/components/com_virtuemart/install/install_required_data.sql

      INSERT INTO `#__virtuemart_userfield_values` ( `virtuemart_userfield_id`, `fieldtitle`, `fieldvalue`, `sys`, `ordering`, `created_on`, `created_by`, `modified_on`, `modified_by`, `locked_on`, `locked_by`) VALUES
      ( 10, '', '', 0, 0, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0),
      ( 10, 'Mr', 'Mr.', 0, 1, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0),
      ( 10, 'Mrs', 'Mrs.', 0, 2, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0),
      ( 10, 'Miss', 'Miss.', 0, 3, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0),
      ( 10, 'Ms', 'Ms.', 0, 4, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0),
      ( 10, 'Dr', 'Dr.', 0, 5, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0),
      ( 10, 'Prof', 'Prof.', 0, 6, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0);
     
Title: Re: Shopper Field Title defaults to Mr instead of blank
Post by: AH on January 24, 2014, 09:22:16 AM
I invariably remove the title as it is never germane to the purchase and is just another field to complete.

For us, the less fields a user has to complete in order for us to manage their purchase, the better.

Same goes for middle name!
Title: Re: Shopper Field Title defaults to Mr instead of blank
Post by: jenkinhill on January 24, 2014, 10:15:29 AM
I agree, the title field is usually removed from the sites I build unless specially requested. In any case the shopper fields are easily edited for those who need different titles, such as Revd or Bishop
Title: Re: Shopper Field Title defaults to Mr instead of blank
Post by: mbarry on January 24, 2014, 15:57:04 PM
No Problem, my partner wanted the field for her existing web site so I had to bring it across. I was going to turn it off originally however,  I saw a number of posts regarding this issue and anything that can help with a seamless migration from VM1 to VM2 is a good thing.

Ultimately, I agree that less is more when it comes to registration and have also disabled the "middle name" along with all the Joomla profile data.