News:

Looking for documentation? Take a look on our wiki

Main Menu

Remove Displayed Name / username field

Started by littlesnack, September 04, 2012, 17:39:13 PM

Previous topic - Next topic

T.A. Garrison, LLC

Maxim - You are very learned with VM, so I'd like to ask you something related to this thread.

In the vendor information, when an invoice is sent to the user, all of my information looks good - "EXCEPT"....in the footer there is a phone number that has "nothing" to do with any information I have posted anywhere in the site - or in Joomla settings.

555-555-1212

That's a generic phone number from...??

I've been trying to chase that field/ini for days, but I can't figure out from where that phone number is being pulled.

It's a line that begins with the "Thank you..." for the order, followed by the link to the vm component to show the user the products, which is then followed by the name of the vendor, and then the "bogus" phone number. There is more in the line but that should provide you enough to know "where" this data is generated and where it appears.

The correct phone number appears in the Joomla contact page, VM vendor shopper information, and elsewhere in the site.

So, where else does VM pull the phone number that appears in the invoice sent to the customer?

I keep chasing my tail trying to think where that number exists. My next step is to search the db for the number to see where it lies. Any thoughts?

Thanks.
T.A. Garrison, LLC
3150 Orleans St. # 28261
Bellingham, WA 98228

lindapowers

Quote from: LTCreations on November 29, 2013, 01:02:10 AM
Maxim - You are very learned with VM, so I'd like to ask you something related to this thread.

In the vendor information, when an invoice is sent to the user, all of my information looks good - "EXCEPT"....in the footer there is a phone number that has "nothing" to do with any information I have posted anywhere in the site - or in Joomla settings.

555-555-1212

That's a generic phone number from...??

I've been trying to chase that field/ini for days, but I can't figure out from where that phone number is being pulled.

It's a line that begins with the "Thank you..." for the order, followed by the link to the vm component to show the user the products, which is then followed by the name of the vendor, and then the "bogus" phone number. There is more in the line but that should provide you enough to know "where" this data is generated and where it appears.

The correct phone number appears in the Joomla contact page, VM vendor shopper information, and elsewhere in the site.

So, where else does VM pull the phone number that appears in the invoice sent to the customer?

I keep chasing my tail trying to think where that number exists. My next step is to search the db for the number to see where it lies. Any thoughts?

Thanks.

This happened to me due to a language issue, phone was stored in the english tables and remained there when I installed a different language pack in VM.

I had a quickstart package, therefore I had to manually change back to english in Joomla admin and remove all those details.

gripped

Quote from: Frank Carroll on September 03, 2013, 15:33:58 PM
For version 2.0.22b, in order to remove both username and displayed name, make changes to edit_address_userfields.php using overrides as described above.

Change:


<tr>
<td class="key" title="<?php echo $field['description'?>" >
<label class="<?php echo $field['name'?>" for="<?php echo $field['name'?>_field">
<?php echo $field['title'] . ($field['required'] ? ' *' ''?>
</label>
</td>
<td>
<?php echo $field['formcode'?>
</td>
</tr>


to:


<tr <?php if ($field['name']=="name" or $field['name']=="username") {echo 'style=display:none;';};?>">
<td class="key" title="<?php echo $field['description'?>" >
<label class="<?php echo $field['name'?>" for="<?php echo $field['name'?>_field">
<?php echo $field['title'] . ($field['required'] ? ' *' ''?>
</label>
</td>
<td>
<?php echo $field['formcode'?>
</td>
</tr>


That will hide the username and name fields. Then add the following JavaScript to automatically copy the email into those now hidden fields.



<script type="text/javascript">
document.getElementById("email_field").setAttribute("onchange", "mail_is_user()");

    function mail_is_user(){
var reg_email = document.getElementById("email_field").value
document.getElementById("name_field").value = (reg_email);
document.getElementById("username_field").value = (reg_email);
}

</script>







Building on this and the jquery script a few posts after here is a script that puts the email address in the username field and First name Last name in the display name field. And I've attached the whole modified file - VM 2.6.0
<script type="text/javascript">
var $j = jQuery.noConflict();

$j('#email_field').change(function () {             
var reg_email = $j('#email_field').val()
$j('#username_field').val(reg_email);
});

$j('#first_name_field').change(function () {             
var reg_name = $j('#first_name_field').val() + " " + $j('#last_name_field').val();
$j('#name_field').val(reg_name);
});

$j('#last_name_field').change(function () {             
var reg_name = $j('#first_name_field').val() + " " + $j('#last_name_field').val();
$j('#name_field').val(reg_name);
});
</script>


[attachment cleanup by admin]

kostianev

How to remove this field in Virtuemart 3

Milbo

You mean how to disable it? Come one read the manual, any view has an help option upper right (j2) or left (j3) corner. You should not remove it btw. Maybe unpublish
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

valerian

Quote from: Milbo on March 02, 2015, 14:29:23 PM
Maybe unpublish
hm... if i unpublish field "Displayed Name" at registration error appears "Save failed with the following error: Please enter your name."

Milbo

Of course, it is need for joomla, when you unpublish the fields, the checkout works only for guests.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Rune Rasmussen

Those who want to remove those confusing fields making customers run away could look at t.ex. Rupostel's One Page Checkout ( http://www.rupostel.com/ ) or LunarHotel's EmailAsUsername ( http://www.lunarhotel.co.uk/ )...
Rune Rasmussen - https://www.syntaxerror.no/

Norwegian Translation Team

lindapowers

#23
First of all.

Users can use their email already in "username" field. Actually some of our customers do, and there is absolutely no core modification in vm or joomla.

For more impopular that this is, is perfectly logic that there is a username field.


What we really didnt like is "displayed name" but once again people don't understand that even this field makes logic.

If you use for example a module to display reviews, some users will may want to hide their username or real name therefore they use the "displayed name", same if you use alphauser points where you publish list of rewards etc etc with customer names.

Last post here recommends OPC or the email as username plugin.

So here our experience:

OPC by Stan includes an option indeed for email as username but this only applies to the checkout! As fan and customer of his OPC thats how it works, makes sense he cant alter joomla or VM pages.

And email as username plugin which we used in the past... very nice it sounds but this means modifying your login module, your vm account page and probably your joomla account page. Not to mention the issues with overrides from templates and the translations from changing all username terms to email, yeah we used it and was lots of fun!


I was very critic with the VM register till I actually read and tested what Milbers was trying to tell me and the rest of users that customers should fill in most details in checkout, and thats it! we changed the default register back to joomla's register.

6 fields to enter and thats it, they are registered and if they buy they will fill in the rest of details in most cases at checkout, except some that directly do it at vm account page.  Customers understand they have to fill in details for a delivery! not a drama and not one customer lost. Use default joomla register boys.

Thomas Kuschel

You're right, I'm also not so amused about this situation to fill in the username, the name, and if enabled, the first_name, middle_name, last_name.
But I wrote a plugin to get automatically the name from the first_name, middle_name, and last_name (without attaching the core). It's made with the plgVmOnBeforeUserFieldDataSave();
Now the user only enters the first and last name (I need these fields on the page too), the name field is not shown on the form, but filled-in automatically.
Thomas

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Rune Rasmussen

Rune Rasmussen - https://www.syntaxerror.no/

Norwegian Translation Team

Milbo

Thank you.
I also want to add an option for possible overwrites. Atm the system only fills empty variables, because that is the main use case. As usual we are open to implement new features. The plugin works atm already for one customer.

But it works only for vm3.0.12 and higher. One of the reasons is the random char generator. I did not write any news about it yet, but actually the joomla generator is wrong implemented.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

logicb2b

#28
i just buy the plugin, but is not working,
shown duplicate form on beckend adn sql error on store data:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`VNAME` (`VNAME`) AFTER `ctype`' at line 1 SQL=ALTER TABLE `defa_virtuemart_extended_plg_istraxx_anumbers` CHANGE COLUMN `vname` `vname` `VNAME` (`VNAME`) AFTER `ctype`

on vm 3.0.12
joomla 3.4.8

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum