- Posts: 29
- Thank you received: 0
registration form customization
I would like hide the Name field in the registration process and fill it with First Name & Last name, as no one wants to fill out their name twice.
I understand this might be possible with simplified registration, however I want my user to be able to choose their own password.
any ideas on how to do this?
I have found this code for the address information (first name & last name) but unsure on where the "template" actually is.
<tr class="hikashop_registration_address_info_line">
<td colspan="2" height="40">
<?php echo JText::_( 'ADDRESS_INFORMATION' ); ?>
</td>
</tr>
<?php
$this->type = 'address';
echo $this->loadTemplate();
?>
<tr class="hikashop_registration_required_info_line">
<td colspan="2" height="40">
<?php echo JText::_( 'HIKA_REGISTER_REQUIRED' ); ?>
</td>
</tr>
I'm guessing I need to do something like this:
<input type="text" id="register_email" name="data[register]
Please Log in or Create an account to join the conversation.
The registration layout is located in the file "registration" of the view "user" that you can edit via the menu Display->Views. The address fields are displayed by the file "custom_fields" of the same view.
The address lastname and firstname fields have the ids address_lastname and address_firstname
Please Log in or Create an account to join the conversation.
i've come up with this:
<input class="inputbox required validate-password" type="password" id="register_password" name="data[register][password]" value="" onchange="document.getElementById('register_name').value = address_firstname.value + ' ' + address_lastname.value"/> *
while it works, it could pose a problem if the user changes their first and last name after they've put in a password. would you have any idea of a better way of doing it, maybe on submitting the form somehow? would it dupe the fields before checking if name was empty?
cheers
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
<tr class="hikashop_registration_name_line" style="display:none;">
Please Log in or Create an account to join the conversation.
i've done this but getting syntax errors
echo $this->cartClass->displayButton(JText::_('HIKA_REGISTER'),'register',$this->params,'','if(hikashopCheckChangeForm(\'register\',\''.$this->form_name.'\') && hikashopCheckChangeForm(\'user\',\''.$this->form_name.'\') && hikashopCheckChangeForm(\'address\',\''.$this->form_name.'\')'.$additional_check.'){ var button = document.getElementById(\'login_view_action\'); if(button) button.value=\'register\'; document.'.$this->form_name.'.submit(); document.getElementById('register_name').value = address_firstname.value + ' ' + address_lastname.value; } return false;');
i'm not great with JS
Please Log in or Create an account to join the conversation.
So it should be:
document.getElementById(\'register_name\').value = address_firstname.value + \' \' + address_lastname.value;
also, you should put it before the form submit: document.'.$this->form_name.'.submit();
Otherwise, the form is submitted before your javascript is done.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
#address_firstname{
width: 350px;
}
Please Log in or Create an account to join the conversation.
is it essential to upgrade to hikashop business if i want my own custom step in my workflow? (ideally customer enters email only on first step like amazon)
Please Log in or Create an account to join the conversation.
1. is not easy to do as the code is complex
2. means that you'll have to modify core files of HikaShop.
It's not related to the edition of HikaShop you're using.
Please Log in or Create an account to join the conversation.
<?php
$this->setLayout('custom_fields');
$this->type = 'user';
echo $this->loadTemplate();
?>
but it doesn't work. Is this an Hikashop edition lock (not allowed) or what?
Please Log in or Create an account to join the conversation.
There is no lock on that respect.
Please Log in or Create an account to join the conversation.