- Posts: 137
- Thank you received: 2
Required checkbox during registration
- emergentec
-
Topic Author
- Offline
We would like to have a required checkbox during registration to accept the terms and conditions. But if we set a checkbox to required it is marked as required, but you can register without checking the checkbox.
Best regards
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
if(!$field->field_required || strlen($value) || strlen($oldvalue)){
by:
if(!$field->field_required || is_array($value) || strlen($value) || strlen($oldvalue)){
in the file administrator/components/com_hikashop/classes/field.php
That should make it work.
This attachment is hidden for guests.
Please log in or register to see it.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I just tested it on our demo website and I can't register unless I check the required checkbox of the form so it works.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Could you give a link ?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please accept the terms and conditions before proceeding
and I'm redirected to the step where I can do that.
The terms and conditions view of the checkout is there to ensure that the user accepts them before finishing his order, not for the registration.
If you want a terms checkbox for the registration, you should create a new custom field of the table "user" of the type "checkbox" and required instead of using that view and the users won't be able to register unless they tick that checkbox.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
function after_terms(){
$app =& JFactory::getApplication();
$app->setUserState( HIKASHOP_COMPONENT.'.checkout_terms', JRequest::getInt('hikashop_checkout_terms',0) );
return true;
}
to:
function after_terms(){
$app =& JFactory::getApplication();
$app->setUserState( HIKASHOP_COMPONENT.'.checkout_terms', JRequest::getInt('hikashop_checkout_terms',0) );
return $this->check_terms();
}
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
The terms checkbox is displayed by the terms file of the view checkout.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- emergentec
-
Topic Author
- Offline
- Posts: 137
- Thank you received: 2
Please Log in or Create an account to join the conversation.