I made this tweak to remove the displayed name (COM_VIRTUEMART_USER_DISPLAYED_NAME) and the username field.
There should be an option to use email as username, and simply save mail as user in joomla too.
Anyway, copy components\com_virtuemart\views\user\tmpl\edit_address_userfields.php inside /templates/[yourtemplate]/html/com_virtuemart/user/ (create folders if they don't exist) , add the code below and it'll work.
Download the attachment to get the complete file for virtuemart 2.0.10
echo ' <table class="adminForm user-details">' . "\n";
$_table = true;
}
echo ' <tr>' . "\n";
echo ' <td class="key" title="'.$_field['description'].'" >' . "\n";
echo ' <label class="' . $_field['name'] . '" for="' . $_field['name'] . '_field">' . "\n";
echo ' ' . $_field['title'] . ($_field['required'] ? ' *' : '') . "\n";
and replace echo ' <tr>' . "\n";
with
if($_field['name'] == "name" or $_field['name'] == "username"){
echo ' <tr style="display:none;">' . "\n";
}
else{
echo ' <tr>' . "\n";
}
What does it do: makes the tables row for the field user and username invisible
Then add this in the bottom of the script
?>
<script type="text/javascript">
if (document.getElementById('email_field')) {
document.getElementById("email_field").setAttribute("onchange", "utente_uguale_email()");
}
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>
<?php
What does it do: adds a javascript function. When the user writes something in the email field, we'll copy that inside our invisible user and username fields
[attachment cleanup by admin]
@littlesnack,
QuoteWarning: always back up your file before editing it
NOTICE: You should never hack the core template (or the core files in general). Use template overrides, that's what they're there for.
http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core (http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core)
http://docs.joomla.org/Understanding_Output_Overrides (http://docs.joomla.org/Understanding_Output_Overrides)
But otherwise, a nice solution.
Mmmm... very very interesting....
Thx snack!!
Quote from: ivus on September 05, 2012, 00:59:53 AM
QuoteWarning: always back up your file before editing it
[
After a year tunning everything... ;D I have 2 pages list of hackings for every update!
Quote from: ivus on September 05, 2012, 00:59:53 AM
@littlesnack,
NOTICE: You should never hack the core template (or the core files in general). Use template overrides, that's what they're there for.
You're right, i will update the post with template overrides. And update my site too. Thanks.
And if i had to override components\com_virtuemart\controllers\cart.php ????
I tried with templates/[mytemplate]/html/com_virtuemart/cart.php and templates\[mytemplate]\html\com_virtuemart\controllers\cart.php
That's a controller. They're protected.
You can only override templates and module layouts.
Thank you, thank you, thank you !
Edit for Virtuemart 2.0.18a
I only added this to the bottom of edit_address_userfields.php in my html template folder:
<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>
Then in my template css I added the following:
label.name, input#name_field, label.username, input#username_field {
display: none;
}
And it works !
Thank you very much for your simple and genius solution to two of my problems !
Best Regards,
Teodor Ovcharov
This doesn't work for me. How can i make it work for VM 2.0.2b?
Thanks.
Yes, this doesn't work for VM 2.20b :(
I have the same problem. Looks like there are a lot of changes since 2.18 version. Looking for the solution for 2.20b ... ...
Anybody knows?
Quote from: webmaxter on April 04, 2013, 15:01:53 PM
Yes, this doesn't work for VM 2.20b :(
I have the same problem. Looks like there are a lot of changes since 2.18 version. Looking for the solution for 2.20b ... ...
Anybody knows?
I too have this problem...the code is totally different in the 2.20 of virtuemart. Can anyone shed some light on how we hide/autofill this ridiculous field "displayed name" on the registration form.
the code is like this now:
<table class="adminForm user-details">
<?php
}
// Output: Userfields
?>
<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>
Ok I think I have found the solution for v2.02 users....you just use the script and css as supplied previously. I only wanted to hide the Displayed Name but leave the Username there....i pasted the below onto line 89 after the </fieldset> in the edit_address_userfields.php file
<script type="text/javascript">
document.getElementById("username_field").setAttribute("onchange", "username_is_user()");
function username_is_user(){
var reg_username = document.getElementById("username_field").value
document.getElementById("name_field").value = (reg_username);
}
</script>
In my instance the label was not it's own css class, it sat amongst a bunch of other css and for whatever reason the label.name override wouldn't work for me, so I had to create a new label class (and delete label from where it previously sat) and then add the subsequent label.name class.
I created the below to suit my situation:
label {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
label.name, input#name_field {
display: none;
}
Displayed name is now hidden and automatically fills out with the username
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>
Hi all,
VM 2.0.22c
I am using also Onepage Checkout.
No one of the samples above work for me.
Do you have any idea?
You need to contact developer of OPC. It has slightly different structure then VM.
I was having the same problem.
Your solution is GRATE! But the problem is that you javascript IS NOT cross browser, so in some browsers the code will not work, and the user will get stuck, as the JS will not "copy" the content from email_field and "paste" it on the other two (name and user_name), as the form validator is expecting the user to complete every field, but we hide and left empty some textbox.
To fix this we can use jquery that solve this for us, with only this code instead:
<script type="text/javascript">
var $j = jQuery.noConflict(); //avoid conflict with other libraries
$j('#username_field').change(function () {
var reg_user = $j('#username_field').val(); //set username value inside variable
$j('#name_field').val(reg_user); //assign variable value to name
});
</script>
Note that im leaving user_name visible, and making name = user_name. Make necessary changes to fit your needs.
Also, this code should be AFTER the html table, otherwise it will not work.
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.
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.
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]
How to remove this field in Virtuemart 3
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
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."
Of course, it is need for joomla, when you unpublish the fields, the checkout works only for guests.
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/ )...
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.
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
This new extension solves it for you
http://extensions.virtuemart.net/vm-orders/automated-numbers-detail
This really looks promising Max, cool. :)
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.
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
Support for the plugin is by ticket. http://extensions.virtuemart.net/support-updates
just do it
Please write a ticket here http://extensions.virtuemart.net/ticket
It is maybe a core problem and solved in vm3.0.13
I bought the plugin, installed and still same, I am having the same error about missing user name field...
- option 1: the plıgin is not working
- option 2 : I could not set it
there is no documentation about the plugin how do we set this ?
Look at the attached image.
And if you bought it you have access to support for it in the help desk: http://extensions.virtuemart.net/ticket
Milbo,
I need support now !
I bought the plugin, installed and still same, I am having the same error about missing user name field...
- option 1: the plıgin is not working
- option 2 : I could not set it
there is no documentation about the plugin how do we set this ?
Look at the image, click the highlighted menu item in your own admin!
Create a support ticket if you don't find it!
What is your problem Rune Rasmussen
I am not idiot I can see that
that is not working
my question is how we set the plugin
stop replying me ! you have no idea about the plugin
Milbo I am waiting reliable support now !
@ifs-net
you are mistaken as to what this forum is for.. you have been told multiple times to direct your support requests to http://extensions.virtuemart.net/ticket
This forum is NOT for http://extensions.virtuemart.net extensions support - this is a community forum for the VM core component
You click on that menu link to set the plugin, of course. In there is some docs on how to set it too.
There is nothing in your posts telling us you can see anything, so how should anyone know. And I use this plugin yes, so it's both working, and I surely have some ideas about it. Anyhow, use the extension support, and someone surely will respond to you, and tell you to go to the settings for it. :)
Sometimes I wonder if this people just not know the option that only guest can checkout in vm.
It is a bit strange, on one hand, you want that the people register, on the other hand you dont want that they can change or enter their loginname.
Milbo,
There is "username" "name" and "displayed name" which is confusing the clients mind...
Of course there is guest check out.
No body understands what is displayed name and nobody enters that field. Instead of filling that field they are leaving the register area...
That is the problem
Rune,
Stop replying me. You are writing meanless replies.
If you know how set, write it. If not stop wasting my time.
Milbo,
I do not know how to set the plugin, there is no example or manual.
How do I write a format ? Give me some examples for "Username format"...
Sometimes I wonder how people can code such kind of unlogical registration form...
Quote from: ifs-net on September 13, 2016, 01:02:45 AM
There is "username" "name" and "displayed name" which is confusing the clients mind...
Depends, usually it does not confuse people who are used to computer. You can rename it, to loginname, for example. You should also know that the loginname is part of the password is part of security.
Quote from: ifs-net on September 13, 2016, 01:02:45 AM
Of course there is guest check out.
Why do you want then, that the people register? If people do not understand what a loginname is, they dont need to be registered, they wont use the account again, they cant login!
Quote from: ifs-net on September 13, 2016, 01:02:45 AM
No body understands what is displayed name and nobody enters that field. Instead of filling that field they are leaving the register area...
That is the problem
uhm, you ever used Facebook? Or something similar?
Quote from: ifs-net on September 13, 2016, 01:02:45 AM
Milbo,
I do not know how to set the plugin, there is no example or manual.
There is an explantion how to use it within the plugin, when you use it. But as I told already per ticket, you use this plugin as workaround!
Because you want that people register, without showing the input fields for registration. A kind of silent registration. So the plugin fills fields automatically by given format.
Quote from: ifs-net on September 13, 2016, 01:02:45 AM
How do I write a format ? Give me some examples for "Username format"...
http://extensions.virtuemart.net/account-tutorials/19-shopper-fields-plugins/29-automated-numbers
Quote from: ifs-net on September 13, 2016, 01:02:45 AM
Sometimes I wonder how people can code such kind of unlogical registration form...
When it is illogical, just disable the registration. The world is quite simple, the more features you want, the more complex it is.
Quote from: Rune Rasmussen on September 13, 2016, 09:05:51 AM
Quote from: ifs-net on September 10, 2016, 23:28:33 PM
I am not idiot
You have convinced me now for sure ...
You convinced me, TOP! Also nice idea, just to take the email :-)
As usual you have convinced me too the most smart guys of the world
You know what... I am not surprised..
this is your quality!! what you understand from support
I really regret that I am using virtuemart
Your buggy plugin is not working...
as expected
I don't know your problem, but surely you should not have usernames with comma and space (ifs, n)... I think the bug is elsewhere, sorry ... lol ... :-X
Btw! Are you even using VirtueMart checkout, or a third party checkout ...?
This is what you understand from solution NOT IDIOT BUT VERY SMART GUYS
I am sure that it is like facebook as your big virtuemart company is as big as facebook and you are as clever as zukerberg...
You have right it is very very uncofusing and I am dumb
Yes yes sure it is working without dash
there is no bug I m dumb
you are as smart as zukerberg and as big as facebook
Tell me, why do you display and ask people to fill the username field if you want to have it auto generated?
Don't know what you are etc. but surely you don't act much rationally, and you surely doesn't encourage anyone to even want to consider helping you. Think!
QuoteBtw! Are you even using VirtueMart checkout, or a third party checkout ...?
It is funny that you are not understanding the problem!!!!
the problem is not with you Rune Rasmussen, the problem is virtuemart support people.
since 6 weeks they are not solving that simple issue...
And they are sending different kind underestimating emails, instead of fixments...
Now they have to solve it!!!
It is not logical to have "name", "surname", "username", "displayed name" at the same time.
I do not want to have displayed name.
It is very simple, I do not want it...
I do not care how to solve
Simply I do not want a displayed name field thats all...
and yes I am using virtuemart checkout
this is only a 3rd party template staff VMUIKIT
All I do is with a little bit of JS fill the username and name with the email and hide the name
then the email is the username
https://www.suzistore.com.au/my-account/editaddresscartBT.html
Milbo,
You have guaranteed that this plugin will fix the issue..
You wasted my 6 weeks for nothing !
Now fix your plugin or if you are not able to fix, pay my money back !
I will pay a real smart developer for a real fix !
And you can continue playing your WE ARE BIG COMPANY game without me !
Nobody can understand your problem if you're just shouting, without explaining anything.
http://vmuikit.com/ (http://vmuikit.com/) modifies the checkout I'm quite sure off, and it might not work well together with the plugin. I have not tested, and don't intend to. But if the problem is the plugin not working with VMuikit, you need to get some custom work for it, and can't claim a plugin made for core checkout to be broken when you don't use the core checkout.
But try to hide (unpublish) the shopper fields you override with this plugin, it's a simple core config and has nothing to do with the plugin working or not: http://docs.virtuemart.net/manual/configuration-menu/edit-shopper-field.html (http://docs.virtuemart.net/manual/configuration-menu/edit-shopper-field.html)
Dear Rune Rasmussen,
Pls do not reply my posts...
You have no idea what I am talking about..
This field is not removable, even if you unpublish it it still needed...
Pls do not reply my posts you do not have enough experience on the issue..
I tried with VMUIKIT unpublished too. The issue continues
Again pls stop replying my posts..
The responsable part is VM support team, THEY HAVE TO FIX THAT as they are big company, they have to take the responsibility of their plugins.
I did mine, I bough the plugin !
NOW IT IS YOUR TURN MILBO !
FIX THE ISSUE OR ACCEPT YOU ARE NOT ABLE TO DO IT
Quote from: Rune Rasmussen on September 18, 2016, 18:30:57 PM
I don't know your problem, but surely you should not have usernames with comma and space (ifs, n)... I think the bug is elsewhere, sorry ... lol ... :-X
Btw! Are you even using VirtueMart checkout, or a third party checkout ...?
He meant your format of the username. It is non of the formats which we said you should try, instead you use the Name and a comma. A name with comma is just not permitted.
Dear ifs-net,
Nobody can understand your issue(s), when you obviously doesn't yourself.
Anyhow this is a public forum, a community forum. Not the right place for your personal conversation with Milbo or anybody else, nor is it a support channel for commercial extensions. If you don't want input from others, just stop posting here ...
https://hueniverse.com/2016/01/26/how-to-use-open-source-and-shut-the-gentle-up-at-the-same-time/
Btw you told something about 6 weeks, that is wrong. It is not our fault, that paypal does not work in turkey
Hi there,
I'm sorry to say, but I've the same problem with all this "names"
It really doesn't make sense that a normal user MUST enter his name (or any other "Displayed Name"), just because he wants to register.
Username, Password, and Emailaddress, that's it... ;)
Why don't you guys not just give your customers the freedom to choose whether they want to require this or not.
And it's not true that Joomla requires this strongly, You can disable this in Joomla by editing an .xml and Joomla still works...
As a workaround it would be very nice if you just publish the code location and lines, which need to be changed and let us know, how.
Please consider... :)
Quote from: thepet on November 09, 2016, 20:35:01 PM
Why don't you guys not just give your customers the freedom to choose whether they want to require this or not.
Max did: http://forum.virtuemart.net/index.php?topic=107226.msg461051#msg461051
Hi Rune Rasmussen,
this was actually not the answer I expected ;)
Or should I...?
I cannot see to purchase an extension, which may does not do what it should, just because of removal of a feature that nobody wants :-)
Any other idea?
Best Regards
Hartmut
Then you are free to modify the VirtueMart etc. as you like as it's open source with GPL license.
I have no idea what you expect, or why ...
The extension works perfectly fine for those being able to install and configure things correctly. Those who can't should maybe consider buying a ready to go system, VirtueMart doesn't fit for all. Sometimes I hate it myself ... ;)
it's just some simple js replacement and hide the field
any google will show u how to fill one field with another
templates\xxxxxxxxx\html\com_virtuemart\user\edit_address_userfields.php
I unpub the "name" in the DB (or hide with css and fill by js) and use the email as username
<?php
if ($addrtype != 'ST') {
?>
<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("username_field").value = (reg_email);
document.getElementById("name_field").value = (reg_email);
}
</script>
<?php } ?>
http://www.greenpackshop.com.au/my-account/editaddresscartBT
Hi all,
Same issue here.
I use Joomla! 3.6.5 with VirtueMart 3.0.18.
When a customer register with username, password, company name and address thats enough for my site.
Unfortunately when in the backend I disable the field 'name' (COM_VIRTUEMART_USER_DISPLAYED_NAME) (the field for the displayed name) it's no longer possible for a customer to register.
How to handle this issue?
Luke
Quote from: Rune Rasmussen on November 09, 2016, 20:43:17 PM
Quote from: thepet on November 09, 2016, 20:35:01 PM
Why don't you guys not just give your customers the freedom to choose whether they want to require this or not.
Max did: http://forum.virtuemart.net/index.php?topic=107226.msg461051#msg461051
Quote from: GJC Web Design on November 09, 2016, 22:14:12 PM
it's just some simple js replacement and hide the field
any google will show u how to fill one field with another
templates\xxxxxxxxx\html\com_virtuemart\user\edit_address_userfields.php
I unpub the "name" in the DB (or hide with css and fill by js) and use the email as username
<?php
if ($addrtype != 'ST') {
?>
<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("username_field").value = (reg_email);
document.getElementById("name_field").value = (reg_email);
}
</script>
<?php } ?>
http://www.greenpackshop.com.au/my-account/editaddresscartBT
Hello and thank you GJC Web Design.
I have used your trick, but only for fill the name field and use the username normally (i dont use the email address but username).
What i have made :
I have modify your file like this :
<?php
if ($addrtype != 'ST') {
?>
<script type="text/javascript">
document.getElementById("username_field").setAttribute("onchange", "username_is_name_field()");
function username_is_name_field(){
var reg_fill_name_field = document.getElementById("username_field").value
document.getElementById("name_field").value = (reg_fill_name_field);
}
</script>
<?php } ?>
I have put in my template css override :
/* For hide name_field in VM */
input[id="name_field"] {
display: none;
}
/* For hide name label in VM */
.name {
display: none;
}
So i have hided the name and label filed in the form, but not unpunished by VM config (it dosent work).
So now, when user register directly to the "my account" menu, the name field is hided but filled with the username field.
I use VP One page Checkout for the checkout, so if user place an order and register by VP it is Ok because i can hide the name field in the config of VP.
The problem I had was if users wanted to register directly before placing an order.
I hope that help someone :)
Quote from: thefbi on April 02, 2018, 10:34:03 AM
I hope that help someone :)
@ GJC & fbi
Just the solution I was looking for! Thanks a million!
Hello,
Is thera any updates to the problem in VM+Joomla standard?
Or fix is only by code as explained here?
THanks!
Quotefix is only by code as explained here
GJC i have implemented your recommended setup where Login = email, name and username is hidden by CSS but i have one problem here that in account maintenance email field is visible and editable and i can change it (and afraid that users will do by mistake), of course it does not change login name but changes name and email for user.
Have you solved this somehow?
Thanks
make it readonly with an over ride