Author Topic: Registration with first_name, mail, password  (Read 2479 times)

salvoelle

  • Beginner
  • *
  • Posts: 4
  • A beginner
Registration with first_name, mail, password
« on: May 26, 2020, 02:14:42 AM »
Hi everyone,
Joomla! 3.9.18
VirtueMart 3.8.0 10319.

I need to register users by entering first_name, mail, password and password confirmation as mandatory data.
I use "System - VP One Page Checkout", with this plugin new users regularly register with first_name, email, password and password confirmation, but when they register using the joomla / virtuemart form, it gives me an error as it lacks the "name".
In addition, I cannot enter the acceptance of the Privacy, in the joomla / virtuemart registration form.
I hope I was clear.

How can I solve ??? Thanks in advance for the help

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3517
  • VirtueMart Version: 4.0.12.10777
Re: Registration with first_name, mail, password
« Reply #1 on: May 26, 2020, 10:12:54 AM »
Talk directly to the VP planet plugin developers, I believe they have a query ticket system

This is not the support forum for their paid products
Regards
A

Joomla 3.10.11
php 8.0

salvoelle

  • Beginner
  • *
  • Posts: 4
  • A beginner
Re: Registration with first_name, mail, password
« Reply #2 on: May 26, 2020, 12:25:59 PM »
Hello, I apologize, I have been unclear in explaining my problem.
For the needs of my shop I need to register the user by entering only first_name, email, password. How can I proceed to avoid errors and proceed with registration without entering the name and username.

I thank you in advance for your help

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10878
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.8.8
Re: Registration with first_name, mail, password
« Reply #3 on: May 26, 2020, 14:16:43 PM »
This is a question for Joomla.. the Joomla registration form has nothing to do with VM..

first_name has nothing to do with Joomla's Username  - there are plugins available to use email as username in the Joomla registration -- Richey Web do one

https://extensions.joomla.org/extension/authentication-email/
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4722
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Registration with first_name, mail, password
« Reply #4 on: May 26, 2020, 14:45:24 PM »
You can copy name using javascript and hide the fields
Or simply use email + password and copy email in all fields excluded password.

salvoelle

  • Beginner
  • *
  • Posts: 4
  • A beginner
Re: Registration with first_name, mail, password
« Reply #5 on: May 27, 2020, 13:27:24 PM »
GJC Web Design, Studio 42
thanks for your contribution, both solutions I had already examined, I wanted to continue on the second by copying the email entered by the user on all the necessary fields. But I got lost.
Could you help me write the code ??

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4722
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Registration with first_name, mail, password
« Reply #6 on: May 27, 2020, 18:22:08 PM »
You nedd to hide using CSS rules and add a javascript to copy on change from email field to other fields.
I have see the code in the forum for some months.

salvoelle

  • Beginner
  • *
  • Posts: 4
  • A beginner
Re: Registration with first_name, mail, password
« Reply #7 on: June 01, 2020, 00:12:17 AM »
Guys I think I did, tell me how it seems to you as a solution:
I edited a few lines of the following php file .../components/com_virtuemart/views/user/tmpl/edit_address_userfields.php

To make the "name" field disappear I replaced from line 103 to 112

ORIGINAL CODE

            <tr title="<?php echo strip_tags($descr) ?>">
               <td class="key"  >
                  <label class="<?php echo $field['name'] ?>" for="<?php echo $field['name'] ?>_field">
                     <?php echo $field['title'] . ($field['required'] ? ' <span class="asterisk">*</span>' : '') ?>
                  </label>
               </td>
               <td>
                  <?php echo $field['formcode'] ?>
               </td>
            </tr>

NEW CODE

                                <tr title="<?php echo strip_tags($descr) ?>" <?php if ($field['name']=="name") {echo 'style=display:none;';};?> >
               <td class="key"  >
                  <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>

At the end I inserted (line 127) a JS that allows me to derive the "name" field from the field that the user compiles "first_name"

<script type="text/javascript">
var $j = jQuery.noConflict();   //avoid conflict with other libraries

$j('#first_name_field').change(function () {             
   var reg_user = $j('#first_name_field').val();   //set first_name value inside variable
    $j('#name_field').val(reg_user);            //assign variable value to name
});
</script>

To work I have enabled, from the Virtuemart user fields, the "name" field

...I forgot !!! Compared to my initial needs, now I have entered the username visible and mandatory, as it facilitates user management in other parts of the site

How do you think the solution adopted?

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4722
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Registration with first_name, mail, password
« Reply #8 on: June 01, 2020, 21:16:31 PM »
It's easier to add an ID to the main container :
<tr title="<?php echo strip_tags($descr) ?>" id="<?php echo $field['name'] ?>_container">
Then add in the CSS file
#name_container,#XXX_container{
 display:none;
}
XXX is another container to hide for eg.